summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.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/ProcTrace.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/ProcTrace.c')
-rw-r--r--UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
index 98490c6777..cf34ad4d1f 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
@@ -191,6 +191,17 @@ ProcTraceInitialize (
MSR_IA32_RTIT_OUTPUT_MASK_PTRS_REGISTER OutputMaskPtrsReg;
RTIT_TOPA_TABLE_ENTRY *TopaEntryPtr;
+ //
+ // The scope of the MSR_IA32_RTIT_* is core for below processor type, only program
+ // MSR_IA32_RTIT_* for thread 0 in each core.
+ //
+ if (IS_GOLDMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
+ IS_GOLDMONT_PLUS_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {
+ if (CpuInfo->ProcessorInfo.Location.Thread != 0) {
+ return RETURN_SUCCESS;
+ }
+ }
+
ProcTraceData = (PROC_TRACE_DATA *) ConfigData;
ASSERT (ProcTraceData != NULL);