From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 764CA941C93 for ; Thu, 4 Apr 2024 21:27:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aWJqU+5PvaPbBPzliWS2ZXaNQR+oo9zbdl5ShQPjKYA=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712266030; v=1; b=JRT1O1wMZiW7FoZ/FLmzlcQ2So7Vp+gzWaCZkhCKyn8HvN8dwuthAsi1+z0/xbd1DFWKUHo5 ioBh/K4WwdSbm9SgG2jX3/L5VL+D6+9eMJADFGGtOOoHpPPCESayT/MHpwrBknlxxkpJQOjyh/j r8ZVwHpJ+mx+pzLtUOhFN/DFjU7gd013MdhfqmzK6v/X/hZHy8hYFVGkfh3mWmYuA98MuUTIo8t oGDaICJb/Rqf5xbGITbVxwRMT85UrWStdvQZ75EAsWIm/Fo06denVeK70XSHsdn+JKBs4/dUN+r VKQBTIAEpQN/7rt7DdOMzZVRmpadhRvpmBaFjaSS7SyNw== X-Received: by 127.0.0.2 with SMTP id 8idGYY7687511xsaF3QBd6Xb; Thu, 04 Apr 2024 14:27:10 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.4538.1712266029429871689 for ; Thu, 04 Apr 2024 14:27:09 -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 B81B4FEC; Thu, 4 Apr 2024 14:27:39 -0700 (PDT) X-Received: from [10.118.105.166] (C02F85CGML7H.austin.arm.com [10.118.105.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D14CE3F64C; Thu, 4 Apr 2024 14:27:08 -0700 (PDT) Message-ID: <626d96d5-042d-47b1-9ab2-f87cd8465e4a@arm.com> Date: Thu, 4 Apr 2024 16:27:08 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v4 3/3] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c To: devel@edk2.groups.io, sam.kaynor@arm.com Cc: Ray Ni , Zhichao Gao , Michael D Kinney , Liming Gao , Zhiguang Liu References: <20240403211933.1662236-1-Sam.Kaynor@arm.com> <20240403211933.1662236-4-Sam.Kaynor@arm.com> From: "Stuart Yoder" In-Reply-To: <20240403211933.1662236-4-Sam.Kaynor@arm.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 04 Apr 2024 14:27:09 -0700 Resent-From: stuart.yoder@arm.com Reply-To: devel@edk2.groups.io,stuart.yoder@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: HxH7zt6Y4bX6XMcS0nr5bwRax7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=JRT1O1wM; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Stuart Yoder On 4/3/24 4:19 PM, Sam Kaynor via groups.io wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4352 >=20 > Implemented dumping of the UEFI Conformance Profiles Table using Dmem.c > Additionally added the base support for the table with new > header file ConformanceProfiles.h (Cc'd maintainers of MdePkg for this) >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Sam Kaynor > --- >=20 > Notes: > v3: > - fixed build errors > - properly using Address variable > - removed unecessary comment in header file >=20 > MdePkg/MdePkg.dec = | 5 ++ > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.= inf | 3 + > MdePkg/Include/Guid/ConformanceProfiles.h = | 56 ++++++++++++++++ > ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c = | 69 ++++++++++++++++++++ > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.= uni | 5 ++ > 5 files changed, 138 insertions(+) >=20 > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 0c18e1decd51..861838c148f3 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -746,6 +746,11 @@ [Guids] > ## Include/Guid/DeviceAuthentication.h > gEfiDeviceSignatureDatabaseGuid =3D { 0xb9c2b4f4, 0xbf5f, 0x462d, {0= x8a, 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }} > =20 > + ## Include/Guid/ConformanceProfiles.h > + gEfiConfProfilesTableGuid =3D { 0x36122546, 0xf7e7, 0x4c8f, { 0= xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }} > + gEfiConfProfilesUefiSpecGuid =3D { 0x523c91af, 0xa195, 0x4382, { 0= x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }} > + gEfiConfProfilesEbbrSpecGuid =3D { 0xcce33c35, 0x74ac, 0x4087, { 0= xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }} > + > # > # GUID defined in PI1.0 > # > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug= 1CommandsLib.inf > index 3741dac5d94c..172ac2862ba1 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.inf > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.inf > @@ -139,3 +139,6 @@ [Guids] > gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable > gEfiJsonCapsuleDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable > gEfiJsonCapsuleResultTableGuid ## SOMETIMES_CONSUMES ## SystemTable > + gEfiConfProfilesTableGuid ## SOMETIMES_CONSUMES ## SystemTable > + gEfiConfProfilesUefiSpecGuid ## SOMETIMES_CONSUMES ## GUID > + gEfiConfProfilesEbbrSpecGuid ## SOMETIMES_CONSUMES ## GUID > diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h b/MdePkg/Include/G= uid/ConformanceProfiles.h > new file mode 100644 > index 000000000000..c6211d63d79c > --- /dev/null > +++ b/MdePkg/Include/Guid/ConformanceProfiles.h > @@ -0,0 +1,56 @@ > +/** @file > + Legal information > + > +**/ > + > +#ifndef __CONFORMANCE_PROFILES_TABLE_GUID_H__ > +#define __CONFORMANCE_PROFILES_TABLE_GUID_H__ > + > + > +// > +// This table allows the platform to advertise its UEFI specification co= nformance > +// in the form of pre-defined profiles. Each profile is identified by a = GUID, with > +// known profiles listed in the section below. > +// The absence of this table shall indicate that the platform implementa= tion is > +// conformant with the UEFI specification requirements, as defined in Se= ction 2.6. > +// This is equivalent to publishing this configuration table with the > +// EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID conformance profile. > +// > +#define EFI_CONFORMANCE_PROFILES_TABLE_GUID \ > + { \ > + 0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x= 0c, 0x0b } \ > + } > + > +#pragma pack(1) > + > +typedef struct { > + /// > + /// Version of the table must be 0x1 > + /// > + UINT16 Version; > + /// > + /// The number of profiles GUIDs present in ConformanceProfiles > + /// > + UINT16 NumberOfProfiles; > + /// > + /// An array of conformance profile GUIDs that are supported by this s= ystem. > + /// EFI_GUID ConformanceProfiles[]; > + /// > +} EFI_CONFORMANCE_PROFILES_TABLE; > + > +#define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 0x1 > + > +// > +// GUID defined in spec. > +// > +#define EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID \ > + { 0x523c91af, 0xa195, 0x4382, \ > + { 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }} > +#define EFI_CONFORMANCE_PROFILE_EBBR_2_1_GUID \ > + { 0xcce33c35, 0x74ac, 0x4087, \ > + { 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }} > + > +extern EFI_GUID gEfiConfProfilesTableGuid; > +extern EFI_GUID gEfiConfProfilesUefiSpecGuid; > + > +#endif > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPk= g/Library/UefiShellDebug1CommandsLib/Dmem.c > index 813759a9055d..2618402bc714 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > =20 > /** > Make a printable character. > @@ -268,7 +269,67 @@ DisplayImageExecutionEntries ( > return (ShellStatus); > } > =20 > +/** > + Display the ConformanceProfileTable entries > =20 > + @param[in] Address The pointer to the ConformanceProfileTable. > +**/ > +SHELL_STATUS > +DisplayConformanceProfiles ( > + IN UINT64 Address > + ) > +{ > + SHELL_STATUS ShellStatus; > + EFI_STATUS Status; > + EFI_GUID *EntryGuid; > + CHAR16 *GuidName; > + EFI_CONFORMANCE_PROFILES_TABLE *ConfProfTable; > + > + ShellStatus =3D SHELL_SUCCESS; > + > + if (Address !=3D 0) { > + ConfProfTable =3D (EFI_CONFORMANCE_PROFILES_TABLE *)Address; > + > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_CONF_PRO_TABLE= ), gShellDebug1HiiHandle); > + > + EntryGuid =3D (EFI_GUID *)(ConfProfTable + 1); > + > + for (int Profile =3D 0; Profile < ConfProfTable->NumberOfProfiles; P= rofile++, EntryGuid++) { > + GuidName =3D L"Unknown_Profile"; > + > + if (CompareGuid (EntryGuid, &gEfiConfProfilesEbbrSpecGuid)) { > + GuidName =3D L"EBBR_2.1"; > + } > + > + Status =3D ShellPrintHiiEx ( > + -1, > + -1, > + NULL, > + STRING_TOKEN (STR_DMEM_CONF_PRO_ROW), > + gShellDebug1HiiHandle, > + GuidName, > + EntryGuid > + ); > + } > + if (EFI_ERROR (Status)) { > + ShellStatus =3D SHELL_ABORTED; > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL= ), gShellDebug1HiiHandle, L"ComformanceProfilesTable"); > + } > + } else { > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_CONF_PRO_TABLE= ), gShellDebug1HiiHandle); > + ShellPrintHiiEx ( > + -1, > + -1, > + NULL, > + STRING_TOKEN (STR_DMEM_CONF_PRO_ROW), > + gShellDebug1HiiHandle, > + L"EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID", > + &gEfiConfProfilesUefiSpecGuid > + ); > + } > + > + return (ShellStatus); > +} > =20 > STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { > { L"-mmio", TypeFlag }, > @@ -460,6 +521,11 @@ ShellCommandRunDmem ( > HiiDatabaseExportBufferAddress =3D (UINT64)(UINTN)gST->Co= nfigurationTable[TableWalker].VendorTable; > continue; > } > + > + if (CompareGuid (&gST->ConfigurationTable[TableWalker].Vendo= rGuid, &gEfiConfProfilesTableGuid)) { > + ConformanceProfileTableAddress =3D (UINT64)(UINTN)gST->Con= figurationTable[TableWalker].VendorTable; > + continue; > + } > } > =20 > ShellPrintHiiEx ( > @@ -503,6 +569,9 @@ ShellCommandRunDmem ( > if (ShellStatus =3D=3D SHELL_SUCCESS) { > ShellStatus =3D DisplayImageExecutionEntries (ImageExecutio= nTableAddress); > } > + if (ShellStatus =3D=3D SHELL_SUCCESS) { > + ShellStatus =3D DisplayConformanceProfiles(ConformanceProfil= eTableAddress); > + } > } > =20 > } else { > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug= 1CommandsLib.uni > index 3b730164ddce..6ef923e4fd5e 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.uni > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.uni > @@ -147,6 +147,11 @@ > #string STR_DMEM_IMG_EXE_TABLE #language en-US "\r\nImage Execution = Table\r\n" > "--------------------= --------------------\r\n" > #string STR_DMEM_IMG_EXE_ENTRY #language en-US "%20s: %s\r\n" > +#string STR_DMEM_CONF_PRO_TABLE #language en-US "\r\nConformance Profi= le Table\r\n" > + "---------------------= -------------------\r\n" > + "Version 0x1\r\n" > + "Profile GUIDs:\r\n" > +#string STR_DMEM_CONF_PRO_ROW #language en-US " %s %g\r\n" > #string STR_DMEM_ERR_NOT_FOUND #language en-US "\r\n%H%s%N: Table ad= dress not found.\r\n" > #string STR_DMEM_ERR_GET_FAIL #language en-US "\r\n%H%s%N: Unable t= o get table information.\r\n" > =20 -=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 (#117446): https://edk2.groups.io/g/devel/message/117446 Mute This Topic: https://groups.io/mt/105318210/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-