From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: <linux-kernel@vger.kernel.org>
Cc: <mingo@redhat.com>, <x86@kernel.org>, <tglx@linutronix.de>,
<srinivas.eeda@oracle.com>, <hpa@zytor.com>
Subject: [PATCH] x86/mm/32: Initialize CR4 shadow before __flush_tlb_all()
Date: Mon, 2 Jul 2018 23:49:54 -0700 (PDT) [thread overview]
Message-ID: <b07b6ae9-4b57-4b40-b9bc-50c2c67f1d91@default> (raw)
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
next reply other threads:[~2018-07-03 6:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 6:49 Zhenzhong Duan [this message]
2018-07-03 7:54 ` [tip:x86/urgent] x86/mm/32: Initialize the " tip-bot for Zhenzhong Duan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b07b6ae9-4b57-4b40-b9bc-50c2c67f1d91@default \
--to=zhenzhong.duan@oracle.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=srinivas.eeda@oracle.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®