lkml.org 
[lkml]   [2015]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86_32: Initialize the cr4 shadow on cpu init
Date
32-bit secondary cpus had uninitialized cr4 shadows, causing random
failures.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---

This is embarrassing. I must have gotten lucky testing it.

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 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)

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);
--
2.1.0


\
 
 \ /
  Last update: 2015-02-27 21:01    [W:0.067 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site