mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/mm/32: Initialize CR4 shadow before __flush_tlb_all()
@ 2018-07-03  6:49 Zhenzhong Duan
  2018-07-03  7:54 ` [tip:x86/urgent] x86/mm/32: Initialize the " tip-bot for Zhenzhong Duan
  0 siblings, 1 reply; 2+ messages in thread
From: Zhenzhong Duan @ 2018-07-03  6:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, x86, tglx, srinivas.eeda, hpa

In x86_32, __flush_tlb_all() may have read cr4 shadow before the
initialization of cr4 shadow in cpuinit().

Fix it by adding cr4_init_shadow() call ahead of __flush_tlb_all().

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: Srinivas Reddy Eeda <srinivas.eeda@oracle.com>
---
 arch/x86/kernel/smpboot.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index c2f7d1d..db9656e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -221,6 +221,11 @@ static void notrace start_secondary(void *unused)
 #ifdef CONFIG_X86_32
 	/* switch away from the initial page table */
 	load_cr3(swapper_pg_dir);
+	/*
+	 * Initialize the CR4 shadow before doing anything that could
+	 * try to read it.
+	 */
+	cr4_init_shadow();
 	__flush_tlb_all();
 #endif
 	load_current_idt();
-- 
1.7.3

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

end of thread, other threads:[~2018-07-03  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03  6:49 [PATCH] x86/mm/32: Initialize CR4 shadow before __flush_tlb_all() Zhenzhong Duan
2018-07-03  7:54 ` [tip:x86/urgent] x86/mm/32: Initialize the " tip-bot for Zhenzhong Duan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome