DynamicTablesPkg: Rework ProximityDomain handling

The SRAT/HMAT/SLIT tables describe the relations between
ProximityDomain IDs. These proximity domains might represent
memory domains, CPUs, IO, etc.

ProximityDomain IDs are mere IDs. They don't represent anything
and could be generated by the DynamicTablesPkg framework. These
IDs are currently hard-coded by the ConfigurationManager developer.

In order to:
- avoid the developer to keep track of the used ProximityDomain IDs
- have a better internal representation of the relation between
  CPUs sharing the same ProximityDomain ID
allow the developer to use Tokens pointing to ProximityDomain
structures.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
This commit is contained in:
Pierre Gondois
2025-04-15 16:47:25 +02:00
committed by mergify[bot]
parent 8375d2ea60
commit 317ef44747
4 changed files with 79 additions and 23 deletions

View File

@@ -262,16 +262,22 @@ typedef struct CmArchCommonPciInterruptMapInfo {
*/
typedef struct CmArchCommonMemoryAffinityInfo {
/// The proximity domain to which the "range of memory" belongs.
UINT32 ProximityDomain;
UINT32 ProximityDomain;
/// Base Address
UINT64 BaseAddress;
UINT64 BaseAddress;
/// Length
UINT64 Length;
UINT64 Length;
/// Flags
UINT32 Flags;
UINT32 Flags;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_ARCH_COMMON_MEMORY_AFFINITY_INFO.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
} CM_ARCH_COMMON_MEMORY_AFFINITY_INFO;
/** A structure that describes the ACPI Device Handle (Type 0) in the
@@ -322,6 +328,12 @@ typedef struct CmArchCommonGenericInitiatorAffinityInfo {
/// Reference Token for the Device Handle
CM_OBJECT_TOKEN DeviceHandleToken;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
} CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO;
/** A structure that describes the Lpi information.

View File

@@ -190,6 +190,18 @@ typedef struct CmArmGicCInfo {
i.e. a token referencing a CM_ARCH_COMMON_PSD_INFO object.
*/
CM_OBJECT_TOKEN PsdToken;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_ARM_GICC_INFO.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
/** Optional field: Reference Token to the ClockDomain this object belongs to.
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_ARM_GICC_INFO.ClockDomain
*/
CM_OBJECT_TOKEN ClockDomainToken;
} CM_ARM_GICC_INFO;
/** A structure that describes the
@@ -261,16 +273,22 @@ typedef struct CmArmGicRedistInfo {
*/
typedef struct CmArmGicItsInfo {
/// The GIC ITS ID
UINT32 GicItsId;
UINT32 GicItsId;
/// The physical address for the Interrupt Translation Service
UINT64 PhysicalBaseAddress;
UINT64 PhysicalBaseAddress;
/** The proximity domain to which the logical processor belongs.
This field is used to populate the GIC ITS affinity structure
in the SRAT table.
*/
UINT32 ProximityDomain;
UINT32 ProximityDomain;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If this field is used, the following field is ignored:
CM_ARM_GIC_ITS_INFO.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
} CM_ARM_GIC_ITS_INFO;
/** A structure that describes the
@@ -559,6 +577,12 @@ typedef struct CmArmSmmuV3Node {
/// Unique identifier for this node.
UINT32 Identifier;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_ARM_SMMUV3_NODE.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
} CM_ARM_SMMUV3_NODE;
/** A structure that describes the

View File

@@ -333,6 +333,18 @@ typedef struct CmX64LocalApicX2ApicAffinityInfo {
UINT32 ProximityDomain;
UINT32 Flags;
UINT32 ClockDomain;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO.ProximityDomain
*/
CM_OBJECT_TOKEN ProximityDomainToken;
/** Optional field: Reference Token to the ProximityDomain this object
belongs to. If set to CM_NULL_TOKEN, the following field is used:
CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO.ClockDomain
*/
CM_OBJECT_TOKEN ClockDomainToken;
} CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO;
#pragma pack()

View File

@@ -86,6 +86,8 @@ STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser[] = {
{ "TRBEInterrupt", 2, "0x%x", NULL },
{ "EtToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "PsdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "ClockDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArmObjGicDInfo.
@@ -116,9 +118,10 @@ STATIC CONST CM_OBJ_PARSER CmArmGicRedistInfoParser[] = {
/** A parser for EArmObjGicItsInfo.
*/
STATIC CONST CM_OBJ_PARSER CmArmGicItsInfoParser[] = {
{ "GicItsId", 4, "0x%x", NULL },
{ "PhysicalBaseAddress", 8, "0x%llx", NULL },
{ "ProximityDomain", 4, "0x%x", NULL }
{ "GicItsId", 4, "0x%x", NULL },
{ "PhysicalBaseAddress", 8, "0x%llx", NULL },
{ "ProximityDomain", 4, "0x%x", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArchCommonObjConsolePortInfo,
@@ -283,6 +286,7 @@ STATIC CONST CM_OBJ_PARSER CmArmSmmuV3NodeParser[] = {
{ "ProximityDomain", 4, "0x%x", NULL },
{ "DeviceIdMappingIndex", 4, "0x%x", NULL },
{ "Identifier", 4, "0x%x", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArmObjPmcg.
@@ -358,10 +362,11 @@ STATIC CONST CM_OBJ_PARSER CmArchCommonObjRefParser[] = {
/** A parser for EArchCommonObjMemoryAffinityInfo.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonMemoryAffinityInfoParser[] = {
{ "ProximityDomain", 4, "0x%x", NULL },
{ "BaseAddress", 8, "0x%llx", NULL },
{ "Length", 8, "0x%llx", NULL },
{ "Flags", 4, "0x%x", NULL }
{ "ProximityDomain", 4, "0x%x", NULL },
{ "BaseAddress", 8, "0x%llx", NULL },
{ "Length", 8, "0x%llx", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArchCommonObjDeviceHandleAcpi.
@@ -383,10 +388,11 @@ STATIC CONST CM_OBJ_PARSER CmArchCommonDeviceHandlePciParser[] = {
/** A parser for EArchCommonObjGenericInitiatorAffinityInfo.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonGenericInitiatorAffinityInfoParser[] = {
{ "ProximityDomain", 4, "0x%x", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "DeviceHandleType", 1, "0x%x", NULL },
{ "DeviceHandleToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
{ "ProximityDomain", 4, "0x%x", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "DeviceHandleType", 1, "0x%x", NULL },
{ "DeviceHandleToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArmObjCmn600Info.
@@ -1081,11 +1087,13 @@ STATIC CONST CM_OBJ_PARSER CmX64ObjFacsInfoParser[] = {
/** A parser for CmX64LocalApicX2ApicAffinityInfo.
*/
STATIC CONST CM_OBJ_PARSER CmX64LocalApicX2ApicAffinityInfo[] = {
{ "ApicMode", sizeof (LOCAL_APIC_MODE), "0x%x", NULL },
{ "ApicId", 4, "0x%x", NULL },
{ "ProximityDomain", 4, "0x%x", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "ClockDomain", 4, "0x%x", NULL }
{ "ApicMode", sizeof (LOCAL_APIC_MODE), "0x%x", NULL },
{ "ApicId", 4, "0x%x", NULL },
{ "ProximityDomain", 4, "0x%x", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "ClockDomain", 4, "0x%x", NULL },
{ "ProximityDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "ClockDomainToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for X64 namespace objects.