2 * linux/arch/x86_64/entry.S
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs
6 * Copyright (C) 2000 Pavel Machek <pavel@suse.cz>
12 * entry.S contains the system-call and fault low-level handling routines.
14 * NOTE: This code handles signal-recognition, which happens every time
15 * after an interrupt and after each system call.
17 * Normal syscalls and interrupts don't save a full stack frame, this is
18 * only done for syscall tracing, signals or fork/exec et.al.
20 * A note on terminology:
21 * - top of stack: Architecture defined interrupt frame from SS to RIP
22 * at the top of the kernel process stack.
23 * - partial stack frame: partially saved registers upto R11.
24 * - full stack frame: Like partial stack frame, but all register saved.
27 * - schedule it carefully for the final hardware.
31 #include <linux/linkage.h>
32 #include <asm/segment.h>
34 #include <asm/cache.h>
35 #include <asm/errno.h>
36 #include <asm/dwarf2.h>
37 #include <asm/calling.h>
38 #include <asm/asm-offsets.h>
40 #include <asm/unistd.h>
41 #include <asm/thread_info.h>
42 #include <asm/hw_irq.h>
44 #include <asm/irqflags.h>
48 #ifndef CONFIG_PREEMPT
49 #define retint_kernel retint_restore_args
53 .macro TRACE_IRQS_IRETQ offset=ARGOFFSET
54 #ifdef CONFIG_TRACE_IRQFLAGS
55 bt $9,EFLAGS-\offset(%rsp) /* interrupts off? */
63 * C code is not supposed to know about undefined top of stack. Every time
64 * a C function with an pt_regs argument is called from the SYSCALL based
65 * fast path FIXUP_TOP_OF_STACK is needed.
66 * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
70 /* %rsp:at FRAMEEND */
71 .macro FIXUP_TOP_OF_STACK tmp
72 movq %gs:pda_oldrsp,\tmp
74 movq $__USER_DS,SS(%rsp)
75 movq $__USER_CS,CS(%rsp)
77 movq R11(%rsp),\tmp /* get eflags */
78 movq \tmp,EFLAGS(%rsp)
81 .macro RESTORE_TOP_OF_STACK tmp,offset=0
82 movq RSP-\offset(%rsp),\tmp
83 movq \tmp,%gs:pda_oldrsp
84 movq EFLAGS-\offset(%rsp),\tmp
85 movq \tmp,R11-\offset(%rsp)
88 .macro FAKE_STACK_FRAME child_rip
89 /* push in order ss, rsp, eflags, cs, rip */
92 CFI_ADJUST_CFA_OFFSET 8
93 /*CFI_REL_OFFSET ss,0*/
95 CFI_ADJUST_CFA_OFFSET 8
97 pushq $(1<<9) /* eflags - interrupts on */
98 CFI_ADJUST_CFA_OFFSET 8
99 /*CFI_REL_OFFSET rflags,0*/
100 pushq $__KERNEL_CS /* cs */
101 CFI_ADJUST_CFA_OFFSET 8
102 /*CFI_REL_OFFSET cs,0*/
103 pushq \child_rip /* rip */
104 CFI_ADJUST_CFA_OFFSET 8
106 pushq %rax /* orig rax */
107 CFI_ADJUST_CFA_OFFSET 8
110 .macro UNFAKE_STACK_FRAME
112 CFI_ADJUST_CFA_OFFSET -(6*8)
115 .macro CFI_DEFAULT_STACK start=1
120 CFI_DEF_CFA_OFFSET SS+8
122 CFI_REL_OFFSET r15,R15
123 CFI_REL_OFFSET r14,R14
124 CFI_REL_OFFSET r13,R13
125 CFI_REL_OFFSET r12,R12
126 CFI_REL_OFFSET rbp,RBP
127 CFI_REL_OFFSET rbx,RBX
128 CFI_REL_OFFSET r11,R11
129 CFI_REL_OFFSET r10,R10
132 CFI_REL_OFFSET rax,RAX
133 CFI_REL_OFFSET rcx,RCX
134 CFI_REL_OFFSET rdx,RDX
135 CFI_REL_OFFSET rsi,RSI
136 CFI_REL_OFFSET rdi,RDI
137 CFI_REL_OFFSET rip,RIP
138 /*CFI_REL_OFFSET cs,CS*/
139 /*CFI_REL_OFFSET rflags,EFLAGS*/
140 CFI_REL_OFFSET rsp,RSP
141 /*CFI_REL_OFFSET ss,SS*/
144 * A newly forked process directly context switches into this.
150 GET_THREAD_INFO(%rcx)
151 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
155 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread?
156 je int_ret_from_sys_call
157 testl $_TIF_IA32,threadinfo_flags(%rcx)
158 jnz int_ret_from_sys_call
159 RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
160 jmp ret_from_sys_call
163 call syscall_trace_leave
164 GET_THREAD_INFO(%rcx)
170 * System call entry. Upto 6 arguments in registers are supported.
172 * SYSCALL does not save anything on the stack and does not change the
178 * rax system call number
180 * rcx return address for syscall/sysret, C arg3
183 * r10 arg3 (--> moved to rcx for C)
186 * r11 eflags for syscall/sysret, temporary for C
187 * r12-r15,rbp,rbx saved by C code, not touched.
189 * Interrupts are off on entry.
190 * Only called from user space.
192 * XXX if we had a free scratch register we could save the RSP into the stack frame
193 * and report it properly in ps. Unfortunately we haven't.
195 * When user can change the frames always force IRET. That is because
196 * it deals with uncanonical addresses better. SYSRET has trouble
197 * with them due to bugs in both AMD and Intel CPUs.
202 CFI_DEF_CFA rsp,PDA_STACKOFFSET
204 /*CFI_REGISTER rflags,r11*/
206 movq %rsp,%gs:pda_oldrsp
207 movq %gs:pda_kernelstack,%rsp
209 * No need to follow this irqs off/on section - it's straight
214 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
215 movq %rcx,RIP-ARGOFFSET(%rsp)
216 CFI_REL_OFFSET rip,RIP-ARGOFFSET
217 GET_THREAD_INFO(%rcx)
218 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
221 cmpq $__NR_syscall_max,%rax
224 call *sys_call_table(,%rax,8) # XXX: rip relative
225 movq %rax,RAX-ARGOFFSET(%rsp)
227 * Syscall return path ending with SYSRET (fast path)
228 * Has incomplete stack frame and undefined top of stack.
230 .globl ret_from_sys_call
232 movl $_TIF_ALLWORK_MASK,%edi
235 GET_THREAD_INFO(%rcx)
238 movl threadinfo_flags(%rcx),%edx
243 * sysretq will re-enable interrupts:
246 movq RIP-ARGOFFSET(%rsp),%rcx
248 RESTORE_ARGS 0,-ARG_SKIP,1
249 /*CFI_REGISTER rflags,r11*/
250 movq %gs:pda_oldrsp,%rsp
254 /* Handle reschedules */
255 /* edx: work, edi: workmask */
258 bt $TIF_NEED_RESCHED,%edx
263 CFI_ADJUST_CFA_OFFSET 8
266 CFI_ADJUST_CFA_OFFSET -8
269 /* Handle a signal */
273 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
276 /* Really a signal */
277 /* edx: work flags (arg3) */
278 leaq do_notify_resume(%rip),%rax
279 leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
280 xorl %esi,%esi # oldset -> arg2
281 call ptregscall_common
282 1: movl $_TIF_NEED_RESCHED,%edi
283 /* Use IRET because user could have changed frame. This
284 works because ptregscall_common has called FIXUP_TOP_OF_STACK. */
290 movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
291 jmp ret_from_sys_call
293 /* Do syscall tracing */
297 movq $-ENOSYS,RAX(%rsp)
298 FIXUP_TOP_OF_STACK %rdi
300 call syscall_trace_enter
301 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
303 cmpq $__NR_syscall_max,%rax
305 movq %r10,%rcx /* fixup for C */
306 call *sys_call_table(,%rax,8)
307 1: movq %rax,RAX-ARGOFFSET(%rsp)
308 /* Use IRET because user could have changed frame */
309 jmp int_ret_from_sys_call
314 * Syscall return path ending with IRET.
315 * Has correct top of stack, but partial stack frame.
317 ENTRY(int_ret_from_sys_call)
319 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
320 /*CFI_REL_OFFSET ss,SS-ARGOFFSET*/
321 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
322 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
323 /*CFI_REL_OFFSET cs,CS-ARGOFFSET*/
324 CFI_REL_OFFSET rip,RIP-ARGOFFSET
325 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
326 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
327 CFI_REL_OFFSET rax,RAX-ARGOFFSET
328 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
329 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
330 CFI_REL_OFFSET r8,R8-ARGOFFSET
331 CFI_REL_OFFSET r9,R9-ARGOFFSET
332 CFI_REL_OFFSET r10,R10-ARGOFFSET
333 CFI_REL_OFFSET r11,R11-ARGOFFSET
336 testl $3,CS-ARGOFFSET(%rsp)
337 je retint_restore_args
338 movl $_TIF_ALLWORK_MASK,%edi
339 /* edi: mask to check */
341 GET_THREAD_INFO(%rcx)
342 movl threadinfo_flags(%rcx),%edx
345 andl $~TS_COMPAT,threadinfo_status(%rcx)
348 /* Either reschedule or signal or syscall exit tracking needed. */
349 /* First do a reschedule test. */
350 /* edx: work, edi: workmask */
352 bt $TIF_NEED_RESCHED,%edx
357 CFI_ADJUST_CFA_OFFSET 8
360 CFI_ADJUST_CFA_OFFSET -8
365 /* handle signals and tracing -- both require a full stack frame */
370 /* Check for syscall exit trace */
371 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx
374 CFI_ADJUST_CFA_OFFSET 8
375 leaq 8(%rsp),%rdi # &ptregs -> arg1
376 call syscall_trace_leave
378 CFI_ADJUST_CFA_OFFSET -8
379 andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi
385 testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
387 movq %rsp,%rdi # &ptregs -> arg1
388 xorl %esi,%esi # oldset -> arg2
389 call do_notify_resume
390 1: movl $_TIF_NEED_RESCHED,%edi
397 END(int_ret_from_sys_call)
400 * Certain special system calls that need to save a complete full stack frame.
403 .macro PTREGSCALL label,func,arg
406 leaq \func(%rip),%rax
407 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
408 jmp ptregscall_common
414 PTREGSCALL stub_clone, sys_clone, %r8
415 PTREGSCALL stub_fork, sys_fork, %rdi
416 PTREGSCALL stub_vfork, sys_vfork, %rdi
417 PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx
418 PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
419 PTREGSCALL stub_iopl, sys_iopl, %rsi
421 ENTRY(ptregscall_common)
423 CFI_ADJUST_CFA_OFFSET -8
424 CFI_REGISTER rip, r11
427 CFI_REGISTER rip, r15
428 FIXUP_TOP_OF_STACK %r11
430 RESTORE_TOP_OF_STACK %r11
432 CFI_REGISTER rip, r11
435 CFI_ADJUST_CFA_OFFSET 8
436 CFI_REL_OFFSET rip, 0
439 END(ptregscall_common)
444 CFI_ADJUST_CFA_OFFSET -8
445 CFI_REGISTER rip, r11
447 FIXUP_TOP_OF_STACK %r11
449 RESTORE_TOP_OF_STACK %r11
452 jmp int_ret_from_sys_call
457 * sigreturn is special because it needs to restore all registers on return.
458 * This cannot be done with SYSRET, so use the IRET return path instead.
460 ENTRY(stub_rt_sigreturn)
463 CFI_ADJUST_CFA_OFFSET -8
466 FIXUP_TOP_OF_STACK %r11
467 call sys_rt_sigreturn
468 movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
470 jmp int_ret_from_sys_call
472 END(stub_rt_sigreturn)
475 * initial frame state for interrupts and exceptions
479 CFI_DEF_CFA rsp,SS+8-\ref
480 /*CFI_REL_OFFSET ss,SS-\ref*/
481 CFI_REL_OFFSET rsp,RSP-\ref
482 /*CFI_REL_OFFSET rflags,EFLAGS-\ref*/
483 /*CFI_REL_OFFSET cs,CS-\ref*/
484 CFI_REL_OFFSET rip,RIP-\ref
487 /* initial frame state for interrupts (and exceptions without error code) */
488 #define INTR_FRAME _frame RIP
489 /* initial frame state for exceptions with error code (and interrupts with
490 vector already pushed) */
491 #define XCPT_FRAME _frame ORIG_RAX
494 * Interrupt entry/exit.
496 * Interrupt entry points save only callee clobbered registers in fast path.
498 * Entry runs with interrupts off.
501 /* 0(%rsp): interrupt number */
502 .macro interrupt func
505 leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
507 CFI_ADJUST_CFA_OFFSET 8
508 CFI_REL_OFFSET rbp, 0
510 CFI_DEF_CFA_REGISTER rbp
514 1: incl %gs:pda_irqcount # RED-PEN should check preempt count
515 cmoveq %gs:pda_irqstackptr,%rsp
516 push %rbp # backlink for old unwinder
518 * We entered an interrupt context - irqs are off:
524 ENTRY(common_interrupt)
527 /* 0(%rsp): oldrsp-ARGOFFSET */
531 decl %gs:pda_irqcount
533 CFI_DEF_CFA_REGISTER rsp
534 CFI_ADJUST_CFA_OFFSET -8
536 GET_THREAD_INFO(%rcx)
537 testl $3,CS-ARGOFFSET(%rsp)
540 /* Interrupt came from user space */
542 * Has a correct top of stack, but a partial stack frame
543 * %rcx: thread info. Interrupts off.
545 retint_with_reschedule:
546 movl $_TIF_WORK_MASK,%edi
548 movl threadinfo_flags(%rcx),%edx
554 * The iretq could re-enable interrupts:
564 * The iretq could re-enable interrupts:
572 .section __ex_table,"a"
573 .quad iret_label,bad_iret
576 /* force a signal here? this matches i386 behaviour */
577 /* running with kernel gs */
579 movq $11,%rdi /* SIGSEGV */
585 /* edi: workmask, edx: work */
588 bt $TIF_NEED_RESCHED,%edx
593 CFI_ADJUST_CFA_OFFSET 8
596 CFI_ADJUST_CFA_OFFSET -8
597 GET_THREAD_INFO(%rcx)
603 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
608 movq $-1,ORIG_RAX(%rsp)
609 xorl %esi,%esi # oldset
610 movq %rsp,%rdi # &pt_regs
611 call do_notify_resume
615 movl $_TIF_NEED_RESCHED,%edi
616 GET_THREAD_INFO(%rcx)
619 #ifdef CONFIG_PREEMPT
620 /* Returning to kernel space. Check if we need preemption */
621 /* rcx: threadinfo. interrupts off. */
624 cmpl $0,threadinfo_preempt_count(%rcx)
625 jnz retint_restore_args
626 bt $TIF_NEED_RESCHED,threadinfo_flags(%rcx)
627 jnc retint_restore_args
628 bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */
629 jnc retint_restore_args
630 call preempt_schedule_irq
635 END(common_interrupt)
640 .macro apicinterrupt num,func
643 CFI_ADJUST_CFA_OFFSET 8
649 ENTRY(thermal_interrupt)
650 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt
651 END(thermal_interrupt)
653 ENTRY(threshold_interrupt)
654 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt
655 END(threshold_interrupt)
658 ENTRY(reschedule_interrupt)
659 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt
660 END(reschedule_interrupt)
662 .macro INVALIDATE_ENTRY num
663 ENTRY(invalidate_interrupt\num)
664 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt
665 END(invalidate_interrupt\num)
677 ENTRY(call_function_interrupt)
678 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
679 END(call_function_interrupt)
682 #ifdef CONFIG_X86_LOCAL_APIC
683 ENTRY(apic_timer_interrupt)
684 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
685 END(apic_timer_interrupt)
687 ENTRY(error_interrupt)
688 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt
691 ENTRY(spurious_interrupt)
692 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
693 END(spurious_interrupt)
697 * Exception entry points.
701 pushq $0 /* push error code/oldrax */
702 CFI_ADJUST_CFA_OFFSET 8
703 pushq %rax /* push real oldrax to the rdi slot */
704 CFI_ADJUST_CFA_OFFSET 8
710 .macro errorentry sym
713 CFI_ADJUST_CFA_OFFSET 8
719 /* error code is on the stack already */
720 /* handle NMI like exceptions that can happen everywhere */
721 .macro paranoidentry sym, ist=0, irqtrace=1
725 movl $MSR_GS_BASE,%ecx
733 movq %gs:pda_data_offset, %rbp
736 movq ORIG_RAX(%rsp),%rsi
737 movq $-1,ORIG_RAX(%rsp)
739 subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
743 addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
752 * "Paranoid" exit path from exception stack.
753 * Paranoid because this is used by NMIs and cannot take
754 * any kernel state for granted.
755 * We don't do kernel preemption checks here, because only
756 * NMI should be common and it does not enable IRQs and
757 * cannot get reschedule ticks.
759 * "trace" is 0 for the NMI handler only, because irq-tracing
760 * is fundamentally NMI-unsafe. (we cannot change the soft and
761 * hard flags at once, atomically)
763 .macro paranoidexit trace=1
764 /* ebx: no swapgs flag */
766 testl %ebx,%ebx /* swapgs needed? */
767 jnz paranoid_restore\trace
769 jnz paranoid_userspace\trace
770 paranoid_swapgs\trace:
773 paranoid_restore\trace:
776 paranoid_userspace\trace:
777 GET_THREAD_INFO(%rcx)
778 movl threadinfo_flags(%rcx),%ebx
779 andl $_TIF_WORK_MASK,%ebx
780 jz paranoid_swapgs\trace
781 movq %rsp,%rdi /* &pt_regs */
783 movq %rax,%rsp /* switch stack for scheduling */
784 testl $_TIF_NEED_RESCHED,%ebx
785 jnz paranoid_schedule\trace
786 movl %ebx,%edx /* arg3: thread flags */
791 xorl %esi,%esi /* arg2: oldset */
792 movq %rsp,%rdi /* arg1: &pt_regs */
793 call do_notify_resume
798 jmp paranoid_userspace\trace
799 paranoid_schedule\trace:
809 jmp paranoid_userspace\trace
814 * Exception entry point. This expects an error code/orig_rax on the stack
815 * and the exception handler in %rax.
819 /* rdi slot contains rax, oldrax contains error code */
822 CFI_ADJUST_CFA_OFFSET (14*8)
824 CFI_REL_OFFSET rsi,RSI
825 movq 14*8(%rsp),%rsi /* load rax from rdi slot */
827 CFI_REL_OFFSET rdx,RDX
829 CFI_REL_OFFSET rcx,RCX
830 movq %rsi,10*8(%rsp) /* store rax */
831 CFI_REL_OFFSET rax,RAX
837 CFI_REL_OFFSET r10,R10
839 CFI_REL_OFFSET r11,R11
841 CFI_REL_OFFSET rbx,RBX
843 CFI_REL_OFFSET rbp,RBP
845 CFI_REL_OFFSET r12,R12
847 CFI_REL_OFFSET r13,R13
849 CFI_REL_OFFSET r14,R14
851 CFI_REL_OFFSET r15,R15
860 movq ORIG_RAX(%rsp),%rsi /* get error code */
861 movq $-1,ORIG_RAX(%rsp)
863 /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
869 GET_THREAD_INFO(%rcx)
872 movl threadinfo_flags(%rcx),%edx
873 movl $_TIF_WORK_MASK,%edi
877 * The iret might restore flags:
887 /* There are two places in the kernel that can potentially fault with
888 usergs. Handle them here. The exception handlers after
889 iret run with kernel gs again, so don't set the user space flag.
890 B stepping K8s sometimes report an truncated RIP for IRET
891 exceptions returning to compat mode. Check for these here too. */
892 leaq iret_label(%rip),%rbp
895 movl %ebp,%ebp /* zero extend */
898 cmpq $gs_change,RIP(%rsp)
903 /* Reload gs selector with exception handling */
904 /* edi: new selector */
908 CFI_ADJUST_CFA_OFFSET 8
913 2: mfence /* workaround */
916 CFI_ADJUST_CFA_OFFSET -8
919 ENDPROC(load_gs_index)
921 .section __ex_table,"a"
923 .quad gs_change,bad_gs
926 /* running with kernelgs */
928 swapgs /* switch back to user gs */
935 * Create a kernel thread.
937 * C extern interface:
938 * extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
940 * asm input arguments:
941 * rdi: fn, rsi: arg, rdx: flags
945 FAKE_STACK_FRAME $child_rip
948 # rdi: flags, rsi: usp, rdx: will be &pt_regs
950 orq kernel_thread_flags(%rip),%rdi
963 * It isn't worth to check for reschedule here,
964 * so internally to the x86_64 port you can rely on kernel_thread()
965 * not to reschedule the child before returning, this avoids the need
966 * of hacks for example to fork off the per-CPU idle tasks.
967 * [Hopefully no generic code relies on the reschedule -AK]
973 ENDPROC(kernel_thread)
976 pushq $0 # fake return address
979 * Here we are in the child and the registers are set as they were
980 * at kernel_thread() invocation in the parent.
992 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
994 * C extern interface:
995 * extern long execve(char *name, char **argv, char **envp)
997 * asm input arguments:
998 * rdi: name, rsi: argv, rdx: envp
1000 * We want to fallback into:
1001 * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs)
1003 * do_sys_execve asm fallback arguments:
1004 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack
1011 movq %rax, RAX(%rsp)
1014 je int_ret_from_sys_call
1021 KPROBE_ENTRY(page_fault)
1022 errorentry do_page_fault
1026 ENTRY(coprocessor_error)
1027 zeroentry do_coprocessor_error
1028 END(coprocessor_error)
1030 ENTRY(simd_coprocessor_error)
1031 zeroentry do_simd_coprocessor_error
1032 END(simd_coprocessor_error)
1034 ENTRY(device_not_available)
1035 zeroentry math_state_restore
1036 END(device_not_available)
1038 /* runs on exception stack */
1042 CFI_ADJUST_CFA_OFFSET 8
1043 paranoidentry do_debug, DEBUG_STACK
1048 /* runs on exception stack */
1052 CFI_ADJUST_CFA_OFFSET 8
1053 paranoidentry do_nmi, 0, 0
1054 #ifdef CONFIG_TRACE_IRQFLAGS
1066 CFI_ADJUST_CFA_OFFSET 8
1067 paranoidentry do_int3, DEBUG_STACK
1074 zeroentry do_overflow
1082 zeroentry do_invalid_op
1085 ENTRY(coprocessor_segment_overrun)
1086 zeroentry do_coprocessor_segment_overrun
1087 END(coprocessor_segment_overrun)
1090 zeroentry do_reserved
1093 /* runs on exception stack */
1096 paranoidentry do_double_fault
1102 errorentry do_invalid_TSS
1105 ENTRY(segment_not_present)
1106 errorentry do_segment_not_present
1107 END(segment_not_present)
1109 /* runs on exception stack */
1110 ENTRY(stack_segment)
1112 paranoidentry do_stack_segment
1117 KPROBE_ENTRY(general_protection)
1118 errorentry do_general_protection
1119 END(general_protection)
1122 ENTRY(alignment_check)
1123 errorentry do_alignment_check
1124 END(alignment_check)
1127 zeroentry do_divide_error
1130 ENTRY(spurious_interrupt_bug)
1131 zeroentry do_spurious_interrupt_bug
1132 END(spurious_interrupt_bug)
1134 #ifdef CONFIG_X86_MCE
1135 /* runs on exception stack */
1136 ENTRY(machine_check)
1139 CFI_ADJUST_CFA_OFFSET 8
1140 paranoidentry do_machine_check
1146 /* Call softirq on interrupt stack. Interrupts are off. */
1150 CFI_ADJUST_CFA_OFFSET 8
1151 CFI_REL_OFFSET rbp,0
1153 CFI_DEF_CFA_REGISTER rbp
1154 incl %gs:pda_irqcount
1155 cmove %gs:pda_irqstackptr,%rsp
1156 push %rbp # backlink for old unwinder
1159 CFI_DEF_CFA_REGISTER rsp
1160 CFI_ADJUST_CFA_OFFSET -8
1161 decl %gs:pda_irqcount
1164 ENDPROC(call_softirq)
1166 #ifdef CONFIG_STACK_UNWIND
1167 ENTRY(arch_unwind_init_running)
1169 movq %r15, R15(%rdi)
1170 movq %r14, R14(%rdi)
1172 movq %r13, R13(%rdi)
1173 movq %r12, R12(%rdi)
1175 movq %rbp, RBP(%rdi)
1176 movq %rbx, RBX(%rdi)
1178 movq %rax, R11(%rdi)
1179 movq %rax, R10(%rdi)
1182 movq %rax, RAX(%rdi)
1183 movq %rax, RCX(%rdi)
1184 movq %rax, RDX(%rdi)
1185 movq %rax, RSI(%rdi)
1186 movq %rax, RDI(%rdi)
1187 movq %rax, ORIG_RAX(%rdi)
1188 movq %rcx, RIP(%rdi)
1190 movq $__KERNEL_CS, CS(%rdi)
1191 movq %rax, EFLAGS(%rdi)
1192 movq %rcx, RSP(%rdi)
1193 movq $__KERNEL_DS, SS(%rdi)
1196 ENDPROC(arch_unwind_init_running)