Re: [PATCH v1 1/1] x86/mce: AMD deferred error handling crashes Qemu VMs
From: Yazen Ghannam
Date: Tue Feb 17 2026 - 10:24:47 EST
On Fri, Feb 13, 2026 at 06:26:30PM +0000, “William Roche wrote:
> From: William Roche <william.roche@xxxxxxxxxx>
>
Hi William, I agree with the fix, and feedback is mostly around
style/convention.
Use "x86/mce/amd" as the $SUBJECT prefix.
Subject should be imperative.
Ex. "x86/mce/amd: Fix VM crash during deferred error handling"
> A non Scalable MCA system may prevent access to SMCA specific registers
> like MCA_DESTAT. This is the case of Qemu/kvm VMs, and the VM kernel
I expect that QEMU and KVM should be capitalized.
> needs to avoid accessing SMCA registers on non-SMCA platforms.
>
The commit message should include an imperative statement.
Ex. "Check for the SMCA feature before accessing MCA_DESTAT."
> Fixes: 7cb735d7c0cb ("x86/mce: Unify AMD DFR handler with MCA Polling")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: William Roche <william.roche@xxxxxxxxxx>
"CC stable" tag should go after Signed-off-by.
> ---
> arch/x86/kernel/cpu/mce/amd.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
> index 3f1dda355307..53c4b032ad35 100644
> --- a/arch/x86/kernel/cpu/mce/amd.c
> +++ b/arch/x86/kernel/cpu/mce/amd.c
> @@ -875,14 +875,18 @@ void amd_clear_bank(struct mce *m)
> {
> amd_reset_thr_limit(m->bank);
>
> - /* Clear MCA_DESTAT for all deferred errors even those logged in MCA_STATUS. */
> - if (m->status & MCI_STATUS_DEFERRED)
> - mce_wrmsrq(MSR_AMD64_SMCA_MCx_DESTAT(m->bank), 0);
> -
> - /* Don't clear MCA_STATUS if MCA_DESTAT was used exclusively. */
> - if (m->kflags & MCE_CHECK_DFR_REGS)
> - return;
> + if (mce_flags.smca) {
> + /*
> + * Clear MCA_DESTAT for all deferred errors even those
> + * logged in MCA_STATUS.
> + */
> + if (m->status & MCI_STATUS_DEFERRED)
> + mce_wrmsrq(MSR_AMD64_SMCA_MCx_DESTAT(m->bank), 0);
>
> + /* Don't clear MCA_STATUS if MCA_DESTAT was used exclusively. */
> + if (m->kflags & MCE_CHECK_DFR_REGS)
> + return;
> + }
Please include a newline here.
> mce_wrmsrq(mca_msr_reg(m->bank, MCA_STATUS), 0);
> }
>
Otherwise, looks good to me.
Reviewed-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
Thanks,
Yazen