From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0458021D2E630 for ; Wed, 30 Aug 2017 08:53:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76B2A7E43F; Wed, 30 Aug 2017 15:53:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 76B2A7E43F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-136.rdu2.redhat.com [10.10.120.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86C588D543; Wed, 30 Aug 2017 15:53:26 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Brijesh Singh , Jordan Justen Date: Wed, 30 Aug 2017 17:53:10 +0200 Message-Id: <20170830155317.30917-5-lersek@redhat.com> In-Reply-To: <20170830155317.30917-1-lersek@redhat.com> References: <20170830155317.30917-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 30 Aug 2017 15:53:27 +0000 (UTC) Subject: [PATCH 04/11] OvmfPkg/BaseMemEncryptSevLib: clean up debug logging of PhysicalAddress X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2017 15:53:24 -0000 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 --- OvmfPkg/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 5e8c9b4c439b..58c793dae6bf 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 -- 2.14.1.3.gb7cf6e02401b