Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ AddProcHierarchyNodes (
PPTT_NODE_INDEXER *ProcNodeIterator;
UINT32 NodeCount;
UINT32 Length;
UINT32 ProcContainerIndex;

ASSERT (
(Generator != NULL) &&
Expand Down Expand Up @@ -515,6 +516,7 @@ AddProcHierarchyNodes (
}

UniqueGicCRefCount = 0;
ProcContainerIndex = 0;

while (NodeCount-- != 0) {
ProcInfoNode = (CM_ARCH_COMMON_PROC_HIERARCHY_INFO *)ProcNodeIterator->Object;
Expand Down Expand Up @@ -605,17 +607,28 @@ AddProcHierarchyNodes (
// Default invalid ACPI Processor ID to 0
ProcStruct->AcpiProcessorId = 0;
} else if (ProcInfoNode->AcpiIdObjectToken == CM_NULL_TOKEN) {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no " \
"ACPI ID Reference object token was provided. " \
"AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
ProcInfoNode->AcpiIdObjectToken,
ProcInfoNode->Token,
Status
));
return Status;
if (IS_PROC_NODE_LEAF (ProcInfoNode)) {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no " \
"ACPI ID Reference object token was provided. " \
"AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
ProcInfoNode->AcpiIdObjectToken,
ProcInfoNode->Token,
Status
));
return Status;
}

// Node is a ProcContainer with a valid ID

if (ProcInfoNode->OverrideNameUidEnabled) {
ProcStruct->AcpiProcessorId = ProcInfoNode->OverrideUid;
} else {
// Note: This value MUST match the value assigned to the _UID in SsdtCpuTopologyGenerator.c
ProcStruct->AcpiProcessorId = ProcContainerIndex++;
}
} else {
Status = GetEArmObjGicCInfo (
CfgMgrProtocol,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,11 @@ CheckProcNode (

// Check Leaf specific flags.
if (IsLeaf) {
InvalidFlags |= ((NodeFlags & PPTT_LEAF_MASK) != PPTT_LEAF_MASK);
InvalidFlags |= ((NodeFlags & PPTT_VALID_LEAF_MASK) != PPTT_VALID_LEAF_MASK);
// Must have Physical Package flag somewhere in the hierarchy
InvalidFlags |= !(HasPhysicalPackageBit || PackageNodeSeen);
} else {
InvalidFlags |= ((NodeFlags & PPTT_LEAF_MASK) != 0);
InvalidFlags |= ((NodeFlags & PPTT_LEAF_FLAG_MASK) != 0);
}

if (InvalidFlags) {
Expand All @@ -957,7 +957,7 @@ CheckProcNode (

/** Create an AML representation of the Cpu topology.

A processor container is by extension any non-leave device in the cpu topology.
A processor container is by extension any non-leaf device in the cpu topology.

@param [in] Generator The SSDT Cpu Topology generator.
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
(EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF << 3))

// Leaf nodes specific mask.
#define PPTT_LEAF_MASK ((EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
#define PPTT_VALID_LEAF_MASK ((EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))

// Mask for the LEAF flag.
#define PPTT_LEAF_FLAG_MASK (EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3)

/** LPI states are stored in the ASL namespace at '\_SB_.Lxxx',
with xxx being the node index of the LPI state.
Expand Down