diff options
author | Ray Ni <ray.ni@intel.com> | 2019-07-05 11:49:15 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-02-14 03:15:00 +0000 |
commit | 534fcb84decdd613cc35309f24e7b792b1928809 (patch) | |
tree | 10b4e8d5494937d7a93b4f5c21bb4b9d14473883 /UefiCpuPkg/Include | |
parent | 0f1ddb21ff94b3d4e66446f9b26ac156475eb85e (diff) | |
download | edk2-534fcb84decdd613cc35309f24e7b792b1928809.tar.gz edk2-534fcb84decdd613cc35309f24e7b792b1928809.tar.bz2 edk2-534fcb84decdd613cc35309f24e7b792b1928809.zip |
UefiCpuPkg/CpuFeature: Introduce First to indicate 1st unit.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1584
The flow of CPU feature initialization logic is:
1. BSP calls GetConfigDataFunc() for each thread/AP;
2. Each thread/AP calls SupportFunc() to detect its own capability;
3. BSP calls InitializeFunc() for each thread/AP.
There is a design gap in step #3. For a package scope feature that only
requires one thread of each package does the initialization operation,
what InitializeFunc() currently does is to do the initialization
operation only CPU physical location Core# is 0.
But in certain platform, Core#0 might be disabled in hardware level
which results the certain package scope feature isn't initialized at
all.
The patch adds a new field First to indicate the CPU's location in
its parent scope.
First.Package is set for all APs/threads under first package;
First.Core is set for all APs/threads under first core of each
package;
First.Thread is set for the AP/thread of each core.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'UefiCpuPkg/Include')
-rw-r--r-- | UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h index be14a92b35..27bd2f6b48 100644 --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h @@ -79,6 +79,37 @@ /// @}
///
+/// The bit field to indicate whether the processor is the first in its parent scope.
+///
+typedef struct {
+ //
+ // Set to 1 when current processor is the first thread in the core it resides in.
+ //
+ UINT32 Thread : 1;
+ //
+ // Set to 1 when current processor is a thread of the first core in the module it resides in.
+ //
+ UINT32 Core : 1;
+ //
+ // Set to 1 when current processor is a thread of the first module in the tile it resides in.
+ //
+ UINT32 Module : 1;
+ //
+ // Set to 1 when current processor is a thread of the first tile in the die it resides in.
+ //
+ UINT32 Tile : 1;
+ //
+ // Set to 1 when current processor is a thread of the first die in the package it resides in.
+ //
+ UINT32 Die : 1;
+ //
+ // Set to 1 when current processor is a thread of the first package in the system.
+ //
+ UINT32 Package : 1;
+ UINT32 Reserved : 26;
+} REGISTER_CPU_FEATURE_FIRST_PROCESSOR;
+
+///
/// CPU Information passed into the SupportFunc and InitializeFunc of the
/// RegisterCpuFeature() library function. This structure contains information
/// that is commonly used during CPU feature detection and initialization.
@@ -88,6 +119,11 @@ typedef struct { /// The package that the CPU resides
///
EFI_PROCESSOR_INFORMATION ProcessorInfo;
+
+ ///
+ /// The bit flag indicating whether the CPU is the first Thread/Core/Module/Tile/Die/Package in its parent scope.
+ ///
+ REGISTER_CPU_FEATURE_FIRST_PROCESSOR First;
///
/// The Display Family of the CPU computed from CPUID leaf CPUID_VERSION_INFO
///
|