stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU
@ 2025-12-19  1:01 Ariadne Conill
  2025-12-19  3:56 ` Borislav Petkov
  2025-12-19 16:32 ` Teddy Astie
  0 siblings, 2 replies; 12+ messages in thread
From: Ariadne Conill @ 2025-12-19  1:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: mario.limonciello, darwi, sandipan.das, kai.huang, me,
	yazen.ghannam, riel, peterz, hpa, x86, tglx, mingo, bp,
	dave.hansen, Ariadne Conill, xen-devel, stable

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 <ariadne@ariadne.space>
Cc: xen-devel@lists.xenproject.org
Cc: stable@vger.kernel.org
---
 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 <asm/mmconfig.h>
 #endif
 
+#include <xen/xen.h>
+
 #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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-12-22 15:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19  1:01 [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU Ariadne Conill
2025-12-19  3:56 ` Borislav Petkov
2025-12-19 16:09   ` Sean Christopherson
2025-12-19 16:26     ` Andrew Cooper
2025-12-19 17:36       ` Sean Christopherson
2025-12-19 23:14         ` Borislav Petkov
2025-12-19 23:16     ` Borislav Petkov
2025-12-19 23:19     ` Ariadne Conill
2025-12-19 16:32 ` Teddy Astie
2025-12-19 17:38   ` Sean Christopherson
2025-12-20  1:44     ` Teddy Astie
2025-12-22 15:46       ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).