summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorRay Ni <ray.ni@intel.com>2019-03-25 17:32:15 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-15 08:48:35 +0000
commit9099dcbd61c8d22b5eedda783d143c222d2705a3 (patch)
tree780ae198f5cf744b8e4866d35ba03700af9674b8 /UefiCpuPkg/Library
parent15ac284815b1e1d5fe8dbc737129f82c9a92649b (diff)
downloadedk2-9099dcbd61c8d22b5eedda783d143c222d2705a3.tar.gz
edk2-9099dcbd61c8d22b5eedda783d143c222d2705a3.tar.bz2
edk2-9099dcbd61c8d22b5eedda783d143c222d2705a3.zip
UefiCpuPkg/MpService: GetProcessorInfo returns 6-level topology
Intel SDM introduces 6-levels for describing the CPU topology: * Package * Module * Tile * Die * Core * Thread A PI spec ECR was submitted to enhance CPU_MP PPI/Protocol to support returning such information through GetProcessorInfo(). An accordingly change was implemented and pushed to edk2-staging. Now the PI spec has been published. The patch is cherry-picked from edk2-staging to edk2. Signed-off-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
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;
}