From 6acc06c63efc24d6e371f0fae685148ffec043da Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 4 Sep 2025 12:40:39 -0700 Subject: [PATCH] fix(zone): avoid printing AMD CPU reset reasons The hypervisor restricts access to physical MMIO pages to domU guests, so only print CPU reset reasons in the host environment. --- config.yaml | 2 + ...d-printing-reset-reasons-on-Xen-domU.patch | 43 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 patches/0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch diff --git a/config.yaml b/config.yaml index 5484b871..78cc9ad2 100644 --- a/config.yaml +++ b/config.yaml @@ -73,6 +73,8 @@ patches: lower: '6.1' flavors: - zone-amdgpu +- patch: 0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch + lower: '6.16' images: - target: kernelsrc name: kernel-src diff --git a/patches/0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch b/patches/0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch new file mode 100644 index 00000000..0824ca36 --- /dev/null +++ b/patches/0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch @@ -0,0 +1,43 @@ +From a0774aaf7f936980c06470233e1330b6d8fc9bca Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 4 Sep 2025 12:32:45 -0700 +Subject: [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU + +Xen domU cannot access the given MMIO address for security reasons, +resulting in a failed hypercall in ioremap() due to permissions. + +Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset") +Signed-off-by: Ariadne Conill +Cc: stable@vger.kernel.org +Signed-off-by: Ariadne Conill +--- + arch/x86/kernel/cpu/amd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c +index a6f88ca1a6b4..99308fba4d7d 100644 +--- a/arch/x86/kernel/cpu/amd.c ++++ b/arch/x86/kernel/cpu/amd.c +@@ -29,6 +29,8 @@ + # include + #endif + ++#include ++ + #include "cpu.h" + + u16 invlpgb_count_max __ro_after_init = 1; +@@ -1333,6 +1335,10 @@ static __init int print_s5_reset_status_mmio(void) + if (!cpu_feature_enabled(X86_FEATURE_ZEN)) + return 0; + ++ /* Xen PV domU cannot access hardware directly, so bail for domU case */ ++ if (cpu_feature_enabled(X86_FEATURE_XENPV) && !xen_initial_domain()) ++ return 0; ++ + addr = ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value)); + if (!addr) + return 0; +-- +2.51.0 +