[tip: x86/urgent] x86/CPU/AMD: Don't print reset reason in VMs
From: tip-bot2 for Jason Andryuk
Date: Mon Nov 09 2026 - 02:54:26 EST
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: ea51d1a4c31fc8320c34f897dc5296a0bfc5c7ca
Gitweb: https://git.kernel.org/tip/ea51d1a4c31fc8320c34f897dc5296a0bfc5c7ca
Author: Jason Andryuk <jason.andryuk@xxxxxxx>
AuthorDate: Tue, 03 Nov 2026 20:30:25 -05:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Sun, 08 Nov 2026 23:25:40 -08:00
x86/CPU/AMD: Don't print reset reason in VMs
print_s5_reset_status_mmio() expects to read FCH MMIO on baremetal. VMs don't
have emulated FCH registers, so there is nothing to check. Add an early exit
when running on a hypervisor.
The real motivation is Xen PV domUs can't boot on Zen CPUs. PV domUs PTEs
contain system physical addresses - they don't have the concept of guest
physical addresses. domUs can only map physical addresses they are assigned, so
a domU fails to map the FCH MMIO addresses.
However set_pte() does not return failure, so ioremap() returns a pointer while
the PTEs are unpopulated. print_s5_reset_status_mmio() faults when reading
through the pointer, breaking the boot.
Limit the reset reason printing to baremetal only where it actually makes sense.
[ bp: Massage commit message. ]
Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset")
Suggested-by: Borislav Petkov <bp@xxxxxxxxx>
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Mario Limonciello (AMD) <superm1@xxxxxxxxxx>
Reviewed-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Link: https://patch.msgid.link/20261104013026.185392-1-jason.andryuk@xxxxxxx
---
arch/x86/kernel/cpu/amd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 3972966..2f7efd3 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1362,7 +1362,8 @@ static __init int print_s5_reset_status_mmio(void)
u32 value;
int i;
- if (!cpu_feature_enabled(X86_FEATURE_ZEN))
+ if (!cpu_feature_enabled(X86_FEATURE_ZEN) ||
+ cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
return 0;
addr = ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value));