gpu: address extended guest memory without widening dense cache tables

This commit is contained in:
nmzik
2026-09-28 16:32:32 +04:00
parent c91fe80d64
commit 2016f8e2fe
12 changed files with 81 additions and 34 deletions
+5 -4
View File
@@ -136,8 +136,8 @@ bool ProtectAddressSpace(uint64_t vaddr, uint64_t size,
&old_protection) != 0;
}
uint8_t *Allocate(uint64_t size, uint32_t protection = PAGE_READWRITE) {
constexpr uintptr_t test_address = 0x0000000200010000ull;
uint8_t *Allocate(uint64_t size, uint32_t protection = PAGE_READWRITE,
uintptr_t test_address = 0x0000000200010000ull) {
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
auto *memory = static_cast<uint8_t *>(
VirtualAlloc(reinterpret_cast<void *>(test_address), size,
@@ -155,11 +155,11 @@ uint8_t *Allocate(uint64_t size, uint32_t protection = PAGE_READWRITE) {
return memory;
}
void TestWatchAndUnwatch() {
void TestWatchAndUnwatch(uint64_t base = 0x0000000200010000ull) {
g_protection_calls = 0;
PageManager manager;
const auto page_size = manager.GetPageSize();
auto *memory = Allocate(page_size * 2);
auto *memory = Allocate(page_size * 2, PAGE_READWRITE, base);
const auto address = reinterpret_cast<uint64_t>(memory);
manager.UpdatePageWatchers<true>(address, page_size);
@@ -580,6 +580,7 @@ int main(int argc, char **argv) {
RunDeathCase(argv[2]);
}
TestWatchAndUnwatch();
TestWatchAndUnwatch(Libs::LibKernel::Memory::kExtendedMemoryBase);
TestSharedWatcherCounts();
TestCrossRegionRange();
TestBatchedWatcherRanges();