From nobody Wed May 15 22:01:51 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+102536+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+102536+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1680639089; cv=none; d=zohomail.com; s=zohoarc; b=dZEMoNIydbEyssAZsIg9fWhDMse0yLVZhMni1FVfDyC7il1veebEq0CqheHFYF8qTznVJZGBI5V98ZilNdVmUMvOHQOUC5xXqNXpG5G6gFCp+UFy3kXZFY5XFS4UAddtpr8UI8Ky4pffaNr+1BCm/weRnivpoGd+EEP3JavztoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680639089; 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=N5zsGRzK6UUCx3XXFb9oi2Lj8Jyr7BF2aYqscIDhDMY=; b=J4cUy/0s2X/nDRryF8MmBfuy8wKFUX9hQHrfiaEfewbwCimErWdsua1eBu5j54cK9ZmSiWYT8BLw1EDlknI63PVpQHCXYNgiBJxj2mbBVR/tzuSPlpu7RjSDF3mHouRbsG3tpNQZI078NbpOXU2baYYqvCCAZyfL95AF0SVys6I= 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+102536+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 1680639089079629.580759145391; Tue, 4 Apr 2023 13:11:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tbXSYY1788612xyCloZrBG2K; Tue, 04 Apr 2023 13:11:28 -0700 X-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 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 36BA5FEC; Tue, 4 Apr 2023 13:12:12 -0700 (PDT) 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 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: [edk2-devel] [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> In-Reply-To: <20230404201116.1557339-1-sam.kaynor@arm.com> References: <20230404201116.1557339-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: 2YBNRK7uuiJNfLKyn1nmnUlWx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680639088; bh=SIt/13c2rklMPEezEhSY3oRXdrQ1BuMYjCZUOI14gII=; h=Cc:Date:From:Reply-To:Subject:To; b=TzXSLV0+RUqgp0IL7UlE5xIb8DbAJk/nxKDuFySYsXTh7t8dV+5sAvsZSYuRuCm5SpB dXQBi+9eqy7gY1dYDahT01BL+pxcpatZP8csQVGQim1wmzX2IbcLW10QYuV8Ss1xNjT3X It49TVeEE/f3OSJAVMuhGbhoh786pyX8GJg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680639090634100001 Content-Type: text/plain; charset="utf-8" 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 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..a609971f345e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -10,9 +10,15 @@ =20 #include "UefiShellDebug1CommandsLib.h" #include +#include #include #include #include +#include +#include +#include +#include +#include =20 /** Make a printable character. @@ -108,6 +114,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 +186,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; @@ -198,6 +228,51 @@ ShellCommandRunDmem ( MpsTableAddress =3D (UINT64)(UINTN)gST->ConfigurationTable[T= ableWalker].VendorTable; continue; } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiMemoryAttributesTableGuid)) { + MemoryAttributesTableAddress =3D (UINT64)(UINTN)gST->Configu= rationTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiRtPropertiesTableGuid)) { + RtPropertiesTableAddress =3D (UINT64)(UINTN)gST->Configurati= onTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiSystemResourceTableGuid)) { + SystemResourceTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiDebugImageInfoTableGuid)) { + DebugImageInfoTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiImageSecurityDatabaseGuid)) { + ImageExecutionTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonConfigDataTableGuid)) { + JsonConfigDataTableAddress =3D (UINT64)(UINTN)gST->Configura= tionTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonCapsuleDataTableGuid)) { + JsonCapsuleDataTableAddress =3D (UINT64)(UINTN)gST->Configur= ationTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiJsonCapsuleResultTableGuid)) { + JsonCapsuleResultTableAddress =3D (UINT64)(UINTN)gST->Config= urationTable[TableWalker].VendorTable; + continue; + } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorG= uid, &gEfiHiiDatabaseProtocolGuid)) { + HiiDatabaseExportBufferAddress =3D (UINT64)(UINTN)gST->Confi= gurationTable[TableWalker].VendorTable; + continue; + } } =20 ShellPrintHiiEx ( @@ -218,7 +293,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 4fedc0d1493c..4041f0cd483e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -107,13 +107,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 (#102536): https://edk2.groups.io/g/devel/message/102536 Mute This Topic: https://groups.io/mt/98068437/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-