]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk
authorJeff Fan <jeff.fan@intel.com>
Fri, 20 Nov 2015 01:23:52 +0000 (01:23 +0000)
committervanjeff <vanjeff@Edk2>
Fri, 20 Nov 2015 01:23:52 +0000 (01:23 +0000)
commit4ab4e20f1ade6a11824325b0d8529b0b1837d306
treea8a0248582c1344f714badfb01065d00b20f0a52
parentf6bc3a6d2623c317cefb990d4ae7cbcfc04008b9
UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk

Bit SMM_Code_Access_Chk (SMM-RO) in MSR_SMM_MCA_CAP is defined in SDM.
If set to 1 indicates that the SMM code access restriction is supported and the
MSR_SMM_FEATURE_CONTROL is supported.

If this bit is not set, we needn't to access register SmmFetureControl.
Otherwise, #GP exception may happen.
We need to check if SmmFeatureControl support or not by checking
SMM_Code_Access_Chk (SMM-RO) in MSR_SMM_MCA_CAP.

Because MSR_SMM_MCA_CAP is SMM-RO register, we should move this check from
SmmCpuFeaturesLibConstructor (non-SMM) to SmmCpuFeaturesInitializeProcessor
(SMM).

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18906 6f19259b-4bc3-4df7-8a09-765794883524
UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c