From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99774+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99774+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1675804841; cv=none; d=zohomail.com; s=zohoarc; b=IYjVWZHc3TkqnJfyDkjETNXURn9bd6zIJrI50zUIdUhPzKJcx2cV0iDhECm8Jw2djAD7esVH34sMKKCSGHrQCkFrxG/QGPsYItIBmcqSeJEGIev0GIwACakOgNGPD2YYeTKz6dvbl/5/uwCzdIPONCwmSsMJxojwk+Ujo8OOcZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675804841; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=EcR7ohtIP1QiHDwjqZoUL0BI9ZgRd7F67Rw+hmGBzL8=; b=I/atQdi/0JO2+pY6AMsspPxtI5t5JHMrugRv85g8z7PR9L6ijEPk4wMFmLm+45m7KGbO9M/QDk6uQzA9C8kLTUQKWGUYNpcGdWZxA1sqkkyXR0pdFPudBXcg9zHx3iBrU11DquPUR3uwl8idUN6UvmPhl1GnMDI12J751wu3FaQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99774+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1675804841787946.8535621984623; Tue, 7 Feb 2023 13:20:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id NNVuYY1788612x8IuT32DIyO; Tue, 07 Feb 2023 13:20:41 -0800 X-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 X-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) X-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: [edk2-devel] [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> In-Reply-To: <20230207211957.62077-1-Sam.Kaynor@arm.com> References: <20230207211957.62077-1-Sam.Kaynor@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sam.kaynor@arm.com X-Gm-Message-State: QYsGzzyA3dKkfFCyyJVDPQ8fx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1675804841; bh=gNaWUBjaxbsLstGfelC+432Wfv5KgGAoXit1mPg38sc=; h=Cc:Date:From:Reply-To:Subject:To; b=fPCluhzTyqSVj4uFXnL+GyR+ZCF7dtraXqvqyS2JYayU5yyUVB7DydLM2b++3TIPnZx +OVIKdUP7LwjK8PsUEZAE1wXPgNfjgh2kyczcqKWpuoAwvdESVd82JyCb7LlF4jr2m5u2 IKq6DXAiCgiYUFRVdfKw6abD7UU2oeSSAtI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1675804842699100001 Content-Type: text/plain; charset="utf-8" Added entries for UEFI Config Tables not present in current Dmem output. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor Reviewed-by Samer El-Haj-Mahmoud Reviewed-by: Sunny Wang Reviewed-by: Zhichao Gao --- 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 gEfiSimplePointerProtocolGuid ## SOMETIMES_CONSUMES gEfiCpuIo2ProtocolGuid ## SOMETIMES_CONSUMES + gEfiHiiDatabaseProtocolGuid ## SOMETIMES_CONSUMES =20 [Guids] gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ## GUID @@ -130,3 +131,11 @@ [Guids] gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES ## SystemTable gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable gShellDebug1HiiGuid ## SOMETIMES_CONSUMES ## HII + gEfiMemoryAttributesTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiRtPropertiesTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiSystemResourceTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiDebugImageInfoTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiImageSecurityDatabaseGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiJsonCapsuleDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiJsonCapsuleResultTableGuid ## SOMETIMES_CONSUMES ## SystemTable 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 @@ =20 #include "UefiShellDebug1CommandsLib.h" #include +#include #include #include #include +#include +#include +#include +#include +#include +#include =20 /** Make a printable character. @@ -108,6 +115,18 @@ ShellCommandRunDmem ( UINT64 SalTableAddress; UINT64 SmbiosTableAddress; UINT64 MpsTableAddress; + UINT64 DtbTableAddress; + UINT64 MemoryAttributesTableAddress; + UINT64 RtPropertiesTableAddress; + UINT64 SystemResourceTableAddress; + UINT64 DebugImageInfoTableAddress; + UINT64 ImageExecutionTableAddress; + UINT64 JsonConfigDataTableAddress; + UINT64 JsonCapsuleDataTableAddress; + UINT64 JsonCapsuleResultTableAddress; + UINT64 MemoryRangeCapsuleAddress; + UINT64 HiiDatabaseExportBufferAddress; + UINT64 ConformanceProfileTableAddress; UINTN TableWalker; =20 ShellStatus =3D SHELL_SUCCESS; @@ -168,11 +187,23 @@ ShellCommandRunDmem ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW),= gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size); DumpHex (2, (UINTN)Address, (UINTN)Size, Address); if (Address =3D=3D (VOID *)gST) { - Acpi20TableAddress =3D 0; - AcpiTableAddress =3D 0; - SalTableAddress =3D 0; - SmbiosTableAddress =3D 0; - MpsTableAddress =3D 0; + Acpi20TableAddress =3D 0; + AcpiTableAddress =3D 0; + SalTableAddress =3D 0; + SmbiosTableAddress =3D 0; + MpsTableAddress =3D 0; + DtbTableAddress =3D 0; + MemoryAttributesTableAddress =3D 0; + RtPropertiesTableAddress =3D 0; + SystemResourceTableAddress =3D 0; + DebugImageInfoTableAddress =3D 0; + ImageExecutionTableAddress =3D 0; + JsonConfigDataTableAddress =3D 0; + JsonCapsuleDataTableAddress =3D 0; + JsonCapsuleResultTableAddress =3D 0; + MemoryRangeCapsuleAddress =3D 0; + HiiDatabaseExportBufferAddress =3D 0; + ConformanceProfileTableAddress =3D 0; for (TableWalker =3D 0; TableWalker < gST->NumberOfTableEntries;= TableWalker++) { if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiAcpi20TableGuid)) { Acpi20TableAddress =3D (UINT64)(UINTN)gST->ConfigurationTabl= e[TableWalker].VendorTable; @@ -193,11 +224,43 @@ ShellCommandRunDmem ( SmbiosTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTabl= e[TableWalker].VendorTable; continue; } - if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiMpsTableGuid)) { MpsTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTable[T= ableWalker].VendorTable; continue; } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiMemoryAttributesTableGuid)) { + MemoryAttributesTableAddress =3D (UINT64)(UINTN)gST->Configu= rationTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiRtPropertiesTableGuid)) { + RtPropertiesTableAddress =3D (UINT64)(UINTN)gST->Configurati= onTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiSystemResourceTableGuid)) { + SystemResourceTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiDebugImageInfoTableGuid)) { + DebugImageInfoTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiImageSecurityDatabaseGuid)) { + ImageExecutionTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonConfigDataTableGuid)) { + JsonConfigDataTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonCapsuleDataTableGuid)) { + JsonCapsuleDataTableAddress =3D (UINT64)(UINTN)gST->Configur= ationTable[TableWalker].VendorTable; + continue; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiJsonCapsuleResultTableGuid)) { + JsonCapsuleResultTableAddress =3D (UINT64)(UINTN)gST->Config= urationTable[TableWalker].VendorTable; + } + if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGu= id, &gEfiHiiDatabaseProtocolGuid)) { + HiiDatabaseExportBufferAddress =3D (UINT64)(UINTN)gST->Confi= gurationTable[TableWalker].VendorTable; + } } =20 ShellPrintHiiEx ( @@ -218,7 +281,19 @@ ShellCommandRunDmem ( AcpiTableAddress, Acpi20TableAddress, MpsTableAddress, - SmbiosTableAddress + SmbiosTableAddress, + DtbTableAddress, + MemoryAttributesTableAddress, + RtPropertiesTableAddress, + SystemResourceTableAddress, + DebugImageInfoTableAddress, + ImageExecutionTableAddress, + JsonConfigDataTableAddress, + JsonCapsuleDataTableAddress, + JsonCapsuleResultTableAddress, + MemoryRangeCapsuleAddress, + HiiDatabaseExportBufferAddress, + ConformanceProfileTableAddress ); } } else { 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" "System: Table Structure= size %08x revision %08x\r\n" "ConIn (%016LX) ConOut (= %016LX) StdErr (%016LX)\r\n" - "Runtime Services %016LX= \r\n" - "Boot Services %016LX= \r\n" - "SAL System Table %016LX= \r\n" - "ACPI Table %016LX= \r\n" - "ACPI 2.0 Table %016LX= \r\n" - "MPS Table %016LX= \r\n" - "SMBIOS Table %016LX= \r\n" + "Runtime Services = %016LX\r\n" + "Boot Services = %016LX\r\n" + "SAL System Table = %016LX\r\n" + "ACPI Table = %016LX\r\n" + "ACPI 2.0 Table = %016LX\r\n" + "MPS Table = %016LX\r\n" + "SMBIOS Table = %016LX\r\n" + "DTB Table = %016LX\r\n" + "Memory Attribute Table = %016LX\r\n" + "RT Properties Table = %016LX\r\n" + "System Resource Table = %016LX\r\n" + "Debug Image Info Table = %016LX\r\n" + "Image Execution Info Ta= ble %016LX\r\n" + "Json Config Data Table = %016LX\r\n" + "Json Capsule Data Table= %016LX\r\n" + "Json Capsule Results Ta= ble %016LX\r\n" + "Memory Range Capsule = %016LX\r\n" + "Hii Database Export Buf= fer %016LX\r\n" + "Conformance Profile Tab= le %016LX\r\n" + + =20 #string STR_LOAD_PCI_ROM_RES #language en-US "Image '%B%s%N' load res= ult: %r\r\n" #string STR_LOADPCIROM_CORRUPT #language en-US "%H%s%N: File '%B%s%N' I= mage %d is corrupt.\r\n" --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#99774): https://edk2.groups.io/g/devel/message/99774 Mute This Topic: https://groups.io/mt/96817141/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-