From 631bd7e084c042b799bc1497be3bfc01ed1d5f83 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 30 Aug 2017 13:22:58 +0200 Subject: OvmfPkg/BaseMemEncryptSevLib: clean up debug logging of PhysicalAddress In the SetMemoryEncDec() function, the way we currently report PhysicalAddress is not uniform: - mostly we say "for %lx", - in one spot we say "at %lx" (even though the 2MB page being split does not live *at* PhysicalAddress, instead it maps PhysicalAddress), - in another spot we don't log PhysicalAddress at all (when splitting a 1GB page). Unify this, using the format string "for Physical=0x%Lx". Cc: Brijesh Singh Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Brijesh Singh Tested-by: Brijesh Singh --- .../Library/BaseMemEncryptSevLib/X64/VirtualMemory.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c index 5e8c9b4c43..58c793dae6 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c @@ -288,7 +288,7 @@ SetMemoryEncDec ( if (!PageMapLevel4Entry->Bits.Present) { DEBUG (( DEBUG_WARN, - "%a:%a: ERROR bad PML4 for %lx\n", + "%a:%a: ERROR bad PML4 for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress @@ -301,7 +301,7 @@ SetMemoryEncDec ( if (!PageDirectory1GEntry->Bits.Present) { DEBUG (( DEBUG_WARN, - "%a:%a: ERROR bad PDPE for %lx\n", + "%a:%a: ERROR bad PDPE for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress @@ -321,7 +321,7 @@ SetMemoryEncDec ( SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode); DEBUG (( DEBUG_VERBOSE, - "%a:%a: Updated 1GB entry for %lx\n", + "%a:%a: Updated 1GB entry for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress @@ -334,9 +334,10 @@ SetMemoryEncDec ( // DEBUG (( DEBUG_VERBOSE, - "%a:%a: Spliting 1GB page\n", + "%a:%a: Spliting 1GB page for Physical=0x%Lx\n", gEfiCallerBaseName, - __FUNCTION__ + __FUNCTION__, + PhysicalAddress )); Split1GPageTo2M(((UINT64)PageDirectory1GEntry->Bits.PageTableBaseAddress)<<30, (UINT64*) PageDirectory1GEntry, 0, 0); continue; @@ -351,7 +352,7 @@ SetMemoryEncDec ( if (!PageDirectory2MEntry->Bits.Present) { DEBUG (( DEBUG_WARN, - "%a:%a: ERROR bad PDE for %lx\n", + "%a:%a: ERROR bad PDE for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress @@ -376,7 +377,7 @@ SetMemoryEncDec ( // DEBUG (( DEBUG_VERBOSE, - "%a:%a: Spliting 2MB page at %lx\n", + "%a:%a: Spliting 2MB page for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress @@ -391,7 +392,7 @@ SetMemoryEncDec ( if (!PageTableEntry->Bits.Present) { DEBUG (( DEBUG_WARN, - "%a:%a: ERROR bad PTE for %lx\n", + "%a:%a: ERROR bad PTE for Physical=0x%Lx\n", gEfiCallerBaseName, __FUNCTION__, PhysicalAddress -- cgit v1.2.3