Skip to content

Commit cda4479

Browse files
authored
fix(zone): avoid printing AMD CPU reset reasons (#126)
The hypervisor restricts access to physical MMIO pages to domU guests, so only print CPU reset reasons in the host environment.
1 parent 6a77ef9 commit cda4479

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ patches:
7373
lower: '6.1'
7474
flavors:
7575
- zone-amdgpu
76+
- patch: 0001-x86-CPU-AMD-avoid-printing-reset-reasons-on-Xen-domU.patch
77+
lower: '6.16'
7678
images:
7779
- target: kernelsrc
7880
name: kernel-src
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From a0774aaf7f936980c06470233e1330b6d8fc9bca Mon Sep 17 00:00:00 2001
2+
From: Ariadne Conill <ariadne@ariadne.space>
3+
Date: Thu, 4 Sep 2025 12:32:45 -0700
4+
Subject: [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU
5+
6+
Xen domU cannot access the given MMIO address for security reasons,
7+
resulting in a failed hypercall in ioremap() due to permissions.
8+
9+
Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset")
10+
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
11+
Cc: stable@vger.kernel.org
12+
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
13+
---
14+
arch/x86/kernel/cpu/amd.c | 6 ++++++
15+
1 file changed, 6 insertions(+)
16+
17+
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
18+
index a6f88ca1a6b4..99308fba4d7d 100644
19+
--- a/arch/x86/kernel/cpu/amd.c
20+
+++ b/arch/x86/kernel/cpu/amd.c
21+
@@ -29,6 +29,8 @@
22+
# include <asm/mmconfig.h>
23+
#endif
24+
25+
+#include <xen/xen.h>
26+
+
27+
#include "cpu.h"
28+
29+
u16 invlpgb_count_max __ro_after_init = 1;
30+
@@ -1333,6 +1335,10 @@ static __init int print_s5_reset_status_mmio(void)
31+
if (!cpu_feature_enabled(X86_FEATURE_ZEN))
32+
return 0;
33+
34+
+ /* Xen PV domU cannot access hardware directly, so bail for domU case */
35+
+ if (cpu_feature_enabled(X86_FEATURE_XENPV) && !xen_initial_domain())
36+
+ return 0;
37+
+
38+
addr = ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value));
39+
if (!addr)
40+
return 0;
41+
--
42+
2.51.0
43+

0 commit comments

Comments
 (0)