public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Silicon/Intel: Dump DMAR SATC Table
@ 2020-12-22  7:07 Sheng Wei
  0 siblings, 0 replies; only message in thread
From: Sheng Wei @ 2020-12-22  7:07 UTC (permalink / raw)
  To: devel
  Cc: Ray Ni, Rangasai V Chaganty, Jiewen Yao, Jenny Huang,
	Kowalewski Robert, Feng Roger

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-22  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-22  7:07 [PATCH] Silicon/Intel: Dump DMAR SATC Table Sheng Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox