diff options
| author | Steven Rostedt <rostedt@goodmis.org> | 2015-02-27 14:50:19 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-02-28 02:04:20 -0500 |
| commit | 5b2bdbc84556774afbe11bcfd24c2f6411cfa92b (patch) | |
| tree | 369e31c445106e3946788d8e20961a077204cf05 /arch/x86/kernel | |
| parent | 5838d18955b52467f4b30486e62a31727b39998d (diff) | |
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>
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index b5c8ff5e9dfc..2346c95c6ab1 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -1396,6 +1396,12 @@ void cpu_init(void) | |||
| 1396 | 1396 | ||
| 1397 | wait_for_master_cpu(cpu); | 1397 | wait_for_master_cpu(cpu); |
| 1398 | 1398 | ||
| 1399 | /* | ||
| 1400 | * Initialize the CR4 shadow before doing anything that could | ||
| 1401 | * try to read it. | ||
| 1402 | */ | ||
| 1403 | cr4_init_shadow(); | ||
| 1404 | |||
| 1399 | show_ucode_info_early(); | 1405 | show_ucode_info_early(); |
| 1400 | 1406 | ||
| 1401 | printk(KERN_INFO "Initializing CPU#%d\n", cpu); | 1407 | printk(KERN_INFO "Initializing CPU#%d\n", cpu); |
