diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm index 544e3c3892464..7a8a8fa1d5c62 100644 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm @@ -30,6 +30,10 @@ ;------------------------------------------------------------------------------ global ASM_PFX(InternalX86EnablePaging64) ASM_PFX(InternalX86EnablePaging64): + jmp $ + mov dx, 0x3f8 + mov al, 't' + out dx, al cli mov DWORD [esp], .0 ; offset for far retf, seg is the 1st arg mov eax, cr4 diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm index 074dc1846011a..09ad9b65c3cf5 100644 --- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm +++ b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm @@ -26,6 +26,9 @@ ;------------------------------------------------------------------------------ global ASM_PFX(InternalX86WriteIdtr) ASM_PFX(InternalX86WriteIdtr): + mov dx, 0x3f8 + mov al, 't' + out dx, al mov eax, [esp + 4] pushfd cli diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf index d09bd12bef19d..4d78e64fa286a 100644 --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf @@ -240,6 +240,7 @@ PcdLib DebugLib BaseMemoryLib + IoLib [Pcd] gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength ## SOMETIMES_CONSUMES diff --git a/MdePkg/Library/BaseLib/X86EnablePaging64.c b/MdePkg/Library/BaseLib/X86EnablePaging64.c index 1323e68de5fc8..578b71d323a38 100644 --- a/MdePkg/Library/BaseLib/X86EnablePaging64.c +++ b/MdePkg/Library/BaseLib/X86EnablePaging64.c @@ -8,9 +8,10 @@ - +#include #include "BaseLibInternals.h" + /** Enables the 64-bit paging mode on the CPU. @@ -53,7 +54,10 @@ AsmEnablePaging64 ( IN UINT64 NewStack ) { + IoWrite8(0x3f8, '9'); ASSERT (EntryPoint != 0); ASSERT (NewStack != 0); + IoWrite8(0x3f8, '8'); + CpuDeadLoop(); InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack); } diff --git a/MdePkg/Library/BaseLib/X86WriteIdtr.c b/MdePkg/Library/BaseLib/X86WriteIdtr.c index 9ea979b76d944..b66d601212be2 100644 --- a/MdePkg/Library/BaseLib/X86WriteIdtr.c +++ b/MdePkg/Library/BaseLib/X86WriteIdtr.c @@ -8,7 +8,7 @@ - +#include #include "BaseLibInternals.h" /** @@ -28,6 +28,8 @@ AsmWriteIdtr ( IN CONST IA32_DESCRIPTOR *Idtr ) { + IoWrite8(0x3f8, 'z'); ASSERT (Idtr != NULL); + IoWrite8(0x3f8, 'z'); InternalX86WriteIdtr (Idtr); } diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c index 186b50a9ed68a..4fab1c4a72027 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c +++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c @@ -345,7 +345,7 @@ HandOffToDxeCore ( DEBUG (( DEBUG_INFO, - "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n", + "%a() Stack Base: 0x%lx, oooooStack Size: 0x%x\n", __FUNCTION__, BaseOfStack, STACK_SIZE @@ -356,6 +356,7 @@ HandOffToDxeCore ( // Interrupts will not get turned on until the CPU AP is loaded. // Call x64 drivers passing in single argument, a pointer to the HOBs. // + DEBUG ((DEBUG_INFO, "the AsmEnablePaging64 addr is %p\n", AsmEnablePaging64)); AsmEnablePaging64 ( SYS_CODE64_SEL, DxeCoreEntryPoint, diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index 98995c80c6f9f..3ee5af36722da 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -400,6 +400,8 @@ _ModuleEntryPoint ( // Call constructor for all libraries ProcessLibraryConstructorList (); + DEBUG ((DEBUG_INFO, "the entrypoint addr is %p\n", _ModuleEntryPoint)); + DEBUG ((DEBUG_INFO, "the ProcessLibraryConstructorList addr is %p\n", ProcessLibraryConstructorList)); DEBUG ((DEBUG_INFO, "Entering Universal Payload...\n")); DEBUG ((DEBUG_INFO, "sizeof(UINTN) = 0x%x\n", sizeof(UINTN))); @@ -412,7 +414,7 @@ _ModuleEntryPoint ( // Initialize floating point operating environment to be compliant with UEFI spec. InitializeFloatingPointUnits (); - + DEBUG ((DEBUG_INFO, "the InitializeFloatingPointUnits addr is %p\n", InitializeFloatingPointUnits)); // Build HOB based on information from Bootloader Status = BuildHobs (BootloaderParameter, &DxeFv); ASSERT_EFI_ERROR (Status);