From 0cc2b0fc9f12e222d4da00926e14c90c0bf891b3 Mon Sep 17 00:00:00 2001 From: DrChat Date: Wed, 14 Feb 2018 21:58:05 -0600 Subject: [PATCH] [Core] Protect the last 64kb of memory --- src/xenia/memory.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index 5461f027a..87f135682 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -171,12 +171,14 @@ bool Memory::Initialize() { heaps_.vE0000000.Initialize(virtual_membase_, 0xE0000000, 0x1FD00000, 4096, &heaps_.physical); - // Protect the first 64kb of memory. + // Protect the first and last 64kb of memory. heaps_.v00000000.AllocFixed( - 0x00000000, 64 * 1024, 64 * 1024, + 0x00000000, 0x10000, 0x10000, kMemoryAllocationReserve | kMemoryAllocationCommit, !FLAGS_protect_zero ? kMemoryProtectRead | kMemoryProtectWrite : kMemoryProtectNoAccess); + heaps_.physical.AllocFixed(0x1FFF0000, 0x10000, 0x10000, + kMemoryAllocationReserve, kMemoryProtectNoAccess); // GPU writeback. // 0xC... is physical, 0x7F... is virtual. We may need to overlay these.