summaryrefslogtreecommitdiff
path: root/src/security/intel/txt
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-07-09 23:05:21 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-07-12 21:48:37 +0000
commit7cf3787a5303df7e56ac4c84081d4ad39239ba3c (patch)
tree39475ca8be7e07c560fe2d642e260fbc343a1bd3 /src/security/intel/txt
parent46e6a5883ed0defe44fe04ca1ddf849cf43d6172 (diff)
security/intel/txt: use mca_get_bank_count()
Use the common mca_get_bank_count function instead of open-coding the functionality to get the MCA bank number. Change-Id: I28244c975ee34d36d0b44df092d4a62a01c3c79c Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56187 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/security/intel/txt')
-rw-r--r--src/security/intel/txt/common.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/security/intel/txt/common.c b/src/security/intel/txt/common.c
index 239e152014..011e8ccd3f 100644
--- a/src/security/intel/txt/common.c
+++ b/src/security/intel/txt/common.c
@@ -481,8 +481,7 @@ bool intel_txt_prepare_txt_env(void)
* Make sure there are no uncorrectable MCE errors.
* Intel 64 and IA-32 Architectures Software Developer Manuals Vol 2D
*/
- msr = rdmsr(IA32_MCG_CAP);
- size_t max_mc_msr = msr.lo & MCA_BANKS_MASK;
+ size_t max_mc_msr = mca_get_bank_count();
for (size_t i = 0; i < max_mc_msr; i++) {
msr = rdmsr(IA32_MC0_STATUS + 4 * i);
if (!(msr.hi & MCA_STATUS_HI_UC))