From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.26051.1660717211956709837 for ; Tue, 16 Aug 2022 23:20:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aJA+NN1M; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: w.sheng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660717212; x=1692253212; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ke1qhvfz6g25wqjizLmeL7Dzn7YBB82mSlnCtuAhMB4=; b=aJA+NN1MnqxBXKDAnUbZdHl9Cb8dJ6fAZDnemsOu2hx9AOCPTV/WOFez K7yDbEwZXqXDl3/qj27epad7kmYrXkvAhnkE5jybOEXAH1uMFPwwNeZcL 0Z9i4E5ZEHfkeo14SmMOF0T/HWpFw/oV4qCElq6LvxEJDAwKcZt2P9o04 wpxBgHefQHKhfxDryC/DPlO5qXmD/6cFyRsraJRaG39GEgPnPw+iMy8gp drY9IQE6SGWrL01KdiNRkEFI8CqR4pzLubM/ebnhntgJsWU+pA2qFofzX TLWyy2JWAUIE35ffLtCPoA2ZoxxpL/eQuhfpQ+8dnQ1dZAvt8CT870S/j Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="293208155" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="293208155" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 23:20:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="583631424" Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.43]) by orsmga006.jf.intel.com with ESMTP; 16 Aug 2022 23:20:09 -0700 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty , Jenny Huang , Robert Kowalewski Subject: [PATCH] IntelSiliconPkg/VTd: Add DMAR SIDP Table dumpping Date: Wed, 17 Aug 2022 14:20:06 +0800 Message-Id: <20220817062006.1617-1-w.sheng@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable VT-d spec 4.0 has added a new structure called SIDP which is more generic to describe special properties of integrated devices. Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Jenny Huang Cc: Robert Kowalewski Signed-off-by: Sheng Wei --- .../Feature/VTd/IntelVTdDxe/DmarAcpiTable.c | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpi= Table.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTab= le.c index 75fbd53ed..42e1b1449 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c @@ -93,6 +93,10 @@ DumpDmarDeviceScopeEntry ( " Length ............................................. 0x%02x\n",= =0D DmarDeviceScopeEntry->Length=0D ));=0D + DEBUG ((DEBUG_INFO,=0D + " Flags .............................................. 0x%02x\n",= =0D + DmarDeviceScopeEntry->Flags=0D + ));=0D DEBUG ((DEBUG_INFO,=0D " Enumeration ID ..................................... 0x%02x\n",= =0D DmarDeviceScopeEntry->EnumerationId=0D @@ -122,6 +126,66 @@ DumpDmarDeviceScopeEntry ( return;=0D }=0D =0D +/**=0D + Dump DMAR SIDP table.=0D +=0D + @param[in] Sidp DMAR SIDP table=0D +**/=0D +VOID=0D +DumpDmarSidp (=0D + IN EFI_ACPI_DMAR_SIDP_HEADER *Sidp=0D + )=0D +{=0D + EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *DmarDeviceScopeEntry;=0D + INTN SidpLen;=0D +=0D + if (Sidp =3D=3D NULL) {=0D + return;=0D + }=0D +=0D + DEBUG ((DEBUG_INFO,=0D + " *******************************************************************= ********\n"=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + " * SoC Integrated Device Property Reporting Structure = *\n"=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + " *******************************************************************= ********\n"=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + (sizeof(UINTN) =3D=3D sizeof(UINT64)) ?=0D + " SIDP address ........................................... 0x%016lx\n= " :=0D + " SIDP address ........................................... 0x%08x\n",= =0D + Sidp=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + " Type ................................................. 0x%04x\n",= =0D + Sidp->Header.Type=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + " Length ............................................... 0x%04x\n",= =0D + Sidp->Header.Length=0D + ));=0D + DEBUG ((DEBUG_INFO,=0D + " Segment Number ....................................... 0x%04x\n",= =0D + Sidp->SegmentNumber=0D + ));=0D +=0D + SidpLen =3D Sidp->Header.Length - sizeof(EFI_ACPI_DMAR_SIDP_HEADER);=0D + DmarDeviceScopeEntry =3D (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *)= (Sidp + 1);=0D + while (SidpLen > 0) {=0D + DumpDmarDeviceScopeEntry (DmarDeviceScopeEntry);=0D + SidpLen -=3D DmarDeviceScopeEntry->Length;=0D + DmarDeviceScopeEntry =3D (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER = *)((UINTN)DmarDeviceScopeEntry + DmarDeviceScopeEntry->Length);=0D + }=0D +=0D + DEBUG ((DEBUG_INFO,=0D + " *******************************************************************= ********\n\n"=0D + ));=0D +=0D + return;=0D +}=0D +=0D /**=0D Dump DMAR SATC table.=0D =0D @@ -472,6 +536,10 @@ DumpDmarDrhd ( " Flags ................................................ 0x%02x\n",= =0D Drhd->Flags=0D ));=0D + DEBUG ((DEBUG_INFO,=0D + " Size ................................................. 0x%02x\n",= =0D + Drhd->Size=0D + ));=0D DEBUG ((DEBUG_INFO,=0D " INCLUDE_PCI_ALL .................................... 0x%02x\n",= =0D Drhd->Flags & EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL=0D @@ -583,7 +651,11 @@ DumpAcpiDMAR ( case EFI_ACPI_DMAR_TYPE_SATC:=0D DumpDmarSatc ((EFI_ACPI_DMAR_SATC_HEADER *)DmarHeader);=0D break;=0D + case EFI_ACPI_DMAR_TYPE_SIDP:=0D + DumpDmarSidp ((EFI_ACPI_DMAR_SIDP_HEADER *)DmarHeader);=0D + break;=0D default:=0D + DEBUG ((DEBUG_INFO, "Unknown DMAR Table Type : %d\n", DmarHeader->Ty= pe));=0D break;=0D }=0D DmarLen -=3D DmarHeader->Length;=0D --=20 2.26.2.windows.1