All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/MTRR: constrain AP sync and BSP restore
@ 2025-03-27  9:54 Jan Beulich
  2025-03-27 10:53 ` Roger Pau Monné
  2025-03-27 16:31 ` Roger Pau Monné
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2025-03-27  9:54 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org; +Cc: Andrew Cooper, Roger Pau Monné

mtrr_set_all() has quite a bit of overhead, which is entirely useless
when set_mtrr_state() really does nothing. Furthermore, with
mtrr_state.def_type never initialized from hardware, post_set()'s
unconditional writing of the MSR means would leave us running in UC
mode after the sync.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -605,13 +605,15 @@ void mtrr_aps_sync_begin(void)
 
 void mtrr_aps_sync_end(void)
 {
-	set_mtrr(~0U, 0, 0, 0);
+	if (mtrr_if)
+		set_mtrr(~0U, 0, 0, 0);
 	hold_mtrr_updates_on_aps = 0;
 }
 
 void mtrr_bp_restore(void)
 {
-	mtrr_set_all();
+	if (mtrr_if)
+		mtrr_set_all();
 }
 
 static int __init cf_check mtrr_init_finialize(void)


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

end of thread, other threads:[~2025-03-27 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27  9:54 [PATCH] x86/MTRR: constrain AP sync and BSP restore Jan Beulich
2025-03-27 10:53 ` Roger Pau Monné
2025-03-27 11:03   ` Jan Beulich
2025-03-27 15:05     ` Andrew Cooper
2025-03-27 16:31 ` 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.