]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c
OvmfPkg/BaseMemEncryptSevLib: unify encrypt/decrypt DEBUG messages
[mirror_edk2.git] / OvmfPkg / Library / BaseMemEncryptSevLib / X64 / VirtualMemory.c
index 7cbbf915f4438dbb04d2035ffc9b5f72c0c99340..dbaad7766dbe6b5d99d7f2d47507d5e6ffb45036 100644 (file)
@@ -239,6 +239,18 @@ SetMemoryEncDec (
   UINT64                         PgTableMask;\r
   UINT64                         AddressEncMask;\r
 \r
+  DEBUG ((\r
+    DEBUG_VERBOSE,\r
+    "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx Mode=%a CacheFlush=%u\n",\r
+    gEfiCallerBaseName,\r
+    __FUNCTION__,\r
+    Cr3BaseAddress,\r
+    PhysicalAddress,\r
+    (UINT64)Length,\r
+    (Mode == SetCBit) ? "Encrypt" : "Decrypt",\r
+    (UINT32)CacheFlush\r
+    ));\r
+\r
   //\r
   // Check if we have a valid memory encryption mask\r
   //\r
@@ -399,10 +411,6 @@ InternalMemEncryptSevSetMemoryDecrypted (
   )\r
 {\r
 \r
-  DEBUG ((DEBUG_VERBOSE,\r
-    "%a:%a Clear C-bit Cr3 %Lx Base %Lx Length %Lx flush %d\n",\r
-    gEfiCallerBaseName, __FUNCTION__, Cr3BaseAddress, PhysicalAddress, Length,\r
-    Flush));\r
   return SetMemoryEncDec (Cr3BaseAddress, PhysicalAddress, Length, ClearCBit, Flush);\r
 }\r
 \r
@@ -431,9 +439,5 @@ InternalMemEncryptSevSetMemoryEncrypted (
   IN  BOOLEAN                 Flush\r
   )\r
 {\r
-  DEBUG ((DEBUG_VERBOSE,\r
-    "%a:%a Set C-bit Cr3 %Lx Base %Lx Length %Lx flush %d\n",\r
-    gEfiCallerBaseName, __FUNCTION__, Cr3BaseAddress, PhysicalAddress, Length,\r
-    Flush));\r
   return SetMemoryEncDec (Cr3BaseAddress, PhysicalAddress, Length, SetCBit, Flush);\r
 }\r