diff options
-rw-r--r-- | src/include/cpu/x86/msr.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/cpu/x86/msr.h b/src/include/cpu/x86/msr.h index dd969d765d..51ef2e08ea 100644 --- a/src/include/cpu/x86/msr.h +++ b/src/include/cpu/x86/msr.h @@ -166,6 +166,16 @@ static inline unsigned int mca_get_bank_count(void) return msr.lo & MCA_BANKS_MASK; } +/* Clear all MCA status registers */ +static inline void mca_clear_status(void) +{ + const unsigned int num_banks = mca_get_bank_count(); + const msr_t msr = {.lo = 0, .hi = 0}; + + for (unsigned int i = 0 ; i < num_banks ; i++) + wrmsr(IA32_MC_STATUS(i), msr); +} + /* Helpers for interpreting MC[i]_STATUS */ static inline int mca_valid(msr_t msr) |