All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/S3: restore MCE (APs) and add MTRR (BSP) init
@ 2026-03-04 13:39 Jan Beulich
  2026-03-04 14:36 ` Marek Marczykowski
  2026-03-23 11:16 ` Roger Pau Monné
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Beulich @ 2026-03-04 13:39 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Roger Pau Monné, Marek Marczykowski

MCE init for APs was broken when CPU feature re-checking was added. MTRR
(re)init for the BSP looks to never have been there on the resume path.

Fixes: bb502a8ca592 ("x86: check feature flags after resume")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Sadly we need to go by CPU number (zero vs non-zero) here. See the call
site of recheck_cpu_features() in enter_state().

--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -642,16 +642,21 @@ void identify_cpu(struct cpuinfo_x86 *c)
 			       smp_processor_id());
 	}
 
-	if (system_state == SYS_STATE_resume)
-		return;
+	if (system_state == SYS_STATE_resume) {
+		unsigned int cpu = smp_processor_id();
 
+		if (cpu)
+			mcheck_init(&cpu_data[cpu], false);
+		else /* Yes, the BSP needs to use the AP function here. */
+			mtrr_ap_init();
+	}
 	/*
 	 * On SMP, boot_cpu_data holds the common feature set between
 	 * all CPUs; so make sure that we indicate which features are
 	 * common between the CPUs.  The first time this routine gets
 	 * executed, c == &boot_cpu_data.
 	 */
-	if ( c != &boot_cpu_data ) {
+	else if (c != &boot_cpu_data) {
 		/* AND the already accumulated flags with these */
 		for ( i = 0 ; i < NCAPINTS ; i++ )
 			boot_cpu_data.x86_capability[i] &= c->x86_capability[i];


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

end of thread, other threads:[~2026-03-23 11:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04 13:39 [PATCH] x86/S3: restore MCE (APs) and add MTRR (BSP) init Jan Beulich
2026-03-04 14:36 ` Marek Marczykowski
2026-03-04 14:47   ` Jan Beulich
2026-03-04 15:00     ` Marek Marczykowski
2026-03-23 11:21       ` Jan Beulich
2026-03-23 11:26         ` Marek Marczykowski
2026-03-23 11:16 ` Roger Pau Monné
2026-03-23 11:38   ` Jan Beulich
2026-03-23 11:43     ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.