Commit b957591f authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Dump stack and prevent recursion on early fault

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f1290ec9
...@@ -200,14 +200,22 @@ init_rsp: ...@@ -200,14 +200,22 @@ init_rsp:
.quad init_thread_union+THREAD_SIZE-8 .quad init_thread_union+THREAD_SIZE-8
ENTRY(early_idt_handler) ENTRY(early_idt_handler)
cmpl $2,early_recursion_flag(%rip)
jz 1f
incl early_recursion_flag(%rip)
xorl %eax,%eax xorl %eax,%eax
movq 8(%rsp),%rsi # get rip movq 8(%rsp),%rsi # get rip
movq (%rsp),%rdx movq (%rsp),%rdx
movq %cr2,%rcx movq %cr2,%rcx
leaq early_idt_msg(%rip),%rdi leaq early_idt_msg(%rip),%rdi
call early_printk call early_printk
cmpl $2,early_recursion_flag(%rip)
jz 1f
call dump_stack
1: hlt 1: hlt
jmp 1b jmp 1b
early_recursion_flag:
.long 0
early_idt_msg: early_idt_msg:
.asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n" .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment