aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-08-02 16:37:28 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-02 23:19:54 -0400
commit2699500b31f41fc25656c42548c8a388c8a329fe (patch)
tree6f7ccd0318b9e53394cb276819f2d358ce933afa /arch
parentae74c3b69a08e1de20cb681ec959f3a48af0006a (diff)
[PATCH] x86_64: Fix backtracing for interrupt stacks
Re-add backlink for old style unwinder to stack switching. Add proper stack frame and CFI annotations to call_softirq This prevents a oops when backtracing with fallback through the interrupt stack top. Suggested by Jan Beulich and Herbert Xu wanted it in 2.6.18. Cc: jbeulich@novell.com Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/entry.S18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index d464dded68c0..6f810424df44 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -513,6 +513,7 @@ END(stub_rt_sigreturn)
513 swapgs 513 swapgs
5141: incl %gs:pda_irqcount # RED-PEN should check preempt count 5141: incl %gs:pda_irqcount # RED-PEN should check preempt count
515 cmoveq %gs:pda_irqstackptr,%rsp 515 cmoveq %gs:pda_irqstackptr,%rsp
516 push %rbp # backlink for old unwinder
516 /* 517 /*
517 * We entered an interrupt context - irqs are off: 518 * We entered an interrupt context - irqs are off:
518 */ 519 */
@@ -1139,18 +1140,21 @@ ENTRY(machine_check)
1139END(machine_check) 1140END(machine_check)
1140#endif 1141#endif
1141 1142
1143/* Call softirq on interrupt stack. Interrupts are off. */
1142ENTRY(call_softirq) 1144ENTRY(call_softirq)
1143 CFI_STARTPROC 1145 CFI_STARTPROC
1144 movq %gs:pda_irqstackptr,%rax 1146 push %rbp
1145 movq %rsp,%rdx 1147 CFI_ADJUST_CFA_OFFSET 8
1146 CFI_DEF_CFA_REGISTER rdx 1148 CFI_REL_OFFSET rbp,0
1149 mov %rsp,%rbp
1150 CFI_DEF_CFA_REGISTER rbp
1147 incl %gs:pda_irqcount 1151 incl %gs:pda_irqcount
1148 cmove %rax,%rsp 1152 cmove %gs:pda_irqstackptr,%rsp
1149 pushq %rdx 1153 push %rbp # backlink for old unwinder
1150 /*todo CFI_DEF_CFA_EXPRESSION ...*/
1151 call __do_softirq 1154 call __do_softirq
1152 popq %rsp 1155 leaveq
1153 CFI_DEF_CFA_REGISTER rsp 1156 CFI_DEF_CFA_REGISTER rsp
1157 CFI_ADJUST_CFA_OFFSET -8
1154 decl %gs:pda_irqcount 1158 decl %gs:pda_irqcount
1155 ret 1159 ret
1156 CFI_ENDPROC 1160 CFI_ENDPROC