From bb56641e4b58d31fbeb2009d7d56963777247bd5 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 16 Jan 2023 21:58:30 +0100 Subject: [PATCH] Do not call SetVirtualAddressMap() as this might break boot process and runtime services are mapped anyway --- xtldr/amd64/memory.c | 4 ---- xtldr/i686/memory.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/xtldr/amd64/memory.c b/xtldr/amd64/memory.c index e4705c5..315fccb 100644 --- a/xtldr/amd64/memory.c +++ b/xtldr/amd64/memory.c @@ -120,10 +120,6 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, return STATUS_EFI_ABORTED; } - /* No runtime services should touch boot services code, so get rid of it all at this point */ - EfiSystemTable->RuntimeServices->SetVirtualAddressMap(MemoryMap->MapSize, MemoryMap->DescriptorSize, - MemoryMap->DescriptorVersion, MemoryMap->Map); - /* Write PML4 to CR3 */ HlWriteControlRegister(3, (UINT_PTR)*PtePointer); diff --git a/xtldr/i686/memory.c b/xtldr/i686/memory.c index b15680a..aa62e90 100644 --- a/xtldr/i686/memory.c +++ b/xtldr/i686/memory.c @@ -214,10 +214,6 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, return STATUS_EFI_ABORTED; } - /* No runtime services should touch boot services code, so get rid of it all at this point */ - EfiSystemTable->RuntimeServices->SetVirtualAddressMap(MemoryMap->MapSize, MemoryMap->DescriptorSize, - MemoryMap->DescriptorVersion, MemoryMap->Map); - /* Enable Physical Address Extension (PAE) */ HlWriteControlRegister(4, HlReadControlRegister(4) | CR4_PAE);