On Wed, Sep 15, 2021 at 06:27:35PM -0500, Smita Koralahalli wrote:
The MCA_IPID register uniquely identifies a bank's type on Scalable MCAThis whole thing belongs into inj_ipid_set() where you should verify
(SMCA) systems. When an MCA bank is not populated, the MCA_IPID register
will read as zero and writes to it will be ignored. Check the value of
this register before trying to simulate the error.
Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@xxxxxxx>
---
arch/x86/kernel/cpu/mce/inject.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
index 0bfc14041bbb..51ac575c4605 100644
--- a/arch/x86/kernel/cpu/mce/inject.c
+++ b/arch/x86/kernel/cpu/mce/inject.c
@@ -577,6 +577,24 @@ static int inj_bank_set(void *data, u64 val)
}
+ if (boot_cpu_has(X86_FEATURE_SMCA)) {
whether the bank is set when you try to set the IPID for that bank.
+ if (!m->ipid) {
+ pr_err("Error simulation not possible: Bank %llu unpopulated\n",
+Oh well, one IPI per ipid write. We're doing injection so we can't be on
+ /* Check for user provided IPID value. */
+ if (!m->ipid) {
+ rdmsrl_on_cpu(m->extcpu, MSR_AMD64_SMCA_MCx_IPID(val),
+ &m->ipid);
a production machine so who cares about IPIs there.