public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>,
	Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH 04/11] OvmfPkg/BaseMemEncryptSevLib: clean up debug logging of PhysicalAddress
Date: Wed, 30 Aug 2017 17:53:10 +0200	[thread overview]
Message-ID: <20170830155317.30917-5-lersek@redhat.com> (raw)
In-Reply-To: <20170830155317.30917-1-lersek@redhat.com>

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 <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 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




  parent reply	other threads:[~2017-08-30 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 15:53 [PATCH 00/11] OvmfPkg: improve SEV-related DEBUG messages Laszlo Ersek
2017-08-30 15:53 ` [PATCH 01/11] OvmfPkg/BaseMemEncryptSevLib: unify encrypt/decrypt " Laszlo Ersek
2017-08-30 15:53 ` [PATCH 02/11] OvmfPkg/BaseMemEncryptSevLib: break DEBUG calls to multiple lines Laszlo Ersek
2017-08-30 15:53 ` [PATCH 03/11] OvmfPkg/BaseMemEncryptSevLib: clean up DEBUG prefixes Laszlo Ersek
2017-08-30 15:53 ` Laszlo Ersek [this message]
2017-08-30 15:53 ` [PATCH 05/11] OvmfPkg/BaseMemEncryptSevLib: promote DEBUG_WARN levels to DEBUG_ERROR Laszlo Ersek
2017-08-30 15:53 ` [PATCH 06/11] OvmfPkg/BaseMemEncryptSevLib: clean up upper-case / lower-case in DEBUGs Laszlo Ersek
2017-08-30 15:53 ` [PATCH 07/11] OvmfPkg/BaseMemEncryptSevLib: fix typos in DEBUG messages Laszlo Ersek
2017-08-30 15:53 ` [PATCH 08/11] OvmfPkg/IoMmuDxe: IoMmuMap(): log nicer and more informative DEBUG msgs Laszlo Ersek
2017-08-30 15:53 ` [PATCH 09/11] OvmfPkg/IoMmuDxe: IoMmuUnmap(): clean up DEBUG message Laszlo Ersek
2017-08-30 15:53 ` [PATCH 10/11] OvmfPkg/IoMmuDxe: IoMmuAllocateBuffer(): nicer and more informative DEBUGs Laszlo Ersek
2017-08-30 15:53 ` [PATCH 11/11] OvmfPkg/IoMmuDxe: IoMmuFreeBuffer(): clean up DEBUG message Laszlo Ersek
2017-08-31 15:14 ` [PATCH 00/11] OvmfPkg: improve SEV-related DEBUG messages Brijesh Singh
2017-09-01 12:23   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170830155317.30917-5-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox