Skip to content

Commit

Permalink
[PATCH] x86_64: Dump stack and prevent recursion on early fault
Browse files Browse the repository at this point in the history
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Apr 16, 2005
1 parent f1290ec commit b957591
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/x86_64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,22 @@ init_rsp:
.quad init_thread_union+THREAD_SIZE-8

ENTRY(early_idt_handler)
cmpl $2,early_recursion_flag(%rip)
jz 1f
incl early_recursion_flag(%rip)
xorl %eax,%eax
movq 8(%rsp),%rsi # get rip
movq (%rsp),%rdx
movq %cr2,%rcx
leaq early_idt_msg(%rip),%rdi
call early_printk
cmpl $2,early_recursion_flag(%rip)
jz 1f
call dump_stack
1: hlt
jmp 1b
early_recursion_flag:
.long 0

early_idt_msg:
.asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"
Expand Down

0 comments on commit b957591

Please sign in to comment.