x86/mce: don't call an unregistered address check
PATCH 1/1 x86/mce: don't call an unregistered address check
Family 0Fh registers no check_addr callback, yet mca_init_bank() and mc_memerr_dhandler() call it unconditionally. With altcall the NULL pointer is patched to ud2, so on such a CPU the first bank reporting a valid address traps inside the machine check path.
Treat a missing callback as the address not being physical. The recoverable_scan callback, also not registered on family 0Fh, is already guarded through "recover".
--- xen/arch/x86/cpu/mcheck/mcaction.c | 3 ++- xen/arch/x86/cpu/mcheck/mce.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
xen/arch/x86/cpu/mcheck/mcaction.c +2 -1
@@ -41,7 +41,8 @@ mc_memerr_dhandler(struct mca_binfo *binfo,int vmce_vcpuid;unsigned int mc_vcpuid; -if ( !alternative_call (mce_callbacks.check_addr, bank->mc_status, +if ( !mce_callbacks.check_addr || + !alternative_call (mce_callbacks.check_addr, bank->mc_status, bank->mc_misc,MC_ADDR_PHYSICAL ) ) { dprintk(XENLOG_WARNING,
xen/arch/x86/cpu/mcheck/mce.c +1 -0
@@ -192,6 +192,7 @@ static void mca_init_bank(enum mca_source who, struct mc_info *mi, int bank) if ( (mib->mc_status & MCi_STATUS_MISCV) && (mib->mc_status & MCi_STATUS_ADDRV) && + mce_callbacks.check_addr && alternative_call(mce_callbacks.check_addr, mib->mc_status, mib->mc_misc, MC_ADDR_PHYSICAL) && (who == MCA_POLLER || who == MCA_CMCI_HANDLER) &&
Signature · 1 line
2.47.3
Quoted 8 lines · Stefano Stabellini
Family 0Fh registers no
check_addrcallback, yetmca_init_bank()andmc_memerr_dhandler()call it unconditionally. With altcall the NULL pointer is patched to ud2, so on such a CPU the first bank reporting a valid address traps inside the machine check path.Treat a missing callback as the address not being physical. The
recoverable_scancallback, also not registered on family 0Fh, is already guarded through "recover".
With this mentioned, perhaps also mention .info_collect?
Quoted 2 lines
Fixes 9595ef77ab11 ("Implement page offline recovery action for AMD")Signed-off-by Stefano Stabellini <[email protected]>
Jan