summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/head64.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 01:09:51 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 01:09:51 +0400
commitac630dd98a47b60b27d716758d5f4276cb974662 (patch)
tree55e8d5f26c99523c6ebaa8e5059cf678c848fb25 /arch/x86/kernel/head64.c
parent2ef14f465b9e096531343f5b734cffc5f759f4a6 (diff)
downloadlinux-ac630dd98a47b60b27d716758d5f4276cb974662.tar.xz
x86-64: don't set the early IDT to point directly to 'early_idt_handler'
The code requires the use of the proper per-exception-vector stub functions (set up as the early_idt_handlers[] array - note the 's') that make sure to set up the error vector number. This is true regardless of whether CONFIG_EARLY_PRINTK is set or not. Why? The stack offset for the comparison of __KERNEL_CS won't be right otherwise, nor will the new check (from commit 8170e6bed465: "x86, 64bit: Use a #PF handler to materialize early mappings on demand") for the page fault exception vector. Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/kernel/head64.c')
-rw-r--r--arch/x86/kernel/head64.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 57334f4cd3af..2590025e52c2 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -159,13 +159,8 @@ void __init x86_64_start_kernel(char * real_mode_data)
/* clear bss before set_intr_gate with early_idt_handler */
clear_bss();
- for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
-#ifdef CONFIG_EARLY_PRINTK
+ for (i = 0; i < NUM_EXCEPTION_VECTORS; i++)
set_intr_gate(i, &early_idt_handlers[i]);
-#else
- set_intr_gate(i, early_idt_handler);
-#endif
- }
load_idt((const struct desc_ptr *)&idt_descr);
copy_bootdata(__va(real_mode_data));