mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
gpu: address extended guest memory without widening dense cache tables
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user