]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: Remove PPTT ID structure from ACPI 6.4 generator
authorChris Jones <christopher.jones@arm.com>
Wed, 8 Dec 2021 16:06:28 +0000 (16:06 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 10 Dec 2021 20:06:52 +0000 (20:06 +0000)
Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697)

ACPI 6.3A deprecated PPTT ID (type 2) structure which was subsequently
removed in ACPI 6.4. Therefore remove support for generating PPTT ID
structures.

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: Sami Mujawar <sami.mujawar@arm.com>
DynamicTablesPkg/Include/ArmNameSpaceObjects.h
DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h

index 22b37edfabd1f6a1d1a3015f4a0249c28489367c..3246e8884723ac85340bf880a3859800726be3c1 100644 (file)
@@ -50,7 +50,7 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,           ///< 26 - SMMU Interrupt Array\r
   EArmObjProcHierarchyInfo,            ///< 27 - Processor Hierarchy Info\r
   EArmObjCacheInfo,                    ///< 28 - Cache Info\r
-  EArmObjProcNodeIdInfo,               ///< 29 - Processor Node ID Info\r
+  EArmObjReserved29,                   ///< 29 - Reserved\r
   EArmObjCmRef,                        ///< 30 - CM Object Reference\r
   EArmObjMemoryAffinityInfo,           ///< 31 - Memory Affinity Info\r
   EArmObjDeviceHandleAcpi,             ///< 32 - Device Handle Acpi\r
@@ -747,27 +747,6 @@ typedef struct CmArmCacheInfo {
   UINT16             LineSize;\r
 } CM_ARM_CACHE_INFO;\r
 \r
-/** A structure that describes the ID Structure (Type 2) in PPTT\r
-\r
-    ID: EArmObjProcNodeIdInfo\r
-*/\r
-typedef struct CmArmProcNodeIdInfo {\r
-  /// A unique token used to identify this object\r
-  CM_OBJECT_TOKEN    Token;\r
-  // Vendor ID (as described in ACPI ID registry)\r
-  UINT32             VendorId;\r
-  /// First level unique node ID\r
-  UINT64             Level1Id;\r
-  /// Second level unique node ID\r
-  UINT64             Level2Id;\r
-  /// Major revision of the node\r
-  UINT16             MajorRev;\r
-  /// Minor revision of the node\r
-  UINT16             MinorRev;\r
-  /// Spin revision of the node\r
-  UINT16             SpinRev;\r
-} CM_ARM_PROC_NODE_ID_INFO;\r
-\r
 /** A structure that describes a reference to another Configuration Manager\r
     object.\r
 \r
index f78bbed7c1beee4211752bba94ce531a84e84f10..58ad338d339f7f2cf506df961f016edb160f0edc 100644 (file)
@@ -34,7 +34,6 @@
     The following Configuration Manager Object(s) are used by this Generator:\r
     - EArmObjProcHierarchyInfo (REQUIRED)\r
     - EArmObjCacheInfo\r
-    - EArmObjProcNodeIdInfo\r
     - EArmObjCmRef\r
     - EArmObjGicCInfo (REQUIRED)\r
 */\r
@@ -59,16 +58,6 @@ GET_OBJECT_LIST (
   CM_ARM_CACHE_INFO\r
   );\r
 \r
-/**\r
-  This macro expands to a function that retrieves the ID information for\r
-  Processor Hierarchy Nodes from the Configuration Manager.\r
-*/\r
-GET_OBJECT_LIST (\r
-  EObjNameSpaceArm,\r
-  EArmObjProcNodeIdInfo,\r
-  CM_ARM_PROC_NODE_ID_INFO\r
-  );\r
-\r
 /**\r
   This macro expands to a function that retrieves the cross-CM-object-\r
   reference information from the Configuration Manager.\r
@@ -131,15 +120,6 @@ GET_SIZE_OF_PPTT_STRUCTS (
   CM_ARM_CACHE_INFO\r
   );\r
 \r
-/** This macro expands to a function that retrieves the amount of memory\r
-    required to store the ID Structures (Type 2) and updates the Node Indexer.\r
-*/\r
-GET_SIZE_OF_PPTT_STRUCTS (\r
-  IdStructs,\r
-  sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_ID),\r
-  CM_ARM_PROC_NODE_ID_INFO\r
-  );\r
-\r
 /**\r
   Search the Node Indexer and return the indexed PPTT node with the given\r
   Token.\r
@@ -373,8 +353,8 @@ AddPrivateResources (
     }\r
 \r
     // The Node indexer has the Processor hierarchy nodes at the begining\r
-    // followed by the cache structs and Id structs. Therefore we can\r
-    // skip the Processor hierarchy nodes in the node indexer search.\r
+    // followed by the cache structs. Therefore we can skip the Processor\r
+    // hierarchy nodes in the node indexer search.\r
     Status = GetPpttNodeReferencedByToken (\r
                Generator->CacheStructIndexedList,\r
                (Generator->ProcTopologyStructCount -\r
@@ -969,71 +949,6 @@ AddCacheTypeStructures (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Update the ID Type Structure (Type 2) information.\r
-\r
-  This function populates the ID Type Structures with information from\r
-  the Configuration Manager and and adds this information to the PPTT table.\r
-\r
-  @param [in]  Generator          Pointer to the PPTT Generator.\r
-  @param [in]  CfgMgrProtocol     Pointer to the Configuration Manager\r
-                                  Protocol Interface.\r
-  @param [in]  Pptt               Pointer to PPTT table structure.\r
-  @param [in]  NodesStartOffset   Offset from the start of PPTT table to the\r
-                                  start of ID Type Structures.\r
-\r
-  @retval EFI_SUCCESS             Structures updated successfully.\r
-  @retval EFI_INVALID_PARAMETER   A parameter is invalid.\r
-  @retval EFI_NOT_FOUND           A required object was not found.\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-AddIdTypeStructures (\r
-  IN  CONST ACPI_PPTT_GENERATOR                   *CONST             Generator,\r
-  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST             CfgMgrProtocol,\r
-  IN  CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER  *Pptt,\r
-  IN  CONST UINT32                                                   NodesStartOffset\r
-  )\r
-{\r
-  EFI_ACPI_6_3_PPTT_STRUCTURE_ID  *IdStruct;\r
-  CM_ARM_PROC_NODE_ID_INFO        *ProcIdInfoNode;\r
-  PPTT_NODE_INDEXER               *IdStructIterator;\r
-  UINT32                          NodeCount;\r
-\r
-  ASSERT (\r
-    (Generator != NULL) &&\r
-    (CfgMgrProtocol != NULL) &&\r
-    (Pptt != NULL)\r
-    );\r
-\r
-  IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID *)((UINT8 *)Pptt + NodesStartOffset);\r
-\r
-  IdStructIterator = Generator->IdStructIndexedList;\r
-  NodeCount        = Generator->IdStructCount;\r
-  while (NodeCount-- != 0) {\r
-    ProcIdInfoNode = (CM_ARM_PROC_NODE_ID_INFO *)IdStructIterator->Object;\r
-\r
-    // Populate the node\r
-    IdStruct->Type        = EFI_ACPI_6_3_PPTT_TYPE_ID;\r
-    IdStruct->Length      = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_ID);\r
-    IdStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;\r
-    IdStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;\r
-    IdStruct->VendorId    = ProcIdInfoNode->VendorId;\r
-    IdStruct->Level1Id    = ProcIdInfoNode->Level1Id;\r
-    IdStruct->Level2Id    = ProcIdInfoNode->Level2Id;\r
-    IdStruct->MajorRev    = ProcIdInfoNode->MajorRev;\r
-    IdStruct->MinorRev    = ProcIdInfoNode->MinorRev;\r
-    IdStruct->SpinRev     = ProcIdInfoNode->SpinRev;\r
-\r
-    // Next ID Type Structure\r
-    IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID *)((UINT8 *)IdStruct +\r
-                                                  IdStruct->Length);\r
-    IdStructIterator++;\r
-  } // ID Type Structure\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   Construct the PPTT ACPI table.\r
 \r
@@ -1072,15 +987,12 @@ BuildPpttTable (
   UINT32      ProcTopologyStructCount;\r
   UINT32      ProcHierarchyNodeCount;\r
   UINT32      CacheStructCount;\r
-  UINT32      IdStructCount;\r
 \r
   UINT32  ProcHierarchyNodeOffset;\r
   UINT32  CacheStructOffset;\r
-  UINT32  IdStructOffset;\r
 \r
   CM_ARM_PROC_HIERARCHY_INFO  *ProcHierarchyNodeList;\r
   CM_ARM_CACHE_INFO           *CacheStructList;\r
-  CM_ARM_PROC_NODE_ID_INFO    *IdStructList;\r
 \r
   ACPI_PPTT_GENERATOR  *Generator;\r
 \r
@@ -1155,27 +1067,6 @@ BuildPpttTable (
   ProcTopologyStructCount    += CacheStructCount;\r
   Generator->CacheStructCount = CacheStructCount;\r
 \r
-  // Get the processor hierarchy node ID info and update the processor topology\r
-  // structure count with ID Structures (Type 2)\r
-  Status = GetEArmObjProcNodeIdInfo (\r
-             CfgMgrProtocol,\r
-             CM_NULL_TOKEN,\r
-             &IdStructList,\r
-             &IdStructCount\r
-             );\r
-  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {\r
-    DEBUG ((\r
-      DEBUG_ERROR,\r
-      "ERROR: PPTT: Failed to get processor hierarchy node ID info. " \\r
-      "Status = %r\n",\r
-      Status\r
-      ));\r
-    goto error_handler;\r
-  }\r
-\r
-  ProcTopologyStructCount += IdStructCount;\r
-  Generator->IdStructCount = IdStructCount;\r
-\r
   // Allocate Node Indexer array\r
   NodeIndexer = (PPTT_NODE_INDEXER *)AllocateZeroPool (\r
                                        sizeof (PPTT_NODE_INDEXER) *\r
@@ -1241,27 +1132,6 @@ BuildPpttTable (
       ));\r
   }\r
 \r
-  // Include the size of ID Type Structures and index them\r
-  if (Generator->IdStructCount != 0) {\r
-    IdStructOffset                 = TableSize;\r
-    Generator->IdStructIndexedList = NodeIndexer;\r
-    TableSize                     += GetSizeofIdStructs (\r
-                                       IdStructOffset,\r
-                                       IdStructList,\r
-                                       Generator->IdStructCount,\r
-                                       &NodeIndexer\r
-                                       );\r
-    DEBUG ((\r
-      DEBUG_INFO,\r
-      " IdStructCount = %d\n" \\r
-      " IdStructOffset = 0x%x\n" \\r
-      " IdStructIndexedList = 0x%p\n",\r
-      Generator->IdStructCount,\r
-      IdStructOffset,\r
-      Generator->IdStructIndexedList\r
-      ));\r
-  }\r
-\r
   DEBUG ((\r
     DEBUG_INFO,\r
     "INFO: PPTT:\n" \\r
@@ -1347,24 +1217,6 @@ BuildPpttTable (
     }\r
   }\r
 \r
-  // Add ID Type Structures (Type 2) to the generated table\r
-  if (Generator->IdStructCount != 0) {\r
-    Status = AddIdTypeStructures (\r
-               Generator,\r
-               CfgMgrProtocol,\r
-               Pptt,\r
-               IdStructOffset\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      DEBUG ((\r
-        DEBUG_ERROR,\r
-        "ERROR: PPTT: Failed to add ID Type Structures. Status = %r\n",\r
-        Status\r
-        ));\r
-      goto error_handler;\r
-    }\r
-  }\r
-\r
   // Validate CM object cross-references in PPTT\r
   Status = DetectCyclesInTopology (Generator);\r
   if (EFI_ERROR (Status)) {\r
@@ -1488,8 +1340,6 @@ ACPI_PPTT_GENERATOR  PpttGenerator = {
   0,\r
   // Count of Cache Structures\r
   0,\r
-  // Count of Id Structures\r
-  0,\r
   // Pointer to PPTT Node Indexer\r
   NULL\r
 };\r
index f587e67e9f8bf51511c6187ba0384e1cb60661d5..15b0a9871c3d555a62b79595c317e6597f6ead05 100644 (file)
@@ -171,8 +171,6 @@ typedef struct AcpiPpttGenerator {
   UINT32                  ProcHierarchyNodeCount;\r
   /// Count of Cache Structures\r
   UINT32                  CacheStructCount;\r
-  /// Count of Id Structures\r
-  UINT32                  IdStructCount;\r
   /// List of indexed CM objects for PPTT generation\r
   PPTT_NODE_INDEXER       *NodeIndexer;\r
   /// Pointer to the start of Processor Hierarchy nodes in\r
@@ -180,8 +178,6 @@ typedef struct AcpiPpttGenerator {
   PPTT_NODE_INDEXER       *ProcHierarchyNodeIndexedList;\r
   /// Pointer to the start of Cache Structures in the Node Indexer array\r
   PPTT_NODE_INDEXER       *CacheStructIndexedList;\r
-  /// Pointer to the start of Id Structures in the Node Indexer array\r
-  PPTT_NODE_INDEXER       *IdStructIndexedList;\r
 } ACPI_PPTT_GENERATOR;\r
 \r
 #pragma pack()\r