diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2024-09-06 11:41:20 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-06 07:43:40 +0000 |
commit | c047353a1244121f7d5b1780dbef2e2b30f762e1 (patch) | |
tree | 26fcb881f98277cff7ebdd46837f5ae5fdbaf132 /UefiCpuPkg | |
parent | 253b3d678aa541b24a2e05f2279975de06abfeec (diff) | |
download | edk2-c047353a1244121f7d5b1780dbef2e2b30f762e1.tar.gz |
UefiCpuPkg/PiSmmCpuDxeSmm: Avoid to access MCA_CAP if CPU does not support
Do not access MCA_CAP MSR unless the CPU supports the SmmRegFeatureControl
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c index c152dccea4..ee64d6b6d0 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c @@ -889,15 +889,13 @@ CheckFeatureSupported ( }
if (mSmmCodeAccessCheckEnable) {
- if (!SmmCpuFeaturesIsSmmRegisterSupported (CpuIndex, SmmRegFeatureControl)) {
- mSmmCodeAccessCheckEnable = FALSE;
- }
-
//
// Check to see if the CPU supports the SMM Code Access Check feature
// Do not access this MSR unless the CPU supports the SmmRegFeatureControl
//
- if ((AsmReadMsr64 (EFI_MSR_SMM_MCA_CAP) & SMM_CODE_ACCESS_CHK_BIT) == 0) {
+ if (!SmmCpuFeaturesIsSmmRegisterSupported (CpuIndex, SmmRegFeatureControl) ||
+ ((AsmReadMsr64 (EFI_MSR_SMM_MCA_CAP) & SMM_CODE_ACCESS_CHK_BIT) == 0))
+ {
mSmmCodeAccessCheckEnable = FALSE;
}
}
|