[PATCH] x86_32: Initialize the cr4 shadow on cpu init

From: Andy Lutomirski
Date: Fri Feb 27 2015 - 14:53:53 EST


32-bit secondary cpus had uninitialized cr4 shadows, causing random
failures.

Reported-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
---

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/