From 87a53216e7ddce449c76f80d52db6a60fa3d1079 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Wed, 6 Mar 2024 10:49:04 +0000 Subject: [PATCH] DynamicTablesPkg: Move Hypervisor Vendor Id to Arch Common Move Hypervisor Vendor Id info object from Arm Namespace to the Arch Common namespace. Correspondingly also update the following modules to reflect the changes introduced by the move: - FADT Generator - ConfigurationManagerObjectParser - Dynamic Plat Repo TokenFixer map. Cc: Pierre Gondois Cc: Yeo Reum Yun Cc: AbdulLateef Attar Cc: Jeshua Smith Cc: Jeff Brasen Cc: Girish Mahadevan Cc: Leif Lindholm Cc: Meenakshi Aggarwal Signed-off-by: Sami Mujawar Signed-off-by: Pierre Gondois Reviewed-by: Sunil V L --- .../Include/ArchCommonNameSpaceObjects.h | 11 +++ .../Include/ArmNameSpaceObjects.h | 75 ++++++++----------- .../Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 16 ++-- .../DynamicPlatRepoLib/CmObjectTokenFixer.c | 61 ++++++++------- .../ConfigurationManagerObjectParser.c | 6 +- DynamicTablesPkg/Readme.md | 66 ++++++++-------- 6 files changed, 117 insertions(+), 118 deletions(-) diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h index 4eabb4d38b..401a24b6a5 100644 --- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h @@ -25,6 +25,7 @@ typedef enum ArchCommonObjectID { EArchCommonObjSerialPortInfo, ///< 2 - Generic Serial Port Info EArchCommonObjConsolePortInfo, ///< 3 - Serial Console Port Info EArchCommonObjSerialDebugPortInfo, ///< 4 - Serial Debug Port Info + EArchCommonObjHypervisorVendorIdentity, ///< 5 - Hypervisor Vendor Id EArchCommonObjMax } EARCH_COMMON_OBJECT_ID; @@ -75,6 +76,16 @@ typedef struct EArchCommonSerialPortInfo { UINT8 AccessSize; } CM_ARCH_COMMON_SERIAL_PORT_INFO; +/** A structure that describes the + Hypervisor Vendor ID information for the Platform. + + ID: EArchCommonObjHypervisorVendorIdentity +*/ +typedef struct CmArchCommonHypervisorVendorIdentity { + /// The hypervisor Vendor ID + UINT64 HypervisorVendorId; +} CM_ARCH_COMMON_HYPERVISOR_VENDOR_ID; + #pragma pack() #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index 4878eb60e3..48e65a3cc0 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -40,39 +40,38 @@ typedef enum ArmObjectID { EArmObjGTBlockTimerFrameInfo, ///< 9 - Generic Timer Block Frame Info EArmObjPlatformGenericWatchdogInfo, ///< 10 - Platform Generic Watchdog EArmObjPciConfigSpaceInfo, ///< 11 - PCI Configuration Space Info - EArmObjHypervisorVendorIdentity, ///< 12 - Hypervisor Vendor Id - EArmObjFixedFeatureFlags, ///< 13 - Fixed feature flags for FADT - EArmObjItsGroup, ///< 14 - ITS Group - EArmObjNamedComponent, ///< 15 - Named Component - EArmObjRootComplex, ///< 16 - Root Complex - EArmObjSmmuV1SmmuV2, ///< 17 - SMMUv1 or SMMUv2 - EArmObjSmmuV3, ///< 18 - SMMUv3 - EArmObjPmcg, ///< 19 - PMCG - EArmObjGicItsIdentifierArray, ///< 20 - GIC ITS Identifier Array - EArmObjIdMappingArray, ///< 21 - ID Mapping Array - EArmObjSmmuInterruptArray, ///< 22 - SMMU Interrupt Array - EArmObjProcHierarchyInfo, ///< 23 - Processor Hierarchy Info - EArmObjCacheInfo, ///< 24 - Cache Info - EArmObjCmRef, ///< 25 - CM Object Reference - EArmObjMemoryAffinityInfo, ///< 26 - Memory Affinity Info - EArmObjDeviceHandleAcpi, ///< 27 - Device Handle Acpi - EArmObjDeviceHandlePci, ///< 28 - Device Handle Pci - EArmObjGenericInitiatorAffinityInfo, ///< 29 - Generic Initiator Affinity - EArmObjCmn600Info, ///< 30 - CMN-600 Info - EArmObjLpiInfo, ///< 31 - Lpi Info - EArmObjPciAddressMapInfo, ///< 32 - Pci Address Map Info - EArmObjPciInterruptMapInfo, ///< 33 - Pci Interrupt Map Info - EArmObjRmr, ///< 34 - Reserved Memory Range Node - EArmObjMemoryRangeDescriptor, ///< 35 - Memory Range Descriptor - EArmObjCpcInfo, ///< 36 - Continuous Performance Control Info - EArmObjPccSubspaceType0Info, ///< 37 - Pcc Subspace Type 0 Info - EArmObjPccSubspaceType1Info, ///< 38 - Pcc Subspace Type 2 Info - EArmObjPccSubspaceType2Info, ///< 39 - Pcc Subspace Type 2 Info - EArmObjPccSubspaceType3Info, ///< 40 - Pcc Subspace Type 3 Info - EArmObjPccSubspaceType4Info, ///< 41 - Pcc Subspace Type 4 Info - EArmObjPccSubspaceType5Info, ///< 42 - Pcc Subspace Type 5 Info - EArmObjEtInfo, ///< 43 - Embedded Trace Extension/Module Info - EArmObjPsdInfo, ///< 44 - P-State Dependency (PSD) Info + EArmObjFixedFeatureFlags, ///< 12 - Fixed feature flags for FADT + EArmObjItsGroup, ///< 13 - ITS Group + EArmObjNamedComponent, ///< 14 - Named Component + EArmObjRootComplex, ///< 15 - Root Complex + EArmObjSmmuV1SmmuV2, ///< 16 - SMMUv1 or SMMUv2 + EArmObjSmmuV3, ///< 17 - SMMUv3 + EArmObjPmcg, ///< 18 - PMCG + EArmObjGicItsIdentifierArray, ///< 19 - GIC ITS Identifier Array + EArmObjIdMappingArray, ///< 20 - ID Mapping Array + EArmObjSmmuInterruptArray, ///< 21 - SMMU Interrupt Array + EArmObjProcHierarchyInfo, ///< 22 - Processor Hierarchy Info + EArmObjCacheInfo, ///< 23 - Cache Info + EArmObjCmRef, ///< 24 - CM Object Reference + EArmObjMemoryAffinityInfo, ///< 25 - Memory Affinity Info + EArmObjDeviceHandleAcpi, ///< 26 - Device Handle Acpi + EArmObjDeviceHandlePci, ///< 27 - Device Handle Pci + EArmObjGenericInitiatorAffinityInfo, ///< 28 - Generic Initiator Affinity + EArmObjCmn600Info, ///< 29 - CMN-600 Info + EArmObjLpiInfo, ///< 30 - Lpi Info + EArmObjPciAddressMapInfo, ///< 31 - Pci Address Map Info + EArmObjPciInterruptMapInfo, ///< 32 - Pci Interrupt Map Info + EArmObjRmr, ///< 33 - Reserved Memory Range Node + EArmObjMemoryRangeDescriptor, ///< 34 - Memory Range Descriptor + EArmObjCpcInfo, ///< 35 - Continuous Performance Control Info + EArmObjPccSubspaceType0Info, ///< 36 - Pcc Subspace Type 0 Info + EArmObjPccSubspaceType1Info, ///< 37 - Pcc Subspace Type 2 Info + EArmObjPccSubspaceType2Info, ///< 38 - Pcc Subspace Type 2 Info + EArmObjPccSubspaceType3Info, ///< 39 - Pcc Subspace Type 3 Info + EArmObjPccSubspaceType4Info, ///< 40 - Pcc Subspace Type 4 Info + EArmObjPccSubspaceType5Info, ///< 41 - Pcc Subspace Type 5 Info + EArmObjEtInfo, ///< 42 - Embedded Trace Extension/Module Info + EArmObjPsdInfo, ///< 43 - P-State Dependency (PSD) Info EArmObjMax } EARM_OBJECT_ID; @@ -438,16 +437,6 @@ typedef struct CmArmPciConfigSpaceInfo { CM_OBJECT_TOKEN InterruptMapToken; } CM_ARM_PCI_CONFIG_SPACE_INFO; -/** A structure that describes the - Hypervisor Vendor ID information for the Platform. - - ID: EArmObjHypervisorVendorIdentity -*/ -typedef struct CmArmHypervisorVendorId { - /// The hypervisor Vendor ID - UINT64 HypervisorVendorId; -} CM_ARM_HYPERVISOR_VENDOR_ID; - /** A structure that describes the Fixed feature flags for the Platform. diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index ea8c821d11..868a974fed 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -27,7 +27,7 @@ Requirements: this Generator: - EArchCommonObjPowerManagementProfileInfo - EArmObjBootArchInfo - - EArmObjHypervisorVendorIdentity (OPTIONAL) + - EArchCommonObjHypervisorVendorIdentity (OPTIONAL) */ /** This macro defines the FADT flag options for ARM Platforms. @@ -220,9 +220,9 @@ GET_OBJECT_LIST ( Vendor ID from the Configuration Manager. */ GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjHypervisorVendorIdentity, - CM_ARM_HYPERVISOR_VENDOR_ID + EObjNameSpaceArchCommon, + EArchCommonObjHypervisorVendorIdentity, + CM_ARCH_COMMON_HYPERVISOR_VENDOR_ID ); /** This macro expands to a function that retrieves the Fixed @@ -358,13 +358,13 @@ FadtAddHypervisorVendorId ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol ) { - EFI_STATUS Status; - CM_ARM_HYPERVISOR_VENDOR_ID *HypervisorVendorInfo; + EFI_STATUS Status; + CM_ARCH_COMMON_HYPERVISOR_VENDOR_ID *HypervisorVendorInfo; ASSERT (CfgMgrProtocol != NULL); // Get the Hypervisor Vendor ID from the Platform Configuration Manager - Status = GetEArmObjHypervisorVendorIdentity ( + Status = GetEArchCommonObjHypervisorVendorIdentity ( CfgMgrProtocol, CM_NULL_TOKEN, &HypervisorVendorInfo, @@ -391,7 +391,7 @@ FadtAddHypervisorVendorId ( DEBUG (( DEBUG_INFO, - "FADT: EArmObjHypervisorVendorIdentity = 0x%lx\n", + "FADT: EArchCommonObjHypervisorVendorIdentity = 0x%lx\n", HypervisorVendorInfo->HypervisorVendorId )); diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c index 412bf41647..34ba9f2673 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c @@ -155,39 +155,38 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] = { NULL, ///< 9 - Generic Timer Block Frame Info NULL, ///< 10 - Platform Generic Watchdog NULL, ///< 11 - PCI Configuration Space Info - NULL, ///< 12 - Hypervisor Vendor Id - NULL, ///< 13 - Fixed feature flags for FADT - TokenFixerItsGroup, ///< 14 - ITS Group - TokenFixerNamedComponentNode, ///< 15 - Named Component - TokenFixerRootComplexNode, ///< 16 - Root Complex - TokenFixerNotImplemented, ///< 17 - SMMUv1 or SMMUv2 - TokenFixerSmmuV3Node, ///< 18 - SMMUv3 - TokenFixerNotImplemented, ///< 19 - PMCG - NULL, ///< 20 - GIC ITS Identifier Array - NULL, ///< 21 - ID Mapping Array - NULL, ///< 22 - SMMU Interrupt Array - TokenFixerNotImplemented, ///< 23 - Processor Hierarchy Info - TokenFixerNotImplemented, ///< 24 - Cache Info + NULL, ///< 12 - Fixed feature flags for FADT + TokenFixerItsGroup, ///< 13 - ITS Group + TokenFixerNamedComponentNode, ///< 14 - Named Component + TokenFixerRootComplexNode, ///< 15 - Root Complex + TokenFixerNotImplemented, ///< 16 - SMMUv1 or SMMUv2 + TokenFixerSmmuV3Node, ///< 17 - SMMUv3 + TokenFixerNotImplemented, ///< 18 - PMCG + NULL, ///< 19 - GIC ITS Identifier Array + NULL, ///< 20 - ID Mapping Array + NULL, ///< 21 - SMMU Interrupt Array + TokenFixerNotImplemented, ///< 22 - Processor Hierarchy Info + TokenFixerNotImplemented, ///< 23 - Cache Info + NULL, ///< 24 - Memory Affinity Info NULL, ///< 25 - Memory Affinity Info - NULL, ///< 26 - Memory Affinity Info - NULL, ///< 27 - Device Handle Acpi - NULL, ///< 28 - Device Handle Pci - NULL, ///< 29 - Generic Initiator Affinity - NULL, ///< 30 - CMN-600 Info - NULL, ///< 31 - Lpi Info - NULL, ///< 32 - Pci Address Map Info - NULL, ///< 33 - Pci Interrupt Map Info - NULL, ///< 34 - Reserved Memory Range Node - NULL, ///< 35 - Memory Range Descriptor - NULL, ///< 36 - Continuous Performance Control Info - NULL, ///< 37 - Pcc Subspace Type 0 Info + NULL, ///< 26 - Device Handle Acpi + NULL, ///< 27 - Device Handle Pci + NULL, ///< 28 - Generic Initiator Affinity + NULL, ///< 29 - CMN-600 Info + NULL, ///< 30 - Lpi Info + NULL, ///< 31 - Pci Address Map Info + NULL, ///< 32 - Pci Interrupt Map Info + NULL, ///< 33 - Reserved Memory Range Node + NULL, ///< 34 - Memory Range Descriptor + NULL, ///< 35 - Continuous Performance Control Info + NULL, ///< 36 - Pcc Subspace Type 0 Info + NULL, ///< 37 - Pcc Subspace Type 2 Info NULL, ///< 38 - Pcc Subspace Type 2 Info - NULL, ///< 39 - Pcc Subspace Type 2 Info - NULL, ///< 40 - Pcc Subspace Type 3 Info - NULL, ///< 41 - Pcc Subspace Type 4 Info - NULL, ///< 42 - Pcc Subspace Type 5 Info - NULL, ///< 43 - Embedded Trace Extension/Module Info - NULL ///< 44 - P-State Dependency (PSD) Info + NULL, ///< 39 - Pcc Subspace Type 3 Info + NULL, ///< 40 - Pcc Subspace Type 4 Info + NULL, ///< 41 - Pcc Subspace Type 5 Info + NULL, ///< 42 - Embedded Trace Extension/Module Info + NULL ///< 43 - P-State Dependency (PSD) Info }; /** CmObj token fixer. diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index 334d2a0265..1b3532f940 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -193,9 +193,9 @@ STATIC CONST CM_OBJ_PARSER CmArmPciConfigSpaceInfoParser[] = { { "InterruptMapToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, }; -/** A parser for EArmObjHypervisorVendorIdentity. +/** A parser for EArchCommonObjHypervisorVendorIdentity. */ -STATIC CONST CM_OBJ_PARSER CmArmHypervisorVendorIdParser[] = { +STATIC CONST CM_OBJ_PARSER CmArchCommonHypervisorVendorIdentityParser[] = { { "HypervisorVendorId", 8, "0x%llx", NULL } }; @@ -675,6 +675,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArchCommonNamespaceObjectParser[] = { CM_PARSER_ADD_OBJECT (EArchCommonObjSerialPortInfo, CmArchCommonSerialPortInfoParser), CM_PARSER_ADD_OBJECT (EArchCommonObjConsolePortInfo, CmArchCommonSerialPortInfoParser), CM_PARSER_ADD_OBJECT (EArchCommonObjSerialDebugPortInfo, CmArchCommonSerialPortInfoParser), + CM_PARSER_ADD_OBJECT (EArchCommonObjHypervisorVendorIdentity, CmArchCommonHypervisorVendorIdentityParser), CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax) }; @@ -693,7 +694,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { CM_PARSER_ADD_OBJECT (EArmObjGTBlockTimerFrameInfo, CmArmGTBlockTimerFrameInfoParser), CM_PARSER_ADD_OBJECT (EArmObjPlatformGenericWatchdogInfo, CmArmGenericWatchdogInfoParser), CM_PARSER_ADD_OBJECT (EArmObjPciConfigSpaceInfo, CmArmPciConfigSpaceInfoParser), - CM_PARSER_ADD_OBJECT (EArmObjHypervisorVendorIdentity, CmArmHypervisorVendorIdParser), CM_PARSER_ADD_OBJECT (EArmObjFixedFeatureFlags, CmArmFixedFeatureFlagsParser), CM_PARSER_ADD_OBJECT (EArmObjItsGroup, CmArmItsGroupNodeParser), CM_PARSER_ADD_OBJECT (EArmObjNamedComponent, CmArmNamedComponentNodeParser), diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md index 90f03f00e7..79ccd86e85 100644 --- a/DynamicTablesPkg/Readme.md +++ b/DynamicTablesPkg/Readme.md @@ -452,39 +452,38 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager | 9 | Generic Timer Block Frame Info | | | 10 | Platform Generic Watchdog | | | 11 | PCI Configuration Space Info | Move to Arch Common NS | -| 12 | Hypervisor Vendor Id | Move to Arch Common NS | -| 13 | Fixed feature flags for FADT | Move to Arch Common NS | -| 14 | ITS Group | | -| 15 | Named Component | | -| 16 | Root Complex | | -| 17 | SMMUv1 or SMMUv2 | | -| 18 | SMMUv3 | | -| 19 | PMCG | | -| 20 | GIC ITS Identifier Array | | -| 21 | ID Mapping Array | | -| 22 | SMMU Interrupt Array | | -| 23 | Processor Hierarchy Info | Move to Arch Common NS | -| 24 | Cache Info | Move to Arch Common NS | -| 25 | CM Object Reference | Move to Arch Common NS | -| 26 | Memory Affinity Info | Move to Arch Common NS | -| 27 | Device Handle Acpi | Move to Arch Common NS | -| 28 | Device Handle PCI | Move to Arch Common NS | -| 29 | Generic Initiator Affinity Info | Move to Arch Common NS | -| 30 | CMN 600 Info | | -| 31 | Low Power Idle State Info | Move to Arch Common NS | -| 32 | PCI Address Map Info | Move to Arch Common NS | -| 33 | PCI Interrupt Map Info | Move to Arch Common NS | -| 34 | Reserved Memory Range Node | | -| 35 | Memory Range Descriptor | | -| 36 | Continuous Performance Control Info | Move to Arch Common NS | -| 37 | Pcc Subspace Type 0 Info | Move to Arch Common NS | -| 38 | Pcc Subspace Type 1 Info | Move to Arch Common NS | -| 39 | Pcc Subspace Type 2 Info | Move to Arch Common NS | -| 40 | Pcc Subspace Type 3 Info | Move to Arch Common NS | -| 41 | Pcc Subspace Type 4 Info | Move to Arch Common NS | -| 42 | Pcc Subspace Type 5 Info | Move to Arch Common NS | -| 43 | Embedded Trace Extension/Module Info | | -| 44 | P-State Dependency (PSD) Info | Move to Arch Common NS | +| 12 | Fixed feature flags for FADT | Move to Arch Common NS | +| 13 | ITS Group | | +| 14 | Named Component | | +| 15 | Root Complex | | +| 16 | SMMUv1 or SMMUv2 | | +| 17 | SMMUv3 | | +| 18 | PMCG | | +| 19 | GIC ITS Identifier Array | | +| 20 | ID Mapping Array | | +| 21 | SMMU Interrupt Array | | +| 22 | Processor Hierarchy Info | Move to Arch Common NS | +| 23 | Cache Info | Move to Arch Common NS | +| 24 | CM Object Reference | Move to Arch Common NS | +| 25 | Memory Affinity Info | Move to Arch Common NS | +| 26 | Device Handle Acpi | Move to Arch Common NS | +| 27 | Device Handle PCI | Move to Arch Common NS | +| 28 | Generic Initiator Affinity Info | Move to Arch Common NS | +| 29 | CMN 600 Info | | +| 30 | Low Power Idle State Info | Move to Arch Common NS | +| 31 | PCI Address Map Info | Move to Arch Common NS | +| 32 | PCI Interrupt Map Info | Move to Arch Common NS | +| 33 | Reserved Memory Range Node | | +| 34 | Memory Range Descriptor | | +| 35 | Continuous Performance Control Info | Move to Arch Common NS | +| 36 | Pcc Subspace Type 0 Info | Move to Arch Common NS | +| 37 | Pcc Subspace Type 1 Info | Move to Arch Common NS | +| 38 | Pcc Subspace Type 2 Info | Move to Arch Common NS | +| 39 | Pcc Subspace Type 3 Info | Move to Arch Common NS | +| 40 | Pcc Subspace Type 4 Info | Move to Arch Common NS | +| 41 | Pcc Subspace Type 5 Info | Move to Arch Common NS | +| 42 | Embedded Trace Extension/Module Info | | +| 43 | P-State Dependency (PSD) Info | Move to Arch Common NS | | `*` | All other values are reserved. | | #### Object ID's in the Arch Common Namespace: @@ -496,4 +495,5 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager | 2 | Serial Port Info | | | 3 | Serial Console Port Info | | | 4 | Serial Debug Port Info | | +| 5 | Hypervisor Vendor Id | | | `*` | All other values are reserved. | |