aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-04-16 18:25:00 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:25:00 -0400
commitb957591fee753101f289615abab1c54ff7b1d29d (patch)
tree369eccf7e24a263627977dd7a0986e779449c30d
parentf1290ec93e5da4a748ca4758a00b580283e06596 (diff)
[PATCH] x86_64: Dump stack and prevent recursion on early fault
Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/head.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index b6d8725c1f61..9bd2e7a4b81e 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -200,14 +200,22 @@ init_rsp:
200 .quad init_thread_union+THREAD_SIZE-8 200 .quad init_thread_union+THREAD_SIZE-8
201 201
202ENTRY(early_idt_handler) 202ENTRY(early_idt_handler)
203 cmpl $2,early_recursion_flag(%rip)
204 jz 1f
205 incl early_recursion_flag(%rip)
203 xorl %eax,%eax 206 xorl %eax,%eax
204 movq 8(%rsp),%rsi # get rip 207 movq 8(%rsp),%rsi # get rip
205 movq (%rsp),%rdx 208 movq (%rsp),%rdx
206 movq %cr2,%rcx 209 movq %cr2,%rcx
207 leaq early_idt_msg(%rip),%rdi 210 leaq early_idt_msg(%rip),%rdi
208 call early_printk 211 call early_printk
212 cmpl $2,early_recursion_flag(%rip)
213 jz 1f
214 call dump_stack
2091: hlt 2151: hlt
210 jmp 1b 216 jmp 1b
217early_recursion_flag:
218 .long 0
211 219
212early_idt_msg: 220early_idt_msg:
213 .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n" 221 .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"