]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/IoMmuDxe: IoMmuAllocateBuffer(): nicer and more informative DEBUGs
authorLaszlo Ersek <lersek@redhat.com>
Wed, 30 Aug 2017 12:35:58 +0000 (14:35 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 1 Sep 2017 12:20:45 +0000 (14:20 +0200)
Log all relevant IN and IN OUT parameters on entry.

(Note that the HostAddress parameter is IN OUT rather than OUT due to
historical reasons. The "IN EFI_ALLOCATE_TYPE Type" parameter is now to be
ignored, but historically it could be set to AllocateMaxAddress for
example, and for that HostAddress had to be IN OUT.)

When exiting with success, log all relevant OUT parameters (i.e.,
HostAddress). Also log the new (internal) StashBuffer address, on which
IoMmuMap() and IoMmuUnmap() rely on, for BusMasterCommonBuffer operations
(in-place decryption and encryption, respectively).

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>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
OvmfPkg/IoMmuDxe/AmdSevIoMmu.c

index a153d250d54562e1acd4cfda22e060f1177fad11..0ab7043498bda817c54c32970805f92a8f82313d 100644 (file)
@@ -490,6 +490,15 @@ IoMmuAllocateBuffer (
   UINTN                     CommonBufferPages;\r
   COMMON_BUFFER_HEADER      *CommonBufferHeader;\r
 \r
+  DEBUG ((\r
+    DEBUG_VERBOSE,\r
+    "%a: MemoryType=%u Pages=0x%Lx Attributes=0x%Lx\n",\r
+    __FUNCTION__,\r
+    (UINT32)MemoryType,\r
+    (UINT64)Pages,\r
+    Attributes\r
+    ));\r
+\r
   //\r
   // Validate Attributes\r
   //\r
@@ -566,10 +575,10 @@ IoMmuAllocateBuffer (
 \r
   DEBUG ((\r
     DEBUG_VERBOSE,\r
-    "%a Address 0x%Lx Pages 0x%Lx\n",\r
+    "%a: Host=0x%Lx Stash=0x%p\n",\r
     __FUNCTION__,\r
     PhysicalAddress,\r
-    (UINT64)Pages\r
+    StashBuffer\r
     ));\r
   return EFI_SUCCESS;\r
 \r