summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index cbc5594c78..ab7a8ed663 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1879,11 +1879,18 @@ MpInitLibGetProcessorInfo (
CPU_MP_DATA *CpuMpData;
UINTN CallerNumber;
CPU_INFO_IN_HOB *CpuInfoInHob;
+ UINTN OriginalProcessorNumber;
CpuMpData = GetCpuMpData ();
CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;
//
+ // Lower 24 bits contains the actual processor number.
+ //
+ OriginalProcessorNumber = ProcessorNumber;
+ ProcessorNumber &= BIT24 - 1;
+
+ //
// Check whether caller processor is BSP
//
MpInitLibWhoAmI (&CallerNumber);
@@ -1923,6 +1930,18 @@ MpInitLibGetProcessorInfo (
&ProcessorInfoBuffer->Location.Thread
);
+ if ((OriginalProcessorNumber & CPU_V2_EXTENDED_TOPOLOGY) != 0) {
+ GetProcessorLocation2ByApicId (
+ CpuInfoInHob[ProcessorNumber].ApicId,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Package,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Die,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Tile,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Module,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Core,
+ &ProcessorInfoBuffer->ExtendedInformation.Location2.Thread
+ );
+ }
+
if (HealthData != NULL) {
HealthData->Uint32 = CpuInfoInHob[ProcessorNumber].Health;
}