[edk2-devel] [PATCH] Silicon/Intel: Dump DMAR SATC Table

Sheng Wei posted 1 patch 3 years, 4 months ago
Failed in applying to current master (apply log)
.../Feature/VTd/IntelVTdDxe/DmarAcpiTable.c        | 67 ++++++++++++++++++++++
1 file changed, 67 insertions(+)
[edk2-devel] [PATCH] Silicon/Intel: Dump DMAR SATC Table
Posted by Sheng Wei 3 years, 4 months ago
SoC Integrated Address Translation Cache (SATC) reporting structure is one
of the Remapping Structure, which is imported since Intel(R) Virtualization
Technology for Directed I/O (VT-D) Architecture Specification v3.2.
IntelVtdDxe driver will dump the DMAR SATC struct.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3115

Signed-off-by: Sheng Wei <w.sheng@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jenny Huang <jenny.huang@intel.com>
Cc: Kowalewski Robert <robert.kowalewski@intel.com>
Cc: Feng Roger <roger.feng@intel.com>
Reviewed-by: Jenny Huang <jenny.huang@intel.com>
---
 .../Feature/VTd/IntelVTdDxe/DmarAcpiTable.c        | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
index 52bc1890..2d9b4374 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
@@ -122,6 +122,70 @@ DumpDmarDeviceScopeEntry (
   return;
 }
 
+/**
+  Dump DMAR SATC table.
+
+  @param[in]  Satc  DMAR SATC table
+**/
+VOID
+DumpDmarSatc (
+  IN EFI_ACPI_DMAR_SATC_HEADER *Satc
+  )
+{
+  EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER       *DmarDeviceScopeEntry;
+  INTN                                    SatcLen;
+
+  if (Satc == NULL) {
+    return;
+  }
+
+  DEBUG ((DEBUG_INFO,
+    "  ***************************************************************************\n"
+    ));
+  DEBUG ((DEBUG_INFO,
+    "  *       ACPI Soc Integrated Address Translation Cache reporting Structure *\n"
+    ));
+  DEBUG ((DEBUG_INFO,
+    "  ***************************************************************************\n"
+    ));
+  DEBUG ((DEBUG_INFO,
+    (sizeof(UINTN) == sizeof(UINT64)) ?
+    "  SATC address ........................................... 0x%016lx\n" :
+    "  SATC address ........................................... 0x%08x\n",
+    Satc
+    ));
+  DEBUG ((DEBUG_INFO,
+    "    Type ................................................. 0x%04x\n",
+    Satc->Header.Type
+    ));
+  DEBUG ((DEBUG_INFO,
+    "    Length ............................................... 0x%04x\n",
+    Satc->Header.Length
+    ));
+  DEBUG ((DEBUG_INFO,
+    "    Flags ................................................ 0x%02x\n",
+    Satc->Flags
+    ));
+  DEBUG ((DEBUG_INFO,
+    "    Segment Number ....................................... 0x%04x\n",
+    Satc->SegmentNumber
+    ));
+
+  SatcLen  = Satc->Header.Length - sizeof(EFI_ACPI_DMAR_SATC_HEADER);
+  DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *)(Satc + 1);
+  while (SatcLen > 0) {
+    DumpDmarDeviceScopeEntry (DmarDeviceScopeEntry);
+    SatcLen -= DmarDeviceScopeEntry->Length;
+    DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *)((UINTN)DmarDeviceScopeEntry + DmarDeviceScopeEntry->Length);
+  }
+
+  DEBUG ((DEBUG_INFO,
+    "  ***************************************************************************\n\n"
+    ));
+
+  return;
+}
+
 /**
   Dump DMAR ANDD table.
 
@@ -516,6 +580,9 @@ DumpAcpiDMAR (
     case EFI_ACPI_DMAR_TYPE_ANDD:
       DumpDmarAndd ((EFI_ACPI_DMAR_ANDD_HEADER *)DmarHeader);
       break;
+    case EFI_ACPI_DMAR_TYPE_SATC:
+      DumpDmarSatc ((EFI_ACPI_DMAR_SATC_HEADER *)DmarHeader);
+      break;
     default:
       break;
     }
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69373): https://edk2.groups.io/g/devel/message/69373
Mute This Topic: https://groups.io/mt/79144566/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-