summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-04-05 14:28:49 +0800
committerMichael Kinney <michael.d.kinney@intel.com>2016-05-16 10:40:16 -0700
commit4b1f9ac19de8775b484c2b16d3050cd279249477 (patch)
treecbb1c6605003df7cc167a3d180b7a811ec88693c /UefiCpuPkg
parent7b1fe7acdca15be49a9421156b799ed7394f7bac (diff)
downloadedk2-4b1f9ac19de8775b484c2b16d3050cd279249477.tar.gz
edk2-4b1f9ac19de8775b484c2b16d3050cd279249477.tar.bz2
edk2-4b1f9ac19de8775b484c2b16d3050cd279249477.zip
UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile: Fix BTS support check bug
SmmProfile feature depends on BTS feature to get the invoker IP (in SMM) from last branch record. If this feature is not supported, SmmProfile cannot get the invoker IP (in SMM). Per IA-32 Architectures Software Developer's Manual, BTS feature is detected by IA32_MISC_ENABLE. If BIT11 of IA32_MISC_ENABLE is set, BTS is not supported. But current implementation check BIT11 opposite. Also, BTS feature does not depends on PEBS feature if supported or not. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Shifflett, Joseph <joseph.shifflett@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reported-by: Shifflett, Joseph <joseph.shifflett@hpe.com> Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Shifflett, Joseph <joseph.shifflett@hpe.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index 71fff0e5b0..0b75020425 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -966,10 +966,9 @@ CheckFeatureSupported (
// BTINT bits in the MSR_DEBUGCTLA MSR.
// 2. The IA32_DS_AREA MSR can be programmed to point to the DS save area.
//
- if ((AsmMsrBitFieldRead64 (MSR_IA32_MISC_ENABLE, 11, 11) == 0) &&
- (AsmMsrBitFieldRead64 (MSR_IA32_MISC_ENABLE, 12, 12) == 0)) {
+ if (AsmMsrBitFieldRead64 (MSR_IA32_MISC_ENABLE, 11, 11) == 1) {
//
- // BTS facilities is supported.
+ // BTS facilities is not supported if MSR_IA32_MISC_ENABLE BIT11 is set.
//
mBtsSupported = FALSE;
}