From bf291613a3a48e0c46542d9553728964dc9eb606 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Sun, 10 Aug 2025 18:07:26 +0200 Subject: [PATCH] Add debug messages to display PML set by bootloader --- xtldr/modules/xtos_o/amd64/memory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xtldr/modules/xtos_o/amd64/memory.c b/xtldr/modules/xtos_o/amd64/memory.c index ebc09d6..36d9890 100644 --- a/xtldr/modules/xtos_o/amd64/memory.c +++ b/xtldr/modules/xtos_o/amd64/memory.c @@ -212,6 +212,18 @@ XtEnablePaging(IN PXTBL_PAGE_MAPPING PageMap) return STATUS_EFI_ABORTED; } + /* Check the configured page map level to set the LA57 state accordingly */ + if(PageMap->PageMapLevel == 5) + { + /* Enable Linear Address 57-bit (LA57) extension */ + XtLdrProtocol->Debug.Print(L"Enabling Linear Address 57-bit (LA57)\n"); + } + else + { + /* Disable Linear Address 57-bit (LA57) extension */ + XtLdrProtocol->Debug.Print(L"Disabling Linear Address 57-bit (LA57)\n"); + } + /* Write PML4 to CR3 */ ArWriteControlRegister(3, (UINT_PTR)PageMap->PtePointer);