From 7aaee521a1966e71a51b71b73f5e3bbddb6faa31 Mon Sep 17 00:00:00 2001 From: Thamballi Sreelalitha Date: Thu, 4 Jul 2024 14:16:03 +0530 Subject: FmpDevicePkg: Correct broken Depex in FmpDxe Commit 2f6f3329add3 ("FmpDevicePkg/FmpDxe: Use new Variable Lock interface"), moved to using gEdkiiVariablePolicyProtocolGuid instead of gEdkiiVariableLockProtocolGuid however the Depex was not updated to reflect the change. Correct the dependency. Signed-off-by: Vishal Oliyil Kunnil --- FmpDevicePkg/FmpDxe/FmpDxe.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 FmpDevicePkg/FmpDxe/FmpDxe.inf diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf b/FmpDevicePkg/FmpDxe/FmpDxe.inf old mode 100644 new mode 100755 index 1c296388b0..d7a02733de --- a/FmpDevicePkg/FmpDxe/FmpDxe.inf +++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf @@ -5,6 +5,7 @@ # # Copyright (c) 2016, Microsoft Corporation. All rights reserved.
# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -78,7 +79,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed ## SOMETIMES_PRODUCES [Depex] - gEfiVariableWriteArchProtocolGuid AND gEdkiiVariableLockProtocolGuid + gEfiVariableWriteArchProtocolGuid AND gEdkiiVariablePolicyProtocolGuid [UserExtensions.TianoCore."ExtraFiles"] FmpDxeExtra.uni -- cgit From f91211049c1522f7db2ae8f7a509ac270868d0e9 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 12 Jul 2018 23:44:35 +0000 Subject: MdeModulePkg: Remove PeiAllocatePool() Assert Removes an assert if PeiAllocatePool() fails to allocate memory to defer error handling to the caller so the error can be handled gracefully or asserted at that location which is more specific to the call that led to the allocation. Signed-off-by: Michael Kubacki --- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 52f37c960e..59613e5131 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -862,8 +862,6 @@ PeiAllocatePool ( (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size), (VOID **)&Hob ); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { *Buffer = NULL; } else { -- cgit From 749065300a42d86e55074f461feed23533a77ab3 Mon Sep 17 00:00:00 2001 From: Sam Kaynor Date: Wed, 10 Jan 2024 12:33:01 -0600 Subject: ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented the dumping of the UEFI RT Properties Table using Dmem.c Added new entry to the help command for the -verbose option Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor Tested-by: Stuart Yoder Reviewed-by: Stuart Yoder Reviewed-by: Zhichao Gao --- ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 66 +++++++++++++++++++++- .../UefiShellDebug1CommandsLib.uni | 23 +++++++- 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c index a609971f34..d4030798f3 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -84,9 +84,65 @@ DisplayMmioMemory ( return (ShellStatus); } +/** + Display the RtPropertiesTable entries + + @param[in] Address The pointer to the RtPropertiesTable. +**/ +SHELL_STATUS +DisplayRtProperties ( + IN UINT64 Address + ) +{ + EFI_RT_PROPERTIES_TABLE *RtPropertiesTable; + UINT32 RtServices; + SHELL_STATUS ShellStatus; + EFI_STATUS Status; + + ShellStatus = SHELL_SUCCESS; + + if (Address != 0) { + EfiGetSystemConfigurationTable (&gEfiRtPropertiesTableGuid, (VOID **)&RtPropertiesTable); + + RtServices = (UINT32)RtPropertiesTable->RuntimeServicesSupported; + Status = ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_DMEM_RT_PROPERTIES), + gShellDebug1HiiHandle, + EFI_RT_PROPERTIES_TABLE_VERSION, + (RtServices & EFI_RT_SUPPORTED_GET_TIME) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_SET_TIME) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_GET_VARIABLE) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_SET_VARIABLE) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_CONVERT_POINTER) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_RESET_SYSTEM) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_UPDATE_CAPSULE) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES) ? 1 : 0, + (RtServices & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) ? 1 : 0 + ); + + if (EFI_ERROR (Status)) { + ShellStatus = SHELL_ABORTED; + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL), gShellDebug1HiiHandle, L"RtPropertiesTable"); + } + } else { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_NOT_FOUND), gShellDebug1HiiHandle, L"RtPropertiesTable"); + } + + return (ShellStatus); +} + STATIC CONST SHELL_PARAM_ITEM ParamList[] = { - { L"-mmio", TypeFlag }, - { NULL, TypeMax } + { L"-mmio", TypeFlag }, + { L"-verbose", TypeFlag }, + { NULL, TypeMax } }; /** @@ -308,6 +364,12 @@ ShellCommandRunDmem ( ConformanceProfileTableAddress ); } + + if (ShellCommandLineGetFlag (Package, L"-verbose")) { + if (ShellStatus == SHELL_SUCCESS) { + ShellStatus = DisplayRtProperties (RtPropertiesTableAddress); + } + } } else { ShellStatus = DisplayMmioMemory (Address, (UINTN)Size); } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 4041f0cd48..a2241614f1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -126,8 +126,26 @@ "Memory Range Capsule %016LX\r\n" "Hii Database Export Buffer %016LX\r\n" "Conformance Profile Table %016LX\r\n" - - +#string STR_DMEM_RT_PROPERTIES #language en-US "\r\nRT Properties Table\r\n" + "----------------------------------------\r\n" + "Version 0x%01LX\r\n" + "Runtime Services Supported:\r\n" + " GET_TIME %d\r\n" + " GET_WAKEUP_TIME %d\r\n" + " SET_TIME %d\r\n" + " SET_WAKEUP_TIME %d\r\n" + " GET_VARIABLE %d\r\n" + " GET_NEXT_VARIABLE_NAME %d\r\n" + " SET_VARIABLE %d\r\n" + " SET_VIRTUAL_ADDRESS_MAP %d\r\n" + " CONVERT_POINTERS %d\r\n" + " GET_NEXT_HIGH_MONOTONIC_COUNT %d\r\n" + " RESET_SYSTEM %d\r\n" + " UPDATE_CAPSULE %d\r\n" + " QUERY_CAPSULE_CAPABILITIES %d\r\n" + " QUERY_VARIABLE_INFO %d\r\n" +#string STR_DMEM_ERR_NOT_FOUND #language en-US "\r\n%H%s%N: Table address not found.\r\n" +#string STR_DMEM_ERR_GET_FAIL #language en-US "\r\n%H%s%N: Unable to get table information.\r\n" #string STR_LOAD_PCI_ROM_RES #language en-US "Image '%B%s%N' load result: %r\r\n" #string STR_LOADPCIROM_CORRUPT #language en-US "%H%s%N: File '%B%s%N' Image %d is corrupt.\r\n" @@ -589,6 +607,7 @@ " \r\n" " -b - Displays one screen at a time.\r\n" " -MMIO - Forces address cycles to the PCI bus.\r\n" +" -verbose - Displays contents of certain EFI System Tables.\r\n" " address - Specifies a starting address in hexadecimal format.\r\n" " size - Specifies the number of bytes to display in hexadecimal format.\r\n" ".SH DESCRIPTION\r\n" -- cgit From f46b5b06c69dcd0a7997b416789617e5d33ae18a Mon Sep 17 00:00:00 2001 From: Sam Kaynor Date: Wed, 10 Jan 2024 12:48:17 -0600 Subject: ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the Image Execution Table using Dmem.c Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor Tested-by: Stuart Yoder Reviewed-by: Stuart Yoder Reviewed-by: Zhichao Gao --- ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 136 +++++++++++++++++++++ .../UefiShellDebug1CommandsLib.uni | 3 + 2 files changed, 139 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c index d4030798f3..80c779a0b3 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -139,6 +139,138 @@ DisplayRtProperties ( return (ShellStatus); } +/** + Retrieve the ImageExecutionTable Entry ImageName from ImagePath + + @param[in] FileName The full path of the image. + @param[out] BaseName The name of the image. +**/ +EFI_STATUS +GetBaseName ( + IN CHAR16 *FileName, + OUT CHAR16 **BaseName + ) +{ + UINTN StrLen; + CHAR16 *StrTail; + + StrLen = StrSize (FileName); + + for (StrTail = FileName + StrLen - 1; StrTail != FileName && *StrTail != L'\\'; StrTail--) { + } + + if (StrTail == FileName) { + return EFI_NOT_FOUND; + } + + *BaseName = StrTail+1; + + return EFI_SUCCESS; +} + +/** + Retrieve the ImageExecutionTable entries. +**/ +EFI_STATUS +GetImageExecutionInfo ( + ) +{ + EFI_STATUS Status; + EFI_IMAGE_EXECUTION_INFO_TABLE *ExecInfoTablePtr; + EFI_IMAGE_EXECUTION_INFO *InfoPtr; + CHAR8 *ptr; + CHAR16 *ImagePath; + CHAR16 *ImageName; + UINTN Image; + UINTN *NumberOfImages; + CHAR16 *ActionType; + + EfiGetSystemConfigurationTable (&gEfiImageSecurityDatabaseGuid, (VOID **)&ExecInfoTablePtr); + + NumberOfImages = &ExecInfoTablePtr->NumberOfImages; + + ptr = (CHAR8 *)ExecInfoTablePtr + 1; + + for (Image = 0; Image < *NumberOfImages; Image++, ptr += InfoPtr->InfoSize) { + InfoPtr = (EFI_IMAGE_EXECUTION_INFO *)ptr; + ImagePath = (CHAR16 *)(InfoPtr + 1); + + GetBaseName (ImagePath, &ImageName); + + switch (InfoPtr->Action) { + case EFI_IMAGE_EXECUTION_AUTHENTICATION: + ActionType = L"AUTHENTICATION"; + break; + case EFI_IMAGE_EXECUTION_AUTH_UNTESTED: + ActionType = L"AUTH_UNTESTED"; + break; + case EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED: + ActionType = L"AUTH_SIG_FAILED"; + break; + case EFI_IMAGE_EXECUTION_AUTH_SIG_PASSED: + ActionType = L"AUTH_SIG_PASSED"; + break; + case EFI_IMAGE_EXECUTION_AUTH_SIG_NOT_FOUND: + ActionType = L"AUTH_SIG_NOT_FOUND"; + break; + case EFI_IMAGE_EXECUTION_AUTH_SIG_FOUND: + ActionType = L"AUTH_SIG_FOUND"; + break; + case EFI_IMAGE_EXECUTION_POLICY_FAILED: + ActionType = L"POLICY_FAILED"; + break; + case EFI_IMAGE_EXECUTION_INITIALIZED: + ActionType = L"INITIALIZED"; + break; + default: + ActionType = L"invalid action"; + } + + Status = ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_DMEM_IMG_EXE_ENTRY), + gShellDebug1HiiHandle, + ImageName, + ActionType + ); + } + + return Status; +} + +/** + Display the ImageExecutionTable entries + + @param[in] Address The pointer to the ImageExecutionTable. +**/ +SHELL_STATUS +DisplayImageExecutionEntries ( + IN UINT64 Address + ) +{ + SHELL_STATUS ShellStatus; + EFI_STATUS Status; + + ShellStatus = SHELL_SUCCESS; + + if (Address != 0) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_IMG_EXE_TABLE), gShellDebug1HiiHandle); + Status = GetImageExecutionInfo (); + if (EFI_ERROR (Status)) { + ShellStatus = SHELL_ABORTED; + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL), gShellDebug1HiiHandle, L"ImageExecutionTable"); + } + } else { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_NOT_FOUND), gShellDebug1HiiHandle, L"ImageExecutionTable"); + } + + return (ShellStatus); +} + + + STATIC CONST SHELL_PARAM_ITEM ParamList[] = { { L"-mmio", TypeFlag }, { L"-verbose", TypeFlag }, @@ -369,6 +501,10 @@ ShellCommandRunDmem ( if (ShellStatus == SHELL_SUCCESS) { ShellStatus = DisplayRtProperties (RtPropertiesTableAddress); } + + if (ShellStatus == SHELL_SUCCESS) { + ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress); + } } } else { ShellStatus = DisplayMmioMemory (Address, (UINTN)Size); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index a2241614f1..3b730164dd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -144,6 +144,9 @@ " UPDATE_CAPSULE %d\r\n" " QUERY_CAPSULE_CAPABILITIES %d\r\n" " QUERY_VARIABLE_INFO %d\r\n" +#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_ERR_NOT_FOUND #language en-US "\r\n%H%s%N: Table address not found.\r\n" #string STR_DMEM_ERR_GET_FAIL #language en-US "\r\n%H%s%N: Unable to get table information.\r\n" -- cgit From 3ad878fde5ba29041c4718d06fb8af1d87eb8af3 Mon Sep 17 00:00:00 2001 From: Sam Kaynor Date: Fri, 26 Apr 2024 11:16:04 -0500 Subject: MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Adding support for EFI_CONFORMANCE_PROFILE_TABLE by adding an associated header file and relevant GUIDs to MdePkg.dec as defined in the UEFI 2.10 spec. This table is needed to address changes being made within ShellPkg. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Sam Kaynor --- MdePkg/Include/Guid/ConformanceProfiles.h | 57 +++++++++++++++++++++++++++++++ MdePkg/MdePkg.dec | 4 +++ 2 files changed, 61 insertions(+) create mode 100644 MdePkg/Include/Guid/ConformanceProfiles.h diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h b/MdePkg/Include/Guid/ConformanceProfiles.h new file mode 100644 index 0000000000..5505011231 --- /dev/null +++ b/MdePkg/Include/Guid/ConformanceProfiles.h @@ -0,0 +1,57 @@ +/** @file + GUIDs used for UEFI Conformance Profiles Table in the UEFI 2.10 specification. + + Copyright (c) 2024, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CONFORMANCE_PROFILES_TABLE_GUID_H_ +#define CONFORMANCE_PROFILES_TABLE_GUID_H_ + +// +// This table allows the platform to advertise its UEFI specification conformance +// 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 implementation is +// conformant with the UEFI specification requirements, as defined in Section 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, 0x0c, 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 system. + /// EFI_GUID ConformanceProfiles[]; + /// +} EFI_CONFORMANCE_PROFILES_TABLE; + +#pragma pack() + +#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 }} + +extern EFI_GUID gEfiConfProfilesTableGuid; +extern EFI_GUID gEfiConfProfilesUefiSpecGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 94170ff9a4..3a9a0fec24 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -751,6 +751,10 @@ ## Include/Guid/DeviceAuthentication.h gEfiDeviceSignatureDatabaseGuid = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a, 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }} + ## Include/Guid/ConformanceProfiles.h + gEfiConfProfilesTableGuid = { 0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }} + gEfiConfProfilesUefiSpecGuid = { 0x523c91af, 0xa195, 0x4382, { 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }} + # # GUID defined in PI1.0 # -- cgit From 960b6e8309bd304e2baae0a6e5ca5c0a0f7b0e2e Mon Sep 17 00:00:00 2001 From: Sam Kaynor Date: Tue, 30 Apr 2024 12:54:10 -0500 Subject: MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Adding additional GUIDs for the EFI_CONFORMANCE_PROFILE_TABLE that are defined in the Embedded Base Boot Requirments (EBBR) Specification. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Sam Kaynor --- MdePkg/Include/Guid/ConformanceProfiles.h | 12 +++++++++++- MdePkg/MdePkg.dec | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h b/MdePkg/Include/Guid/ConformanceProfiles.h index 5505011231..bf89ab61dd 100644 --- a/MdePkg/Include/Guid/ConformanceProfiles.h +++ b/MdePkg/Include/Guid/ConformanceProfiles.h @@ -45,12 +45,22 @@ typedef struct { #define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 0x1 // -// GUID defined in spec. +// GUID defined in UEFI 2.10 // #define EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID \ { 0x523c91af, 0xa195, 0x4382, \ { 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }} +// +// GUID defined in EBBR +// +#define EFI_CONFORMANCE_PROFILE_EBBR_2_1_GUID \ + { 0xcce33c35, 0x74ac, 0x4087, \ + { 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }} +#define EFI_CONFORMANCE_PROFILE_EBBR_2_2_GUID \ + { 0x9073eed4, 0xe50d, 0x11ee, \ + { 0xb8, 0xb0, 0x8b, 0x68, 0xda, 0x62, 0xfc, 0x80 }} + extern EFI_GUID gEfiConfProfilesTableGuid; extern EFI_GUID gEfiConfProfilesUefiSpecGuid; diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 3a9a0fec24..5dbe5a9f72 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -755,6 +755,12 @@ gEfiConfProfilesTableGuid = { 0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }} gEfiConfProfilesUefiSpecGuid = { 0x523c91af, 0xa195, 0x4382, { 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }} + # GUIDs defined in EBBR + # + ## Include/Guid/ConformanceProfiles.h + gEfiConfProfilesEbbrSpec21Guid = { 0xcce33c35, 0x74ac, 0x4087, { 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }} + gEfiConfProfilesEbbrSpec22Guid = { 0x9073eed4, 0xe50d, 0x11ee, { 0xb8, 0xb0, 0x8b, 0x68, 0xda, 0x62, 0xfc, 0x80 }} + # # GUID defined in PI1.0 # -- cgit From 497766f70975b9c1f88df42228c79095198f2b4e Mon Sep 17 00:00:00 2001 From: Sam Kaynor Date: Wed, 10 Jan 2024 13:03:19 -0600 Subject: ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the UEFI Conformance Profiles Table using Dmem.c Uses header file for GUIDs added in previous patches Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Sam Kaynor Tested-by: Stuart Yoder Reviewed-by: Stuart Yoder --- ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 80 ++++++++++++++++++++++ .../UefiShellDebug1CommandsLib.inf | 4 ++ .../UefiShellDebug1CommandsLib.uni | 5 ++ 3 files changed, 89 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c index 80c779a0b3..046cfd5270 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -19,6 +19,7 @@ #include #include #include +#include /** Make a printable character. @@ -269,7 +270,77 @@ DisplayImageExecutionEntries ( return (ShellStatus); } +/** + Display the ConformanceProfileTable entries + + @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; + UINTN Profile; + EFI_CONFORMANCE_PROFILES_TABLE *ConfProfTable; + ShellStatus = SHELL_SUCCESS; + + if (Address != 0) { + EfiGetSystemConfigurationTable (&gEfiConfProfilesTableGuid, (VOID **)&ConfProfTable); + + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_CONF_PRO_TABLE), gShellDebug1HiiHandle); + + EntryGuid = (EFI_GUID *)(ConfProfTable + 1); + + for (Profile = 0; Profile < ConfProfTable->NumberOfProfiles; Profile++, EntryGuid++) { + GuidName = L"Unknown_Profile"; + + if (CompareGuid (EntryGuid, &gEfiConfProfilesUefiSpecGuid)) { + GuidName = L"EFI_CONFORMANCE_PROFILE_UEFI_SPEC_GUID"; + } + + if (CompareGuid (EntryGuid, &gEfiConfProfilesEbbrSpec21Guid)) { + GuidName = L"EBBR_2.1"; + } + + if (CompareGuid (EntryGuid, &gEfiConfProfilesEbbrSpec22Guid)) { + GuidName = L"EBBR_2.2"; + } + + Status = ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_DMEM_CONF_PRO_ROW), + gShellDebug1HiiHandle, + GuidName, + EntryGuid + ); + } + + if (EFI_ERROR (Status)) { + ShellStatus = 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); +} STATIC CONST SHELL_PARAM_ITEM ParamList[] = { { L"-mmio", TypeFlag }, @@ -461,6 +532,11 @@ ShellCommandRunDmem ( HiiDatabaseExportBufferAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable; continue; } + + if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiConfProfilesTableGuid)) { + ConformanceProfileTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable; + continue; + } } ShellPrintHiiEx ( @@ -505,6 +581,10 @@ ShellCommandRunDmem ( if (ShellStatus == SHELL_SUCCESS) { ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress); } + + if (ShellStatus == SHELL_SUCCESS) { + ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress); + } } } else { ShellStatus = DisplayMmioMemory (Address, (UINTN)Size); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf index 3741dac5d9..140e9dc644 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf @@ -139,3 +139,7 @@ gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable gEfiJsonCapsuleDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable gEfiJsonCapsuleResultTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiConfProfilesTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiConfProfilesUefiSpecGuid ## SOMETIMES_CONSUMES ## GUID + gEfiConfProfilesEbbrSpec21Guid ## SOMETIMES_CONSUMES ## GUID + gEfiConfProfilesEbbrSpec22Guid ## SOMETIMES_CONSUMES ## GUID diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 3b730164dd..6ef923e4fd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.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 Profile 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 address not found.\r\n" #string STR_DMEM_ERR_GET_FAIL #language en-US "\r\n%H%s%N: Unable to get table information.\r\n" -- cgit From 3abe627f29add4d05a404e9170b81cf72d9c404b Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Wed, 10 Jul 2024 16:14:47 +0800 Subject: RedfishPkg/RedfishPlatformConfigDxe: remove false alarm Change the debug message level to DEBUG_INFO for protocol notification functions. The protocol notification function is invoked at least one time. So, the failure of locating protocol is expected because protocol may not be installed when Redfish platform config driver is launched. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Rebecca Cran --- RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c index 46d01fca60..26bec8435f 100644 --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c @@ -2483,7 +2483,7 @@ HiiStringProtocolInstalled ( (VOID **)&mRedfishPlatformConfigPrivate->HiiString ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status)); + DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status)); return; } @@ -2518,7 +2518,7 @@ HiiDatabaseProtocolInstalled ( (VOID **)&mRedfishPlatformConfigPrivate->HiiDatabase ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status)); + DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status)); return; } @@ -2581,7 +2581,7 @@ RegexProtocolInstalled ( (VOID **)&mRedfishPlatformConfigPrivate->RegularExpressionProtocol ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status)); + DEBUG ((DEBUG_INFO, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status)); return; } -- cgit From 6c061c4715325494b8b25453158166f9032e0335 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 9 Jul 2024 19:10:26 -0400 Subject: BaseTools/Ecc: Allow `static` as a modifier Currently, `STATIC` is allowed as a function modifier but `static` results in the below ECC errors: ``` *Error code: 5001 *Return type of a function should exist and in the first line *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 *[UefiDebugLibDebugPortProtocolExitBootServicesCallback] Return Type should appear at the start of line EFI coding style error *Error code: 5002 *Any optional functional modifiers should exist and next to the return type *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 ``` This is because `GetDataTypeFromModifier()` will return both `static` and the return type (e.g. `VOID`) whereas for a modifier in the list (e.g. `STATIC`) it will return only the return type allowing logic in Ecc/c.py to process the modifier and return type with current logic. Signed-off-by: Michael Kubacki --- BaseTools/Source/Python/Ecc/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/config.ini b/BaseTools/Source/Python/Ecc/config.ini index 5529d0f2db..6edf897ffd 100644 --- a/BaseTools/Source/Python/Ecc/config.ini +++ b/BaseTools/Source/Python/Ecc/config.ini @@ -35,7 +35,7 @@ AutoCorrect = 1 # # List customized Modifer here, split with ',' # -ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI, STATIC +ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI, STATIC, static # # General Checking -- cgit