summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2018-10-17 09:24:05 +0800
committerEric Dong <eric.dong@intel.com>2018-10-22 11:19:49 +0800
commitd28daaddb3e732468e930a809d3d3943a5de9558 (patch)
tree615dd8f0f37092b4514a144ad3ba4fcf95091e37 /UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
parent38381e18bf08dadad91627949996d106612f4753 (diff)
downloadedk2-d28daaddb3e732468e930a809d3d3943a5de9558.tar.gz
edk2-d28daaddb3e732468e930a809d3d3943a5de9558.tar.bz2
edk2-d28daaddb3e732468e930a809d3d3943a5de9558.zip
UefiCpuPkg/CpuCommonFeaturesLib: Register MSR base on scope Info.
Because MSR has scope attribute, driver has no needs to set MSR for all APs if MSR scope is core or package type. This patch updates code to base on the MSR scope value to add MSR to the register table. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c')
-rw-r--r--UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
index 721470cdfe..d6219f4f3f 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
@@ -101,6 +101,17 @@ PpinInitialize (
return MsrPpinCtrl.Bits.Enable_PPIN == State ? RETURN_SUCCESS : RETURN_DEVICE_ERROR;
}
+ //
+ // Support function already check the processor which support PPIN feature, so this function not need
+ // to check the processor again.
+ //
+ // The scope of the MSR_IVY_BRIDGE_PPIN_CTL is package level, only program MSR_IVY_BRIDGE_PPIN_CTL for
+ // thread 0 core 0 in each package.
+ //
+ if ((CpuInfo->ProcessorInfo.Location.Thread != 0) || (CpuInfo->ProcessorInfo.Location.Core != 0)) {
+ return RETURN_SUCCESS;
+ }
+
CPU_REGISTER_TABLE_WRITE_FIELD (
ProcessorNumber,
Msr,