mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 07:42:07 +00:00
[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>
This commit is contained in:
parent
ae74c3b69a
commit
2699500b31
@ -513,6 +513,7 @@ END(stub_rt_sigreturn)
|
|||||||
swapgs
|
swapgs
|
||||||
1: incl %gs:pda_irqcount # RED-PEN should check preempt count
|
1: incl %gs:pda_irqcount # RED-PEN should check preempt count
|
||||||
cmoveq %gs:pda_irqstackptr,%rsp
|
cmoveq %gs:pda_irqstackptr,%rsp
|
||||||
|
push %rbp # backlink for old unwinder
|
||||||
/*
|
/*
|
||||||
* We entered an interrupt context - irqs are off:
|
* We entered an interrupt context - irqs are off:
|
||||||
*/
|
*/
|
||||||
@ -1139,18 +1140,21 @@ ENTRY(machine_check)
|
|||||||
END(machine_check)
|
END(machine_check)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Call softirq on interrupt stack. Interrupts are off. */
|
||||||
ENTRY(call_softirq)
|
ENTRY(call_softirq)
|
||||||
CFI_STARTPROC
|
CFI_STARTPROC
|
||||||
movq %gs:pda_irqstackptr,%rax
|
push %rbp
|
||||||
movq %rsp,%rdx
|
CFI_ADJUST_CFA_OFFSET 8
|
||||||
CFI_DEF_CFA_REGISTER rdx
|
CFI_REL_OFFSET rbp,0
|
||||||
|
mov %rsp,%rbp
|
||||||
|
CFI_DEF_CFA_REGISTER rbp
|
||||||
incl %gs:pda_irqcount
|
incl %gs:pda_irqcount
|
||||||
cmove %rax,%rsp
|
cmove %gs:pda_irqstackptr,%rsp
|
||||||
pushq %rdx
|
push %rbp # backlink for old unwinder
|
||||||
/*todo CFI_DEF_CFA_EXPRESSION ...*/
|
|
||||||
call __do_softirq
|
call __do_softirq
|
||||||
popq %rsp
|
leaveq
|
||||||
CFI_DEF_CFA_REGISTER rsp
|
CFI_DEF_CFA_REGISTER rsp
|
||||||
|
CFI_ADJUST_CFA_OFFSET -8
|
||||||
decl %gs:pda_irqcount
|
decl %gs:pda_irqcount
|
||||||
ret
|
ret
|
||||||
CFI_ENDPROC
|
CFI_ENDPROC
|
||||||
|
Loading…
Reference in New Issue
Block a user