From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.112997.1680639088079996772 for ; Tue, 04 Apr 2023 13:11:28 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: sam.kaynor@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 36BA5FEC; Tue, 4 Apr 2023 13:12:12 -0700 (PDT) Received: from beelzebub.ast.arm.com (u203625-lin.austin.arm.com [10.118.28.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A04DD3F73F; Tue, 4 Apr 2023 13:11:27 -0700 (PDT) From: "Sam Kaynor" To: devel@edk2.groups.io Cc: Sam Kaynor , Ray Ni , Zhichao Gao , Sam Kaynor Subject: [PATCH v2 1/1] ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c Date: Tue, 4 Apr 2023 15:11:16 -0500 Message-Id: <20230404201116.1557339-2-sam.kaynor@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230404201116.1557339-1-sam.kaynor@arm.com> References: <20230404201116.1557339-1-sam.kaynor@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Added entries for UEFI Config Tables not present in current Dmem output. v2 for revising CI formatting errors. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor --- ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf= | 9 ++ ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c = | 99 ++++++++++++++++++-- ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni= | 28 ++++-- 3 files changed, 123 insertions(+), 13 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com= mandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.inf index 74ad5facf6b1..3741dac5d94c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.inf @@ -121,6 +121,7 @@ [Protocols] gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES=0D gEfiSimplePointerProtocolGuid ## SOMETIMES_CONSUMES=0D gEfiCpuIo2ProtocolGuid ## SOMETIMES_CONSUMES=0D + gEfiHiiDatabaseProtocolGuid ## SOMETIMES_CONSUMES=0D =0D [Guids]=0D gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ## GUID=0D @@ -130,3 +131,11 @@ [Guids] gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D gShellDebug1HiiGuid ## SOMETIMES_CONSUMES ## HII=0D + gEfiMemoryAttributesTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiRtPropertiesTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiSystemResourceTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiDebugImageInfoTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiImageSecurityDatabaseGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiJsonCapsuleDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D + gEfiJsonCapsuleResultTableGuid ## SOMETIMES_CONSUMES ## SystemTable=0D diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/= Library/UefiShellDebug1CommandsLib/Dmem.c index c52c212a56f8..a609971f345e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -10,9 +10,15 @@ =0D #include "UefiShellDebug1CommandsLib.h"=0D #include =0D +#include =0D #include =0D #include =0D #include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D =0D /**=0D Make a printable character.=0D @@ -108,6 +114,18 @@ ShellCommandRunDmem ( UINT64 SalTableAddress;=0D UINT64 SmbiosTableAddress;=0D UINT64 MpsTableAddress;=0D + UINT64 DtbTableAddress;=0D + UINT64 MemoryAttributesTableAddress;=0D + UINT64 RtPropertiesTableAddress;=0D + UINT64 SystemResourceTableAddress;=0D + UINT64 DebugImageInfoTableAddress;=0D + UINT64 ImageExecutionTableAddress;=0D + UINT64 JsonConfigDataTableAddress;=0D + UINT64 JsonCapsuleDataTableAddress;=0D + UINT64 JsonCapsuleResultTableAddress;=0D + UINT64 MemoryRangeCapsuleAddress;=0D + UINT64 HiiDatabaseExportBufferAddress;=0D + UINT64 ConformanceProfileTableAddress;=0D UINTN TableWalker;=0D =0D ShellStatus =3D SHELL_SUCCESS;=0D @@ -168,11 +186,23 @@ ShellCommandRunDmem ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW),= gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);=0D DumpHex (2, (UINTN)Address, (UINTN)Size, Address);=0D if (Address =3D=3D (VOID *)gST) {=0D - Acpi20TableAddress =3D 0;=0D - AcpiTableAddress =3D 0;=0D - SalTableAddress =3D 0;=0D - SmbiosTableAddress =3D 0;=0D - MpsTableAddress =3D 0;=0D + Acpi20TableAddress =3D 0;=0D + AcpiTableAddress =3D 0;=0D + SalTableAddress =3D 0;=0D + SmbiosTableAddress =3D 0;=0D + MpsTableAddress =3D 0;=0D + DtbTableAddress =3D 0;=0D + MemoryAttributesTableAddress =3D 0;=0D + RtPropertiesTableAddress =3D 0;=0D + SystemResourceTableAddress =3D 0;=0D + DebugImageInfoTableAddress =3D 0;=0D + ImageExecutionTableAddress =3D 0;=0D + JsonConfigDataTableAddress =3D 0;=0D + JsonCapsuleDataTableAddress =3D 0;=0D + JsonCapsuleResultTableAddress =3D 0;=0D + MemoryRangeCapsuleAddress =3D 0;=0D + HiiDatabaseExportBufferAddress =3D 0;=0D + ConformanceProfileTableAddress =3D 0;=0D for (TableWalker =3D 0; TableWalker < gST->NumberOfTableEntries;= TableWalker++) {=0D if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiAcpi20TableGuid)) {=0D Acpi20TableAddress =3D (UINT64)(UINTN)gST->ConfigurationTabl= e[TableWalker].VendorTable;=0D @@ -198,6 +228,51 @@ ShellCommandRunDmem ( MpsTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTable[T= ableWalker].VendorTable;=0D continue;=0D }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiMemoryAttributesTableGuid)) {=0D + MemoryAttributesTableAddress =3D (UINT64)(UINTN)gST->Configu= rationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiRtPropertiesTableGuid)) {=0D + RtPropertiesTableAddress =3D (UINT64)(UINTN)gST->Configurati= onTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiSystemResourceTableGuid)) {=0D + SystemResourceTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiDebugImageInfoTableGuid)) {=0D + DebugImageInfoTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiImageSecurityDatabaseGuid)) {=0D + ImageExecutionTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonConfigDataTableGuid)) {=0D + JsonConfigDataTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonCapsuleDataTableGuid)) {=0D + JsonCapsuleDataTableAddress =3D (UINT64)(UINTN)gST->Configur= ationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonCapsuleResultTableGuid)) {=0D + JsonCapsuleResultTableAddress =3D (UINT64)(UINTN)gST->Config= urationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D +=0D + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiHiiDatabaseProtocolGuid)) {=0D + HiiDatabaseExportBufferAddress =3D (UINT64)(UINTN)gST->Confi= gurationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D }=0D =0D ShellPrintHiiEx (=0D @@ -218,7 +293,19 @@ ShellCommandRunDmem ( AcpiTableAddress,=0D Acpi20TableAddress,=0D MpsTableAddress,=0D - SmbiosTableAddress=0D + SmbiosTableAddress,=0D + DtbTableAddress,=0D + MemoryAttributesTableAddress,=0D + RtPropertiesTableAddress,=0D + SystemResourceTableAddress,=0D + DebugImageInfoTableAddress,=0D + ImageExecutionTableAddress,=0D + JsonConfigDataTableAddress,=0D + JsonCapsuleDataTableAddress,=0D + JsonCapsuleResultTableAddress,=0D + MemoryRangeCapsuleAddress,=0D + HiiDatabaseExportBufferAddress,=0D + ConformanceProfileTableAddress=0D );=0D }=0D } else {=0D diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com= mandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni index 4fedc0d1493c..4041f0cd483e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -107,13 +107,27 @@ "-----------------------= ----------------------\r\n"=0D "System: Table Structure= size %08x revision %08x\r\n"=0D "ConIn (%016LX) ConOut (= %016LX) StdErr (%016LX)\r\n"=0D - "Runtime Services %016LX= \r\n"=0D - "Boot Services %016LX= \r\n"=0D - "SAL System Table %016LX= \r\n"=0D - "ACPI Table %016LX= \r\n"=0D - "ACPI 2.0 Table %016LX= \r\n"=0D - "MPS Table %016LX= \r\n"=0D - "SMBIOS Table %016LX= \r\n"=0D + "Runtime Services = %016LX\r\n"=0D + "Boot Services = %016LX\r\n"=0D + "SAL System Table = %016LX\r\n"=0D + "ACPI Table = %016LX\r\n"=0D + "ACPI 2.0 Table = %016LX\r\n"=0D + "MPS Table = %016LX\r\n"=0D + "SMBIOS Table = %016LX\r\n"=0D + "DTB Table = %016LX\r\n"=0D + "Memory Attribute Table = %016LX\r\n"=0D + "RT Properties Table = %016LX\r\n"=0D + "System Resource Table = %016LX\r\n"=0D + "Debug Image Info Table = %016LX\r\n"=0D + "Image Execution Info Ta= ble %016LX\r\n"=0D + "Json Config Data Table = %016LX\r\n"=0D + "Json Capsule Data Table= %016LX\r\n"=0D + "Json Capsule Results Ta= ble %016LX\r\n"=0D + "Memory Range Capsule = %016LX\r\n"=0D + "Hii Database Export Buf= fer %016LX\r\n"=0D + "Conformance Profile Tab= le %016LX\r\n"=0D +=0D +=0D =0D #string STR_LOAD_PCI_ROM_RES #language en-US "Image '%B%s%N' load res= ult: %r\r\n"=0D #string STR_LOADPCIROM_CORRUPT #language en-US "%H%s%N: File '%B%s%N' I= mage %d is corrupt.\r\n"=0D --=20 2.25.1