aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/entry.S')
-rw-r--r--arch/x86_64/kernel/entry.S33
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
4921: incl %gs:pda_irqcount # RED-PEN should check preempt count 4861: 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 */
506ret_from_intr: 495ret_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! */
518exit_intr: 501exit_intr:
519 GET_THREAD_INFO(%rcx) 502 GET_THREAD_INFO(%rcx)
520 testl $3,CS-ARGOFFSET(%rsp) 503 testl $3,CS-ARGOFFSET(%rsp)