public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chris Jones" <christopher.jones@arm.com>
To: <devel@edk2.groups.io>
Cc: <michael.d.kinney@intel.com>, <gaoliming@byosoft.com.cn>,
	<zhiguang.liu@intel.com>, <ray.ni@intel.com>,
	<zhichao.gao@intel.com>, <Alexei.Fedorov@arm.com>,
	<Sami.Mujawar@arm.com>, <nd@arm.com>
Subject: [PATCH v3 3/7] ShellPkg: Update Acpiview PPTT parser to ACPI 6.4
Date: Wed, 8 Dec 2021 16:06:26 +0000	[thread overview]
Message-ID: <20211208160630.10923-4-christopher.jones@arm.com> (raw)
In-Reply-To: <20211208160630.10923-1-christopher.jones@arm.com>

Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697)

Update the Acpiview PPTT parser to use Acpi64.h. As part of the changes,
remove support for parsing PPTT type 2 ID structure.

Mantis ID for removing PPTT type 2 structure:
2072 (https://mantis.uefi.org/mantis/view.php?id=2072)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c     | 61 ++++----------------
 ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c |  2 +-
 2 files changed, 12 insertions(+), 51 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
index f47b92f8c55ba5a479571a0bea378c75dfde13ed..7be249819e70dee9547c3fecc0763f473aa9ce92 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
@@ -1,11 +1,11 @@
 /** @file
   PPTT table parser
 
-  Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
+  Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
-    - ACPI 6.3 Specification - January 2019
+    - ACPI 6.4 Specification - January 2021
     - ARM Architecture Reference Manual ARMv8 (D.a)
 **/
 
@@ -161,8 +161,8 @@ ValidateCacheAttributes (
   )
 {
   // Reference: Advanced Configuration and Power Interface (ACPI) Specification
-  //            Version 6.2 Errata A, September 2017
-  // Table 5-153: Cache Type Structure
+  //            Version 6.4, January 2021
+  // Table 5-140: Cache Type Structure
   UINT8  Attributes;
 
   Attributes = *(UINT8 *)Ptr;
@@ -227,22 +227,6 @@ STATIC CONST ACPI_PARSER  CacheTypeStructureParser[] = {
   { L"Line size",           2, 22, L"%d",   NULL, NULL, ValidateCacheLineSize,      NULL }
 };
 
-/**
-  An ACPI_PARSER array describing the ID Type Structure - Type 2.
-**/
-STATIC CONST ACPI_PARSER  IdStructureParser[] = {
-  { L"Type",       1, 0,  L"0x%x", NULL,       NULL, NULL, NULL },
-  { L"Length",     1, 1,  L"%d",   NULL,       NULL, NULL, NULL },
-  { L"Reserved",   2, 2,  L"0x%x", NULL,       NULL, NULL, NULL },
-
-  { L"VENDOR_ID",  4, 4,  NULL,    Dump4Chars, NULL, NULL, NULL },
-  { L"LEVEL_1_ID", 8, 8,  L"0x%x", NULL,       NULL, NULL, NULL },
-  { L"LEVEL_2_ID", 8, 16, L"0x%x", NULL,       NULL, NULL, NULL },
-  { L"MAJOR_REV",  2, 24, L"0x%x", NULL,       NULL, NULL, NULL },
-  { L"MINOR_REV",  2, 26, L"0x%x", NULL,       NULL, NULL, NULL },
-  { L"SPIN_REV",   2, 28, L"0x%x", NULL,       NULL, NULL, NULL },
-};
-
 /**
   This function parses the Processor Hierarchy Node Structure (Type 0).
 
@@ -340,29 +324,6 @@ DumpCacheTypeStructure (
     );
 }
 
-/**
-  This function parses the ID Structure (Type 2).
-
-  @param [in] Ptr     Pointer to the start of the ID Structure data.
-  @param [in] Length  Length of the ID Structure.
-**/
-STATIC
-VOID
-DumpIDStructure (
-  IN UINT8  *Ptr,
-  IN UINT8  Length
-  )
-{
-  ParseAcpi (
-    TRUE,
-    2,
-    "ID Structure",
-    Ptr,
-    Length,
-    PARSER_PARAMS (IdStructureParser)
-    );
-}
-
 /**
   This function parses the ACPI PPTT table.
   When trace is enabled this function parses the PPTT table and
@@ -371,7 +332,6 @@ DumpIDStructure (
   This function parses the following processor topology structures:
     - Processor hierarchy node structure (Type 0)
     - Cache Type Structure (Type 1)
-    - ID structure (Type 2)
 
   This function also performs validation of the ACPI table fields.
 
@@ -451,22 +411,23 @@ ParseAcpiPptt (
     Print (L"0x%x\n", Offset);
 
     switch (*ProcessorTopologyStructureType) {
-      case EFI_ACPI_6_2_PPTT_TYPE_PROCESSOR:
+      case EFI_ACPI_6_4_PPTT_TYPE_PROCESSOR:
         DumpProcessorHierarchyNodeStructure (
           ProcessorTopologyStructurePtr,
           *ProcessorTopologyStructureLength
           );
         break;
-      case EFI_ACPI_6_2_PPTT_TYPE_CACHE:
+      case EFI_ACPI_6_4_PPTT_TYPE_CACHE:
         DumpCacheTypeStructure (
           ProcessorTopologyStructurePtr,
           *ProcessorTopologyStructureLength
           );
         break;
-      case EFI_ACPI_6_2_PPTT_TYPE_ID:
-        DumpIDStructure (
-          ProcessorTopologyStructurePtr,
-          *ProcessorTopologyStructureLength
+      case EFI_ACPI_6_3_PPTT_TYPE_ID:
+        IncrementErrorCount ();
+        Print (
+          L"ERROR: PPTT Type 2 - Processor ID has been removed and must not be"
+          L"used.\n"
           );
         break;
       default:
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
index 0ad7bf4c845f3c065764680c01eaa27796b09226..09bdddb56e5bd70dec44bdbdcba88373f93daa66 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
@@ -62,7 +62,7 @@ ACPI_TABLE_PARSER  ParserList[] = {
     ParseAcpiMcfg },
   { EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE,
     ParseAcpiPcct },
-  { EFI_ACPI_6_2_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
+  { EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
     ParseAcpiPptt },
   { RSDP_TABLE_INFO,                                                                                     ParseAcpiRsdp },
   { EFI_ACPI_6_2_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE,                                            ParseAcpiSlit },
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")


  parent reply	other threads:[~2021-12-08 16:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 16:06 [PATCH v3 0/7] Support ACPI 6.4 PPTT changes Chris Jones
2021-12-08 16:06 ` [PATCH v3 1/7] MdePkg: Add missing Cache ID (in)valid define Chris Jones
2021-12-08 16:06 ` [PATCH v3 2/7] MdePkg: Remove PPTT ID type structure Chris Jones
2021-12-08 16:06 ` Chris Jones [this message]
2021-12-08 16:06 ` [PATCH v3 4/7] ShellPkg: Add Cache ID to PPTT parser Chris Jones
2021-12-08 16:06 ` [PATCH v3 5/7] DynamicTablesPkg: Remove PPTT ID structure from ACPI 6.4 generator Chris Jones
2021-12-08 16:06 ` [PATCH v3 6/7] DynamicTablesPkg: Update PPTT generator to ACPI 6.4 Chris Jones
2021-12-08 16:06 ` [PATCH v3 7/7] DynamicTablesPkg: Add CacheId to PPTT generator Chris Jones
2021-12-09 13:19   ` Sami Mujawar
2021-12-09 13:42     ` Chris Jones
2021-12-09 17:00 ` [PATCH v3 0/7] Support ACPI 6.4 PPTT changes Sami Mujawar
     [not found] ` <16BF24D08620153C.20064@groups.io>
2021-12-10 20:10   ` [edk2-devel] " Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211208160630.10923-4-christopher.jones@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox