From: tip-bot for Steven Rostedt <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, torvalds@linux-foundation.org,
luto@amacapital.net, peterz@infradead.org, mingo@kernel.org,
linux-kernel@vger.kernel.org, rostedt@goodmis.org, hpa@zytor.com
Subject: [tip:x86/urgent] x86: Init per-cpu shadow copy of CR4 on 32-bit CPUs too
Date: Fri, 27 Feb 2015 23:07:00 -0800 [thread overview]
Message-ID: <tip-5b2bdbc84556774afbe11bcfd24c2f6411cfa92b@git.kernel.org> (raw)
In-Reply-To: <20150227145019.2bdd4354@gandalf.local.home>
Commit-ID: 5b2bdbc84556774afbe11bcfd24c2f6411cfa92b
Gitweb: http://git.kernel.org/tip/5b2bdbc84556774afbe11bcfd24c2f6411cfa92b
Author: Steven Rostedt <rostedt@goodmis.org>
AuthorDate: Fri, 27 Feb 2015 14:50:19 -0500
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 28 Feb 2015 08:04:20 +0100
x86: Init per-cpu shadow copy of CR4 on 32-bit CPUs too
Commit:
1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
added a shadow CR4 such that reads and writes that do not
modify the CR4 execute much faster than always reading the
register itself.
The change modified cpu_init() in common.c, so that the
shadow CR4 gets initialized before anything uses it.
Unfortunately, there's two cpu_init()s in common.c. There's
one for 64-bit and one for 32-bit. The commit only added
the shadow init to the 64-bit path, but the 32-bit path
needs the init too.
Link: http://lkml.kernel.org/r/20150227125208.71c36402@gandalf.local.home Fixes: 1e02ce4cccdc "x86: Store a per-cpu shadow copy of CR4"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20150227145019.2bdd4354@gandalf.local.home
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index b5c8ff5..2346c95 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1396,6 +1396,12 @@ void cpu_init(void)
wait_for_master_cpu(cpu);
+ /*
+ * Initialize the CR4 shadow before doing anything that could
+ * try to read it.
+ */
+ cr4_init_shadow();
+
show_ucode_info_early();
printk(KERN_INFO "Initializing CPU#%d\n", cpu);
next prev parent reply other threads:[~2015-02-28 7:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 17:52 [REGRESSION][4.0-rc1] My i386 fails to do CPU hotplug Steven Rostedt
2015-02-27 18:59 ` Linus Torvalds
2015-02-27 19:50 ` [PATCH] x86: Init per-cpu shadow copy of CR4 for i386 too Steven Rostedt
2015-02-27 19:54 ` Andy Lutomirski
2015-02-27 19:59 ` Steven Rostedt
2015-02-28 7:07 ` tip-bot for Steven Rostedt [this message]
2015-02-27 19:53 ` [PATCH] x86_32: Initialize the cr4 shadow on cpu init Andy Lutomirski
2015-02-27 20:19 ` Steven Rostedt
2015-02-27 20:21 ` Andy Lutomirski
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=tip-5b2bdbc84556774afbe11bcfd24c2f6411cfa92b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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