diff options
author | Jan Beulich <jbeulich@novell.com> | 2006-06-26 07:57:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 13:48:17 -0400 |
commit | 1de9c3f67ec6fddfb85325bab551f4094f55f410 (patch) | |
tree | c3d469e9ea995a12e4ae299b27c9e747d3eaa3ac /arch/x86_64/kernel/entry.S | |
parent | b538ed278b80641ee6d7b75497d5e14de1bb1137 (diff) |
[PATCH] x86_64: reliable stack trace support (x86-64 IRQ stack
Change the switching to/from the IRQ stack so that unwind annotations can
be added for it without requiring CFA expressions.
AK: I cleaned it up a bit, making it unconditional and removing the
obsolete DEBUG_INFO full frame code.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/entry.S')
-rw-r--r-- | arch/x86_64/kernel/entry.S | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 6c68beec51b3..4f407ef6b865 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -473,29 +473,18 @@ END(stub_rt_sigreturn) | |||
473 | /* 0(%rsp): interrupt number */ | 473 | /* 0(%rsp): interrupt number */ |
474 | .macro interrupt func | 474 | .macro interrupt func |
475 | cld | 475 | cld |
476 | #ifdef CONFIG_DEBUG_INFO | ||
477 | SAVE_ALL | ||
478 | movq %rsp,%rdi | ||
479 | /* | ||
480 | * Setup a stack frame pointer. This allows gdb to trace | ||
481 | * back to the original stack. | ||
482 | */ | ||
483 | movq %rsp,%rbp | ||
484 | CFI_DEF_CFA_REGISTER rbp | ||
485 | #else | ||
486 | SAVE_ARGS | 476 | SAVE_ARGS |
487 | leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler | 477 | leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler |
488 | #endif | 478 | pushq %rbp |
479 | CFI_ADJUST_CFA_OFFSET 8 | ||
480 | CFI_REL_OFFSET rbp, 0 | ||
481 | movq %rsp,%rbp | ||
482 | CFI_DEF_CFA_REGISTER rbp | ||
489 | testl $3,CS(%rdi) | 483 | testl $3,CS(%rdi) |
490 | je 1f | 484 | je 1f |
491 | swapgs | 485 | swapgs |
492 | 1: incl %gs:pda_irqcount # RED-PEN should check preempt count | 486 | 1: incl %gs:pda_irqcount # RED-PEN should check preempt count |
493 | movq %gs:pda_irqstackptr,%rax | 487 | cmoveq %gs:pda_irqstackptr,%rsp |
494 | cmoveq %rax,%rsp /*todo This needs CFI annotation! */ | ||
495 | pushq %rdi # save old stack | ||
496 | #ifndef CONFIG_DEBUG_INFO | ||
497 | CFI_ADJUST_CFA_OFFSET 8 | ||
498 | #endif | ||
499 | call \func | 488 | call \func |
500 | .endm | 489 | .endm |
501 | 490 | ||
@@ -504,17 +493,11 @@ ENTRY(common_interrupt) | |||
504 | interrupt do_IRQ | 493 | interrupt do_IRQ |
505 | /* 0(%rsp): oldrsp-ARGOFFSET */ | 494 | /* 0(%rsp): oldrsp-ARGOFFSET */ |
506 | ret_from_intr: | 495 | ret_from_intr: |
507 | popq %rdi | ||
508 | #ifndef CONFIG_DEBUG_INFO | ||
509 | CFI_ADJUST_CFA_OFFSET -8 | ||
510 | #endif | ||
511 | cli | 496 | cli |
512 | decl %gs:pda_irqcount | 497 | decl %gs:pda_irqcount |
513 | #ifdef CONFIG_DEBUG_INFO | 498 | leaveq |
514 | movq RBP(%rdi),%rbp | ||
515 | CFI_DEF_CFA_REGISTER rsp | 499 | CFI_DEF_CFA_REGISTER rsp |
516 | #endif | 500 | CFI_ADJUST_CFA_OFFSET -8 |
517 | leaq ARGOFFSET(%rdi),%rsp /*todo This needs CFI annotation! */ | ||
518 | exit_intr: | 501 | exit_intr: |
519 | GET_THREAD_INFO(%rcx) | 502 | GET_THREAD_INFO(%rcx) |
520 | testl $3,CS-ARGOFFSET(%rsp) | 503 | testl $3,CS-ARGOFFSET(%rsp) |