Skip to content

Commit 5fb3f57

Browse files
jbrasenmergify[bot]
authored andcommitted
DynamicTablesPkg: Allow for specified CPU names
Allow object to specify the name of processor and processor container nodes and the UID of processor containers. This allows these to be more accurately referenced from other tables. For example for the _PSL method or the UID in the APMT table. The UID and Name for processor container may be different as if the intention is to set names as the corresponding affinity level the UID may need to be different if there are multiple levels of containers. Signed-off-by: Jeff Brasen <[email protected]> Reviewed-by: Sami Mujawar <[email protected]>
1 parent 05da2d2 commit 5fb3f57

File tree

3 files changed

+43
-11
lines changed

3 files changed

+43
-11
lines changed

DynamicTablesPkg/Include/ArmNameSpaceObjects.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,17 @@ typedef struct CmArmProcHierarchyInfo {
768768
/// Token identifying a CM_ARM_OBJ_REF structure, itself referencing
769769
/// CM_ARM_LPI_INFO objects.
770770
CM_OBJECT_TOKEN LpiToken;
771+
/// Set to TRUE if UID should override index for name and _UID
772+
/// for processor container nodes and name of processors.
773+
/// This should be consistently set for containers or processors to avoid
774+
/// duplicate values
775+
BOOLEAN OverrideNameUidEnabled;
776+
/// If OverrideNameUidEnabled is TRUE then this value will be used for name of
777+
/// processors and processor containers.
778+
UINT16 OverrideName;
779+
/// If OverrideNameUidEnabled is TRUE then this value will be used for
780+
/// the UID of processor containers.
781+
UINT32 OverrideUid;
771782
} CM_ARM_PROC_HIERARCHY_INFO;
772783

773784
/** A structure that describes the Cache Type Structure (Type 1) in PPTT

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ GenerateLpiStates (
553553
@param [in] Generator The SSDT Cpu Topology generator.
554554
@param [in] ParentNode Parent node to attach the Cpu node to.
555555
@param [in] GicCInfo CM_ARM_GICC_INFO object used to create the node.
556-
@param [in] CpuIndex Index used to generate the node name.
556+
@param [in] CpuName Value used to generate the node name.
557557
@param [out] CpuNodePtr If not NULL, return the created Cpu node.
558558
559559
@retval EFI_SUCCESS Success.
@@ -567,7 +567,7 @@ CreateAmlCpu (
567567
IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
568568
IN AML_NODE_HANDLE ParentNode,
569569
IN CM_ARM_GICC_INFO *GicCInfo,
570-
IN UINT32 CpuIndex,
570+
IN UINT32 CpuName,
571571
OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL
572572
)
573573
{
@@ -579,7 +579,7 @@ CreateAmlCpu (
579579
ASSERT (ParentNode != NULL);
580580
ASSERT (GicCInfo != NULL);
581581

582-
Status = WriteAslName ('C', CpuIndex, AslName);
582+
Status = WriteAslName ('C', CpuName, AslName);
583583
if (EFI_ERROR (Status)) {
584584
ASSERT (0);
585585
return Status;
@@ -628,7 +628,7 @@ CreateAmlCpu (
628628
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
629629
Protocol Interface.
630630
@param [in] ParentNode Parent node to attach the Cpu node to.
631-
@param [in] CpuIndex Index used to generate the node name.
631+
@param [in] CpuName Value used to generate the node name.
632632
@param [in] ProcHierarchyNodeInfo CM_ARM_PROC_HIERARCHY_INFO describing
633633
the Cpu.
634634
@@ -643,7 +643,7 @@ CreateAmlCpuFromProcHierarchy (
643643
IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
644644
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
645645
IN AML_NODE_HANDLE ParentNode,
646-
IN UINT32 CpuIndex,
646+
IN UINT32 CpuName,
647647
IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo
648648
)
649649
{
@@ -668,7 +668,7 @@ CreateAmlCpuFromProcHierarchy (
668668
return Status;
669669
}
670670

671-
Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuIndex, &CpuNode);
671+
Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuNode);
672672
if (EFI_ERROR (Status)) {
673673
ASSERT (0);
674674
return Status;
@@ -735,7 +735,8 @@ CreateAmlProcessorContainer (
735735
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
736736
IN AML_NODE_HANDLE ParentNode,
737737
IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo,
738-
IN UINT32 ProcContainerIndex,
738+
IN UINT16 ProcContainerName,
739+
IN UINT32 ProcContainerUid,
739740
OUT AML_OBJECT_NODE_HANDLE *ProcContainerNodePtr
740741
)
741742
{
@@ -749,7 +750,7 @@ CreateAmlProcessorContainer (
749750
ASSERT (ProcHierarchyNodeInfo != NULL);
750751
ASSERT (ProcContainerNodePtr != NULL);
751752

752-
Status = WriteAslName ('C', ProcContainerIndex, AslNameProcContainer);
753+
Status = WriteAslName ('C', ProcContainerName, AslNameProcContainer);
753754
if (EFI_ERROR (Status)) {
754755
ASSERT (0);
755756
return Status;
@@ -765,7 +766,7 @@ CreateAmlProcessorContainer (
765766
// and EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID is set for non-Cpus.
766767
Status = AmlCodeGenNameInteger (
767768
"_UID",
768-
ProcContainerIndex,
769+
ProcContainerUid,
769770
ProcContainerNode,
770771
NULL
771772
);
@@ -838,6 +839,8 @@ CreateAmlCpuTopologyTree (
838839
UINT32 Index;
839840
UINT32 CpuIndex;
840841
AML_OBJECT_NODE_HANDLE ProcContainerNode;
842+
UINT32 Uid;
843+
UINT16 Name;
841844

842845
ASSERT (Generator != NULL);
843846
ASSERT (Generator->ProcNodeList != NULL);
@@ -868,11 +871,17 @@ CreateAmlCpuTopologyTree (
868871
return EFI_INVALID_PARAMETER;
869872
}
870873

874+
if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) {
875+
Name = Generator->ProcNodeList[Index].OverrideName;
876+
} else {
877+
Name = CpuIndex;
878+
}
879+
871880
Status = CreateAmlCpuFromProcHierarchy (
872881
Generator,
873882
CfgMgrProtocol,
874883
ParentNode,
875-
CpuIndex,
884+
Name,
876885
&Generator->ProcNodeList[Index]
877886
);
878887
if (EFI_ERROR (Status)) {
@@ -897,12 +906,21 @@ CreateAmlCpuTopologyTree (
897906
return EFI_INVALID_PARAMETER;
898907
}
899908

909+
if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) {
910+
Name = Generator->ProcNodeList[Index].OverrideName;
911+
Uid = Generator->ProcNodeList[Index].OverrideUid;
912+
} else {
913+
Name = *ProcContainerIndex;
914+
Uid = *ProcContainerIndex;
915+
}
916+
900917
Status = CreateAmlProcessorContainer (
901918
Generator,
902919
CfgMgrProtocol,
903920
ParentNode,
904921
&Generator->ProcNodeList[Index],
905-
*ProcContainerIndex,
922+
Name,
923+
Uid,
906924
&ProcContainerNode
907925
);
908926
if (EFI_ERROR (Status)) {

DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ STATIC CONST CM_OBJ_PARSER CmArmProcHierarchyInfoParser[] = {
305305
{ "NoOfPrivateResources", 4, "0x%x", NULL },
306306
{ "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
307307
{ "LpiToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
308+
{ "OverrideNameUidEnabled", 1, "%d", NULL },
309+
{ "OverrideName", 2, "0x%x", NULL },
310+
{ "OverrideUid", 4, "0x%x", NULL }
308311
};
309312

310313
/** A parser for EArmObjCacheInfo.

0 commit comments

Comments
 (0)