public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c
@ 2024-05-01 14:58 Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 1/5] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c Sam Kaynor
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel
  Cc: Ray Ni, Zhichao Gao, Michael D Kinney, Liming Gao, Zhiguang Liu,
	Stuart Yoder

This adds an additional option to the dmem UEFI shell command for verbose dumping of a couple of UEFI tables.

The tables specified are the RT Properties Table, the Image Execution Table, and the Conformance Profiles table.

Supporting objects are added in the .inf and .uni files relating to Dmem.c and an additional header file for the Conformance Profiles table was added.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 

v6->v7:
- Additional patch to separate UEFI and EBBR Guids

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Stuart Yoder <stuart.yoder@arm.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>

Sam Kaynor (5):
  ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c
  ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
  MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
  MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
  ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c

 MdePkg/MdePkg.dec                                                          |  10 +
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf |   4 +
 MdePkg/Include/Guid/ConformanceProfiles.h                                  |  63 ++++
 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c                         | 321 ++++++++++++++++++--
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  31 +-
 5 files changed, 402 insertions(+), 27 deletions(-)
 create mode 100644 MdePkg/Include/Guid/ConformanceProfiles.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v7 1/5] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
@ 2024-05-01 14:58 ` Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 2/5] ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table " Sam Kaynor
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
Tested-by: Stuart Yoder <stuart.yoder@arm.com>
Reviewed-by: Stuart Yoder <stuart.yoder@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
---

Notes:
    v5:
    - corrected style error (spaces before '(')
    v4:
    - fixed crash when RTProperties table not present
    - expanded help output to include -verbose option
    v3:
    - fixed build errors
    - properly using Address variable

 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c                         | 113 +++++++++++++++-----
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  23 +++-
 2 files changed, 109 insertions(+), 27 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index a609971f345e..2975e21b0a42 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -34,7 +34,7 @@ MakePrintable (
   IN CONST CHAR16  Char
   )
 {
-  if (((Char < 0x20) && (Char > 0)) || (Char > 126)) {
+  if ( ( (Char < 0x20) && (Char > 0)) || (Char > 126)) {
     return (L'?');
   }
 
@@ -71,12 +71,12 @@ DisplayMmioMemory (
     return SHELL_OUT_OF_RESOURCES;
   }
 
-  Status = PciRbIo->Mem.Read (PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
+  Status = PciRbIo->Mem.Read (PciRbIo, EfiPciWidthUint8, (UINT64) (UINTN)Address, Size, Buffer);
   if (EFI_ERROR (Status)) {
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");
     ShellStatus = SHELL_NOT_FOUND;
   } else {
-    ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
+    ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64) (UINTN)Address, Size);
     DumpHex (2, (UINTN)Address, Size, Buffer);
   }
 
@@ -84,8 +84,64 @@ 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) {
+    RtPropertiesTable = (EFI_RT_PROPERTIES_TABLE *)Address;
+
+    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 },
+  { L"-verbose", TypeFlag },
   { NULL,     TypeMax  }
 };
 
@@ -147,7 +203,7 @@ ShellCommandRunDmem (
   //
   Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
   if (EFI_ERROR (Status)) {
-    if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+    if ( (Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);
       FreePool (ProblemParam);
       ShellStatus = SHELL_INVALID_PARAMETER;
@@ -183,7 +239,7 @@ ShellCommandRunDmem (
 
     if (ShellStatus == SHELL_SUCCESS) {
       if (!ShellCommandLineGetFlag (Package, L"-mmio")) {
-        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64) (UINTN)Address, Size);
         DumpHex (2, (UINTN)Address, (UINTN)Size, Address);
         if (Address == (VOID *)gST) {
           Acpi20TableAddress             = 0;
@@ -205,72 +261,72 @@ ShellCommandRunDmem (
           ConformanceProfileTableAddress = 0;
           for (TableWalker = 0; TableWalker < gST->NumberOfTableEntries; TableWalker++) {
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
-              Acpi20TableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              Acpi20TableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
-              AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              AcpiTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
-              SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              SmbiosTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbios3TableGuid)) {
-              SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              SmbiosTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
-              MpsTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              MpsTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMemoryAttributesTableGuid)) {
-              MemoryAttributesTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              MemoryAttributesTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiRtPropertiesTableGuid)) {
-              RtPropertiesTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              RtPropertiesTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSystemResourceTableGuid)) {
-              SystemResourceTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              SystemResourceTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiDebugImageInfoTableGuid)) {
-              DebugImageInfoTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              DebugImageInfoTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiImageSecurityDatabaseGuid)) {
-              ImageExecutionTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              ImageExecutionTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiJsonConfigDataTableGuid)) {
-              JsonConfigDataTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              JsonConfigDataTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiJsonCapsuleDataTableGuid)) {
-              JsonCapsuleDataTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              JsonCapsuleDataTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiJsonCapsuleResultTableGuid)) {
-              JsonCapsuleResultTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              JsonCapsuleResultTableAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
 
             if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiHiiDatabaseProtocolGuid)) {
-              HiiDatabaseExportBufferAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+              HiiDatabaseExportBufferAddress = (UINT64) (UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
               continue;
             }
           }
@@ -281,14 +337,14 @@ ShellCommandRunDmem (
             NULL,
             STRING_TOKEN (STR_DMEM_SYSTEM_TABLE),
             gShellDebug1HiiHandle,
-            (UINT64)(UINTN)Address,
+            (UINT64) (UINTN)Address,
             gST->Hdr.HeaderSize,
             gST->Hdr.Revision,
-            (UINT64)(UINTN)gST->ConIn,
-            (UINT64)(UINTN)gST->ConOut,
-            (UINT64)(UINTN)gST->StdErr,
-            (UINT64)(UINTN)gST->RuntimeServices,
-            (UINT64)(UINTN)gST->BootServices,
+            (UINT64) (UINTN)gST->ConIn,
+            (UINT64) (UINTN)gST->ConOut,
+            (UINT64) (UINTN)gST->StdErr,
+            (UINT64) (UINTN)gST->RuntimeServices,
+            (UINT64) (UINTN)gST->BootServices,
             SalTableAddress,
             AcpiTableAddress,
             Acpi20TableAddress,
@@ -308,6 +364,13 @@ 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 4041f0cd483e..a2241614f109 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"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v7 2/5] ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 1/5] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c Sam Kaynor
@ 2024-05-01 14:58 ` Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 3/5] MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE Sam Kaynor
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352

Implemented dumping of the Image Execution Table using Dmem.c

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
Tested-by: Stuart Yoder <stuart.yoder@arm.com>
Reviewed-by: Stuart Yoder <stuart.yoder@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
---

Notes:
    v5:
    - corrected comment for GetBaseName
    - corrected style error (spaces before '(')
    v4:
    - changed Image Execution output to match spec
    v3:
    - fixed build erros
    - added setwidth formatting to output
    - properly using Address variable

 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c                         | 135 ++++++++++++++++++++
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |   3 +
 2 files changed, 138 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index 2975e21b0a42..a4f404c1cdbd 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
+  )
+{
+  UINT32              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
+
+  @param[in] Address    The pointer to the ImageExecutionTable.
+**/
+EFI_STATUS
+GetImageExecutionInfo (
+  IN UINT64 Address
+  )
+{
+  EFI_STATUS Status;
+  EFI_IMAGE_EXECUTION_INFO_TABLE *ExecInfoTablePtr;
+  EFI_IMAGE_EXECUTION_INFO       *InfoPtr;
+  VOID                           *ptr;
+  CHAR16                         *ImagePath;
+  CHAR16                         *ImageName;
+  UINTN                          *NumberOfImages;
+  CHAR16                         *ActionType;
+
+  ExecInfoTablePtr = (EFI_IMAGE_EXECUTION_INFO_TABLE *)Address;
+
+  NumberOfImages = &ExecInfoTablePtr->NumberOfImages;
+
+  ptr = (VOID *) (ExecInfoTablePtr + 1);
+
+  for (int Image = 0; Image < *NumberOfImages; Image++, ptr += InfoPtr->InfoSize) {
+    InfoPtr = 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 (Address);
+    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,9 @@ ShellCommandRunDmem (
           if (ShellStatus == SHELL_SUCCESS) {
             ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
           }
+          if (ShellStatus == SHELL_SUCCESS) {
+            ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
+          }
         }
 
       } else {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index a2241614f109..3b730164ddce 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"
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v7 3/5] MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 1/5] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 2/5] ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table " Sam Kaynor
@ 2024-05-01 14:58 ` Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 4/5] MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs Sam Kaynor
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu

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 <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
---

Notes:
    v7:
    - Separated out Guids from UEFI and EBBR
    v6:
    - Added patch to address MdePkg changes separately

 MdePkg/MdePkg.dec                         |  4 ++
 MdePkg/Include/Guid/ConformanceProfiles.h | 53 ++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index bf94549cbfbd..ffbd60bdaa85 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -746,6 +746,10 @@ [Guids]
   ## 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
   #
diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h b/MdePkg/Include/Guid/ConformanceProfiles.h
new file mode 100644
index 000000000000..37d4bd006f0d
--- /dev/null
+++ b/MdePkg/Include/Guid/ConformanceProfiles.h
@@ -0,0 +1,53 @@
+/** @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 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;
+
+#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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v7 4/5] MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
                   ` (2 preceding siblings ...)
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 3/5] MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE Sam Kaynor
@ 2024-05-01 14:58 ` Sam Kaynor
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 5/5] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c Sam Kaynor
  2024-05-06  2:48 ` [edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c gaoliming via groups.io
  5 siblings, 0 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu

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 <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
---

Notes:
    v7:
    - Added patch to spearate EBBR from UEFI Guids

 MdePkg/MdePkg.dec                         |  6 ++++++
 MdePkg/Include/Guid/ConformanceProfiles.h | 12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index ffbd60bdaa85..65fe3f482b93 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -750,6 +750,12 @@ [Guids]
   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
   #
diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h b/MdePkg/Include/Guid/ConformanceProfiles.h
index 37d4bd006f0d..3884ddc1f41b 100644
--- a/MdePkg/Include/Guid/ConformanceProfiles.h
+++ b/MdePkg/Include/Guid/ConformanceProfiles.h
@@ -41,12 +41,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;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v7 5/5] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
                   ` (3 preceding siblings ...)
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 4/5] MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs Sam Kaynor
@ 2024-05-01 14:58 ` Sam Kaynor
  2024-05-06  2:48 ` [edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c gaoliming via groups.io
  5 siblings, 0 replies; 9+ messages in thread
From: Sam Kaynor @ 2024-05-01 14:58 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
Tested-by: Stuart Yoder <stuart.yoder@arm.com>
Reviewed-by: Stuart Yoder <stuart.yoder@arm.com>
---

Notes:
    v7:
    - Added output for EBBR 2.2 Guid
    v6:
    - Moved MdePkg changes to separate patch
    v5:
    - corrected style error (spaces before '(')
    v3:
    - fixed build errors
    - properly using Address variable
    - removed unecessary comment in header file

 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf |  4 ++
 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c                         | 73 ++++++++++++++++++++
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  5 ++
 3 files changed, 82 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
index 3741dac5d94c..140e9dc64418 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
@@ -139,3 +139,7 @@ [Guids]
   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/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index a4f404c1cdbd..f3c01d141118 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -19,6 +19,7 @@
 #include <Guid/SystemResourceTable.h>
 #include <Guid/DebugImageInfoTable.h>
 #include <Guid/ImageAuthentication.h>
+#include <Guid/ConformanceProfiles.h>
 
 /**
   Make a printable character.
@@ -269,7 +270,71 @@ 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;
+  EFI_CONFORMANCE_PROFILES_TABLE            *ConfProfTable;
+
+  ShellStatus = SHELL_SUCCESS;
+
+  if (Address != 0) {
+    ConfProfTable = (EFI_CONFORMANCE_PROFILES_TABLE *)Address;
+
+    ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_CONF_PRO_TABLE), gShellDebug1HiiHandle);
+
+    EntryGuid = (EFI_GUID *) (ConfProfTable + 1);
+
+    for (int Profile = 0; Profile < ConfProfTable->NumberOfProfiles; Profile++, EntryGuid++) {
+      GuidName = L"Unknown_Profile";
+
+      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 +526,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 (
@@ -504,6 +574,9 @@ ShellCommandRunDmem (
           if (ShellStatus == SHELL_SUCCESS) {
             ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
           }
+          if (ShellStatus == SHELL_SUCCESS) {
+            ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress);
+          }
         }
 
       } else {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index 3b730164ddce..6ef923e4fd5e 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"
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c
  2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
                   ` (4 preceding siblings ...)
  2024-05-01 14:58 ` [edk2-devel] [PATCH v7 5/5] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c Sam Kaynor
@ 2024-05-06  2:48 ` gaoliming via groups.io
  2024-05-09 20:51   ` [edk2-devel] " Sam Kaynor
  5 siblings, 1 reply; 9+ messages in thread
From: gaoliming via groups.io @ 2024-05-06  2:48 UTC (permalink / raw)
  To: 'Sam Kaynor', devel
  Cc: 'Ray Ni', 'Zhichao Gao',
	'Michael D Kinney', 'Zhiguang Liu',
	'Stuart Yoder'

Sam:

Thanks for your update. This version patch is good to me. Reviewed-by:
Liming Gao <gaoliming@byosoft.com.cn>

Besides, is there a Pull Request for this patch set?

Thanks
Liming
> -----邮件原件-----
> 发件人: Sam Kaynor <Sam.Kaynor@arm.com>
> 发送时间: 2024年5月1日 22:58
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni <ray.ni@intel.com>; Zhichao Gao <zhichao.gao@intel.com>;
> Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Stuart
> Yoder <stuart.yoder@arm.com>
> 主题: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to
> Dmem.c
> 
> This adds an additional option to the dmem UEFI shell command for verbose
> dumping of a couple of UEFI tables.
> 
> The tables specified are the RT Properties Table, the Image Execution
Table,
> and the Conformance Profiles table.
> 
> Supporting objects are added in the .inf and .uni files relating to Dmem.c
and
> an additional header file for the Conformance Profiles table was added.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> 
> v6->v7:
> - Additional patch to separate UEFI and EBBR Guids
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Stuart Yoder <stuart.yoder@arm.com>
> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
> 
> Sam Kaynor (5):
>   ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in
> Dmem.c
>   ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
>   MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
>   MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
>   ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
> 
>  MdePkg/MdePkg.dec
> |  10 +
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.inf |   4 +
>  MdePkg/Include/Guid/ConformanceProfiles.h
> |  63 ++++
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> | 321 ++++++++++++++++++--
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.uni |  31 +-
>  5 files changed, 402 insertions(+), 27 deletions(-)
>  create mode 100644 MdePkg/Include/Guid/ConformanceProfiles.h
> 
> --
> 2.34.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118582): https://edk2.groups.io/g/devel/message/118582
Mute This Topic: https://groups.io/mt/105933482/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c
  2024-05-06  2:48 ` [edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c gaoliming via groups.io
@ 2024-05-09 20:51   ` Sam Kaynor
  2024-05-10  0:47     ` 回复: " gaoliming via groups.io
  0 siblings, 1 reply; 9+ messages in thread
From: Sam Kaynor @ 2024-05-09 20:51 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io
  Cc: 'Ray Ni', 'Zhichao Gao',
	'Michael D Kinney', 'Zhiguang Liu', Stuart Yoder

Liming,

I have not made a Pull Request for this patch set, should I make one?

Thanks,
Sam

-----Original Message-----
From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Sunday, May 5, 2024 9:49 PM
To: Sam Kaynor <Sam.Kaynor@arm.com>; devel@edk2.groups.io
Cc: 'Ray Ni' <ray.ni@intel.com>; 'Zhichao Gao' <zhichao.gao@intel.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>
Subject: 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c

Sam:

Thanks for your update. This version patch is good to me. Reviewed-by:
Liming Gao <gaoliming@byosoft.com.cn>

Besides, is there a Pull Request for this patch set?

Thanks
Liming
> -----邮件原件-----
> 发件人: Sam Kaynor <Sam.Kaynor@arm.com>
> 发送时间: 2024年5月1日 22:58
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni <ray.ni@intel.com>; Zhichao Gao <zhichao.gao@intel.com>;
> Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>;
> Stuart Yoder <stuart.yoder@arm.com>
> 主题: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to
> Dmem.c
>
> This adds an additional option to the dmem UEFI shell command for
> verbose dumping of a couple of UEFI tables.
>
> The tables specified are the RT Properties Table, the Image Execution
Table,
> and the Conformance Profiles table.
>
> Supporting objects are added in the .inf and .uni files relating to
> Dmem.c
and
> an additional header file for the Conformance Profiles table was added.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
>
> v6->v7:
> - Additional patch to separate UEFI and EBBR Guids
>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Stuart Yoder <stuart.yoder@arm.com>
> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
>
> Sam Kaynor (5):
>   ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in
> Dmem.c
>   ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
>   MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
>   MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
>   ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
>
>  MdePkg/MdePkg.dec
> |  10 +
>
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.inf |   4 +
>  MdePkg/Include/Guid/ConformanceProfiles.h
> |  63 ++++
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> | 321 ++++++++++++++++++--
>
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.uni |  31 +-
>  5 files changed, 402 insertions(+), 27 deletions(-)  create mode
> 100644 MdePkg/Include/Guid/ConformanceProfiles.h
>
> --
> 2.34.1



IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118771): https://edk2.groups.io/g/devel/message/118771
Mute This Topic: https://groups.io/mt/106009401/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* 回复: [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c
  2024-05-09 20:51   ` [edk2-devel] " Sam Kaynor
@ 2024-05-10  0:47     ` gaoliming via groups.io
  0 siblings, 0 replies; 9+ messages in thread
From: gaoliming via groups.io @ 2024-05-10  0:47 UTC (permalink / raw)
  To: devel, sam.kaynor
  Cc: 'Ray Ni', 'Zhichao Gao',
	'Michael D Kinney', 'Zhiguang Liu',
	'Stuart Yoder'

Sam:
 Please help create PR.

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sam Kaynor
> 发送时间: 2024年5月10日 4:51
> 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: 'Ray Ni' <ray.ni@intel.com>; 'Zhichao Gao' <zhichao.gao@intel.com>;
> 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu'
> <zhiguang.liu@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>
> 主题: Re: [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table
> dumping to Dmem.c
> 
> Liming,
> 
> I have not made a Pull Request for this patch set, should I make one?
> 
> Thanks,
> Sam
> 
> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Sunday, May 5, 2024 9:49 PM
> To: Sam Kaynor <Sam.Kaynor@arm.com>; devel@edk2.groups.io
> Cc: 'Ray Ni' <ray.ni@intel.com>; 'Zhichao Gao' <zhichao.gao@intel.com>;
> 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu'
> <zhiguang.liu@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>
> Subject: 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping
> to Dmem.c
> 
> Sam:
> 
> Thanks for your update. This version patch is good to me. Reviewed-by:
> Liming Gao <gaoliming@byosoft.com.cn>
> 
> Besides, is there a Pull Request for this patch set?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Sam Kaynor <Sam.Kaynor@arm.com>
> > 发送时间: 2024年5月1日 22:58
> > 收件人: devel@edk2.groups.io
> > 抄送: Ray Ni <ray.ni@intel.com>; Zhichao Gao <zhichao.gao@intel.com>;
> > Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>;
> > Stuart Yoder <stuart.yoder@arm.com>
> > 主题: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to
> > Dmem.c
> >
> > This adds an additional option to the dmem UEFI shell command for
> > verbose dumping of a couple of UEFI tables.
> >
> > The tables specified are the RT Properties Table, the Image Execution
> Table,
> > and the Conformance Profiles table.
> >
> > Supporting objects are added in the .inf and .uni files relating to
> > Dmem.c
> and
> > an additional header file for the Conformance Profiles table was added.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> >
> > v6->v7:
> > - Additional patch to separate UEFI and EBBR Guids
> >
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Zhichao Gao <zhichao.gao@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Stuart Yoder <stuart.yoder@arm.com>
> > Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
> >
> > Sam Kaynor (5):
> >   ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in
> > Dmem.c
> >   ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
> >   MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
> >   MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
> >   ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
> >
> >  MdePkg/MdePkg.dec
> > |  10 +
> >
> > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> > ib.inf |   4 +
> >  MdePkg/Include/Guid/ConformanceProfiles.h
> > |  63 ++++
> >  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> > | 321 ++++++++++++++++++--
> >
> > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> > ib.uni |  31 +-
> >  5 files changed, 402 insertions(+), 27 deletions(-)  create mode
> > 100644 MdePkg/Include/Guid/ConformanceProfiles.h
> >
> > --
> > 2.34.1
> 
> 
> 
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended recipient,
> please notify the sender immediately and do not disclose the contents to any
> other person, use it for any purpose, or store or copy the information in any
> medium. Thank you.
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118778): https://edk2.groups.io/g/devel/message/118778
Mute This Topic: https://groups.io/mt/106013237/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-10  0:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-01 14:58 [edk2-devel] [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c Sam Kaynor
2024-05-01 14:58 ` [edk2-devel] [PATCH v7 1/5] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c Sam Kaynor
2024-05-01 14:58 ` [edk2-devel] [PATCH v7 2/5] ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table " Sam Kaynor
2024-05-01 14:58 ` [edk2-devel] [PATCH v7 3/5] MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE Sam Kaynor
2024-05-01 14:58 ` [edk2-devel] [PATCH v7 4/5] MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs Sam Kaynor
2024-05-01 14:58 ` [edk2-devel] [PATCH v7 5/5] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c Sam Kaynor
2024-05-06  2:48 ` [edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c gaoliming via groups.io
2024-05-09 20:51   ` [edk2-devel] " Sam Kaynor
2024-05-10  0:47     ` 回复: " gaoliming via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox