xen/arch/x86/cpu/mcheck/mcaction.c | 3 ++- xen/arch/x86/cpu/mcheck/mce.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
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".
Fixes: 9595ef77ab11 ("Implement page offline recovery action for AMD")
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
xen/arch/x86/cpu/mcheck/mcaction.c | 3 ++-
xen/arch/x86/cpu/mcheck/mce.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index bf7a0de965..96febefd0c 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -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,
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1888f22d15..8c984c61d2 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -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) &&
--
2.47.3
On 27.10.2026 01:48, Stefano Stabellini wrote:
> 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".
With this mentioned, perhaps also mention .info_collect?
> Fixes: 9595ef77ab11 ("Implement page offline recovery action for AMD")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Jan
© 2016 - 2026 Red Hat, Inc.