提交 1de9c3f6 编写于 作者: J Jan Beulich 提交者: Linus Torvalds

[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: NJan Beulich <jbeulich@novell.com>
Signed-off-by: NAndi Kleen <ak@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b538ed27
...@@ -473,29 +473,18 @@ END(stub_rt_sigreturn) ...@@ -473,29 +473,18 @@ END(stub_rt_sigreturn)
/* 0(%rsp): interrupt number */ /* 0(%rsp): interrupt number */
.macro interrupt func .macro interrupt func
cld cld
#ifdef CONFIG_DEBUG_INFO
SAVE_ALL
movq %rsp,%rdi
/*
* Setup a stack frame pointer. This allows gdb to trace
* back to the original stack.
*/
movq %rsp,%rbp
CFI_DEF_CFA_REGISTER rbp
#else
SAVE_ARGS SAVE_ARGS
leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
#endif pushq %rbp
CFI_ADJUST_CFA_OFFSET 8
CFI_REL_OFFSET rbp, 0
movq %rsp,%rbp
CFI_DEF_CFA_REGISTER rbp
testl $3,CS(%rdi) testl $3,CS(%rdi)
je 1f je 1f
swapgs swapgs
1: incl %gs:pda_irqcount # RED-PEN should check preempt count 1: incl %gs:pda_irqcount # RED-PEN should check preempt count
movq %gs:pda_irqstackptr,%rax cmoveq %gs:pda_irqstackptr,%rsp
cmoveq %rax,%rsp /*todo This needs CFI annotation! */
pushq %rdi # save old stack
#ifndef CONFIG_DEBUG_INFO
CFI_ADJUST_CFA_OFFSET 8
#endif
call \func call \func
.endm .endm
...@@ -504,17 +493,11 @@ ENTRY(common_interrupt) ...@@ -504,17 +493,11 @@ ENTRY(common_interrupt)
interrupt do_IRQ interrupt do_IRQ
/* 0(%rsp): oldrsp-ARGOFFSET */ /* 0(%rsp): oldrsp-ARGOFFSET */
ret_from_intr: ret_from_intr:
popq %rdi
#ifndef CONFIG_DEBUG_INFO
CFI_ADJUST_CFA_OFFSET -8
#endif
cli cli
decl %gs:pda_irqcount decl %gs:pda_irqcount
#ifdef CONFIG_DEBUG_INFO leaveq
movq RBP(%rdi),%rbp
CFI_DEF_CFA_REGISTER rsp CFI_DEF_CFA_REGISTER rsp
#endif CFI_ADJUST_CFA_OFFSET -8
leaq ARGOFFSET(%rdi),%rsp /*todo This needs CFI annotation! */
exit_intr: exit_intr:
GET_THREAD_INFO(%rcx) GET_THREAD_INFO(%rcx)
testl $3,CS-ARGOFFSET(%rsp) testl $3,CS-ARGOFFSET(%rsp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册