Re: [PATCH v3 1/1] x86/mce/amd: Guard SMCA DESTAT access on non-SMCA machines

From: William Roche

Date: Tue Mar 17 2026 - 16:07:25 EST


I just wanted to give a small precision about the VM error relay mechanism:

On 3/17/26 19:17, Borislav Petkov wrote:
Rewrote it again after talking to Yazen. A patch needs to have the proper
justification why it exists!

x86/mce/amd: Check SMCA feature bit before accessing SMCA MSRs

People do effort to inject MCEs into guests in order to simulate/test
handling of hardware errors. The real use case behind it is testing the
handling of SIGBUS which the memory failure code sends to the process.
If that process is QEMU, instead of killing the whole guest, the MCE can
be injected into the guest kernel so that latter can attempt proper
handling and kill the user *process* in the guest, instead, which
caused the MCE. The assumption being here that the whole injection flow
can supply enough information that the guest kernel can poinpoint the
right process. But that's a different topic...


Relaying the error to the guest doesn't only have a value to target a VM process but also deal with free memory or clean file cache memory impacted etc... Cases where a memory error may not crash the kernel can benefit to the VM too (Kernel RAS features that are, as you said, a different topic :) )

There is also a small typo in "pinpoint"

Regardless of virtualization or not, access to SMCA-specific registers
like MCA_DESTAT should only be done after having checked the smca
feature bit. And there are AMD machines like Bulldozer (the one before
Zen1) which do support deferred errors but are not SMCA machines.
Therefore, properly check the feature bit before accessing related MSRs.
[ bp: Rewrite commit message. ]


Thank you very much for your feedback !
William.