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.2794.1675804840565121324 for ; Tue, 07 Feb 2023 13:20:41 -0800 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 897181042; Tue, 7 Feb 2023 13:21:22 -0800 (PST) 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 1CCFE3F703; Tue, 7 Feb 2023 13:20:40 -0800 (PST) From: "Sam Kaynor" To: devel@edk2.groups.io Cc: Sam Kaynor , Ray Ni , Zhichao Gao Subject: [PATCH v1 1/1] ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c Date: Tue, 7 Feb 2023 15:19:57 -0600 Message-Id: <20230207211957.62077-2-Sam.Kaynor@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230207211957.62077-1-Sam.Kaynor@arm.com> References: <20230207211957.62077-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. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor --- ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf= | 9 ++ ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c = | 89 ++++++++++++++++++-- ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni= | 28 ++++-- 3 files changed, 112 insertions(+), 14 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..e2aed306d466 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -10,9 +10,16 @@ =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 +#include =0D =0D /**=0D Make a printable character.=0D @@ -108,6 +115,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 +187,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 @@ -193,11 +224,43 @@ ShellCommandRunDmem ( SmbiosTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTabl= e[TableWalker].VendorTable;=0D continue;=0D }=0D -=0D if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiMpsTableGuid)) {=0D MpsTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTable[T= ableWalker].VendorTable;=0D continue;=0D }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiMemoryAttributesTableGuid)) {=0D + MemoryAttributesTableAddress =3D (UINT64)(UINTN)gST->Configu= rationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiRtPropertiesTableGuid)) {=0D + RtPropertiesTableAddress =3D (UINT64)(UINTN)gST->Configurati= onTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiSystemResourceTableGuid)) {=0D + SystemResourceTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiDebugImageInfoTableGuid)) {=0D + DebugImageInfoTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiImageSecurityDatabaseGuid)) {=0D + ImageExecutionTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonConfigDataTableGuid)) {=0D + JsonConfigDataTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonCapsuleDataTableGuid)) {=0D + JsonCapsuleDataTableAddress =3D (UINT64)(UINTN)gST->Configur= ationTable[TableWalker].VendorTable;=0D + continue;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonCapsuleResultTableGuid)) {=0D + JsonCapsuleResultTableAddress =3D (UINT64)(UINTN)gST->Config= urationTable[TableWalker].VendorTable;=0D + }=0D + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiHiiDatabaseProtocolGuid)) {=0D + HiiDatabaseExportBufferAddress =3D (UINT64)(UINTN)gST->Confi= gurationTable[TableWalker].VendorTable;=0D + }=0D }=0D =0D ShellPrintHiiEx (=0D @@ -218,7 +281,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 b1d239ed37ea..c1067a0474cd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -108,13 +108,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