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/config.h>
32 #include <linux/linkage.h>
33 #include <asm/segment.h>
35 #include <asm/cache.h>
36 #include <asm/errno.h>
37 #include <asm/dwarf2.h>
38 #include <asm/calling.h>
39 #include <asm/asm-offsets.h>
41 #include <asm/unistd.h>
42 #include <asm/thread_info.h>
43 #include <asm/hw_irq.h>
48 #ifndef CONFIG_PREEMPT
49 #define retint_kernel retint_restore_args
53 * C code is not supposed to know about undefined top of stack. Every time
54 * a C function with an pt_regs argument is called from the SYSCALL based
55 * fast path FIXUP_TOP_OF_STACK is needed.
56 * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
60 /* %rsp:at FRAMEEND */
61 .macro FIXUP_TOP_OF_STACK tmp
62 movq %gs:pda_oldrsp,\tmp
64 movq $__USER_DS,SS(%rsp)
65 movq $__USER_CS,CS(%rsp)
67 movq R11(%rsp),\tmp /* get eflags */
68 movq \tmp,EFLAGS(%rsp)
71 .macro RESTORE_TOP_OF_STACK tmp,offset=0
72 movq RSP-\offset(%rsp),\tmp
73 movq \tmp,%gs:pda_oldrsp
74 movq EFLAGS-\offset(%rsp),\tmp
75 movq \tmp,R11-\offset(%rsp)
78 .macro FAKE_STACK_FRAME child_rip
79 /* push in order ss, rsp, eflags, cs, rip */
82 CFI_ADJUST_CFA_OFFSET 8
83 /*CFI_REL_OFFSET ss,0*/
85 CFI_ADJUST_CFA_OFFSET 8
87 pushq $(1<<9) /* eflags - interrupts on */
88 CFI_ADJUST_CFA_OFFSET 8
89 /*CFI_REL_OFFSET rflags,0*/
90 pushq $__KERNEL_CS /* cs */
91 CFI_ADJUST_CFA_OFFSET 8
92 /*CFI_REL_OFFSET cs,0*/
93 pushq \child_rip /* rip */
94 CFI_ADJUST_CFA_OFFSET 8
96 pushq %rax /* orig rax */
97 CFI_ADJUST_CFA_OFFSET 8
100 .macro UNFAKE_STACK_FRAME
102 CFI_ADJUST_CFA_OFFSET -(6*8)
105 .macro CFI_DEFAULT_STACK start=1
110 CFI_DEF_CFA_OFFSET SS+8
112 CFI_REL_OFFSET r15,R15
113 CFI_REL_OFFSET r14,R14
114 CFI_REL_OFFSET r13,R13
115 CFI_REL_OFFSET r12,R12
116 CFI_REL_OFFSET rbp,RBP
117 CFI_REL_OFFSET rbx,RBX
118 CFI_REL_OFFSET r11,R11
119 CFI_REL_OFFSET r10,R10
122 CFI_REL_OFFSET rax,RAX
123 CFI_REL_OFFSET rcx,RCX
124 CFI_REL_OFFSET rdx,RDX
125 CFI_REL_OFFSET rsi,RSI
126 CFI_REL_OFFSET rdi,RDI
127 CFI_REL_OFFSET rip,RIP
128 /*CFI_REL_OFFSET cs,CS*/
129 /*CFI_REL_OFFSET rflags,EFLAGS*/
130 CFI_REL_OFFSET rsp,RSP
131 /*CFI_REL_OFFSET ss,SS*/
134 * A newly forked process directly context switches into this.
140 GET_THREAD_INFO(%rcx)
141 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
145 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread?
146 je int_ret_from_sys_call
147 testl $_TIF_IA32,threadinfo_flags(%rcx)
148 jnz int_ret_from_sys_call
149 RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
150 jmp ret_from_sys_call
153 call syscall_trace_leave
154 GET_THREAD_INFO(%rcx)
159 * System call entry. Upto 6 arguments in registers are supported.
161 * SYSCALL does not save anything on the stack and does not change the
167 * rax system call number
169 * rcx return address for syscall/sysret, C arg3
172 * r10 arg3 (--> moved to rcx for C)
175 * r11 eflags for syscall/sysret, temporary for C
176 * r12-r15,rbp,rbx saved by C code, not touched.
178 * Interrupts are off on entry.
179 * Only called from user space.
181 * XXX if we had a free scratch register we could save the RSP into the stack frame
182 * and report it properly in ps. Unfortunately we haven't.
189 /*CFI_REGISTER rflags,r11*/
191 movq %rsp,%gs:pda_oldrsp
192 movq %gs:pda_kernelstack,%rsp
195 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
196 movq %rcx,RIP-ARGOFFSET(%rsp)
197 CFI_REL_OFFSET rip,RIP-ARGOFFSET
198 GET_THREAD_INFO(%rcx)
199 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
202 cmpq $__NR_syscall_max,%rax
205 call *sys_call_table(,%rax,8) # XXX: rip relative
206 movq %rax,RAX-ARGOFFSET(%rsp)
208 * Syscall return path ending with SYSRET (fast path)
209 * Has incomplete stack frame and undefined top of stack.
211 .globl ret_from_sys_call
213 movl $_TIF_ALLWORK_MASK,%edi
216 GET_THREAD_INFO(%rcx)
218 movl threadinfo_flags(%rcx),%edx
222 movq RIP-ARGOFFSET(%rsp),%rcx
224 RESTORE_ARGS 0,-ARG_SKIP,1
225 /*CFI_REGISTER rflags,r11*/
226 movq %gs:pda_oldrsp,%rsp
230 /* Handle reschedules */
231 /* edx: work, edi: workmask */
234 bt $TIF_NEED_RESCHED,%edx
238 CFI_ADJUST_CFA_OFFSET 8
241 CFI_ADJUST_CFA_OFFSET -8
244 /* Handle a signal */
247 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
250 /* Really a signal */
251 /* edx: work flags (arg3) */
252 leaq do_notify_resume(%rip),%rax
253 leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
254 xorl %esi,%esi # oldset -> arg2
255 call ptregscall_common
256 1: movl $_TIF_NEED_RESCHED,%edi
260 movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
261 jmp ret_from_sys_call
263 /* Do syscall tracing */
267 movq $-ENOSYS,RAX(%rsp)
268 FIXUP_TOP_OF_STACK %rdi
270 call syscall_trace_enter
271 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
273 cmpq $__NR_syscall_max,%rax
275 movq %r10,%rcx /* fixup for C */
276 call *sys_call_table(,%rax,8)
277 movq %rax,RAX-ARGOFFSET(%rsp)
280 call syscall_trace_leave
281 RESTORE_TOP_OF_STACK %rbx
283 jmp ret_from_sys_call
287 * Syscall return path ending with IRET.
288 * Has correct top of stack, but partial stack frame.
290 ENTRY(int_ret_from_sys_call)
292 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
293 /*CFI_REL_OFFSET ss,SS-ARGOFFSET*/
294 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
295 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
296 /*CFI_REL_OFFSET cs,CS-ARGOFFSET*/
297 CFI_REL_OFFSET rip,RIP-ARGOFFSET
298 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
299 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
300 CFI_REL_OFFSET rax,RAX-ARGOFFSET
301 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
302 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
303 CFI_REL_OFFSET r8,R8-ARGOFFSET
304 CFI_REL_OFFSET r9,R9-ARGOFFSET
305 CFI_REL_OFFSET r10,R10-ARGOFFSET
306 CFI_REL_OFFSET r11,R11-ARGOFFSET
308 testl $3,CS-ARGOFFSET(%rsp)
309 je retint_restore_args
310 movl $_TIF_ALLWORK_MASK,%edi
311 /* edi: mask to check */
313 GET_THREAD_INFO(%rcx)
314 movl threadinfo_flags(%rcx),%edx
317 andl $~TS_COMPAT,threadinfo_status(%rcx)
320 /* Either reschedule or signal or syscall exit tracking needed. */
321 /* First do a reschedule test. */
322 /* edx: work, edi: workmask */
324 bt $TIF_NEED_RESCHED,%edx
328 CFI_ADJUST_CFA_OFFSET 8
331 CFI_ADJUST_CFA_OFFSET -8
335 /* handle signals and tracing -- both require a full stack frame */
339 /* Check for syscall exit trace */
340 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx
343 CFI_ADJUST_CFA_OFFSET 8
344 leaq 8(%rsp),%rdi # &ptregs -> arg1
345 call syscall_trace_leave
347 CFI_ADJUST_CFA_OFFSET -8
348 andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi
353 testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
355 movq %rsp,%rdi # &ptregs -> arg1
356 xorl %esi,%esi # oldset -> arg2
357 call do_notify_resume
358 1: movl $_TIF_NEED_RESCHED,%edi
366 * Certain special system calls that need to save a complete full stack frame.
369 .macro PTREGSCALL label,func,arg
372 leaq \func(%rip),%rax
373 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
374 jmp ptregscall_common
379 PTREGSCALL stub_clone, sys_clone, %r8
380 PTREGSCALL stub_fork, sys_fork, %rdi
381 PTREGSCALL stub_vfork, sys_vfork, %rdi
382 PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx
383 PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
384 PTREGSCALL stub_iopl, sys_iopl, %rsi
386 ENTRY(ptregscall_common)
388 CFI_ADJUST_CFA_OFFSET -8
389 CFI_REGISTER rip, r11
392 CFI_REGISTER rip, r15
393 FIXUP_TOP_OF_STACK %r11
395 RESTORE_TOP_OF_STACK %r11
397 CFI_REGISTER rip, r11
400 CFI_ADJUST_CFA_OFFSET 8
401 CFI_REL_OFFSET rip, 0
408 CFI_ADJUST_CFA_OFFSET -8
409 CFI_REGISTER rip, r11
412 CFI_REGISTER rip, r15
413 FIXUP_TOP_OF_STACK %r11
415 GET_THREAD_INFO(%rcx)
416 bt $TIF_IA32,threadinfo_flags(%rcx)
419 RESTORE_TOP_OF_STACK %r11
421 CFI_REGISTER rip, r11
424 CFI_ADJUST_CFA_OFFSET 8
425 CFI_REL_OFFSET rip, 0
432 jmp int_ret_from_sys_call
436 * sigreturn is special because it needs to restore all registers on return.
437 * This cannot be done with SYSRET, so use the IRET return path instead.
439 ENTRY(stub_rt_sigreturn)
442 CFI_ADJUST_CFA_OFFSET -8
445 FIXUP_TOP_OF_STACK %r11
446 call sys_rt_sigreturn
447 movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
449 jmp int_ret_from_sys_call
453 * initial frame state for interrupts and exceptions
457 CFI_DEF_CFA rsp,SS+8-\ref
458 /*CFI_REL_OFFSET ss,SS-\ref*/
459 CFI_REL_OFFSET rsp,RSP-\ref
460 /*CFI_REL_OFFSET rflags,EFLAGS-\ref*/
461 /*CFI_REL_OFFSET cs,CS-\ref*/
462 CFI_REL_OFFSET rip,RIP-\ref
465 /* initial frame state for interrupts (and exceptions without error code) */
466 #define INTR_FRAME _frame RIP
467 /* initial frame state for exceptions with error code (and interrupts with
468 vector already pushed) */
469 #define XCPT_FRAME _frame ORIG_RAX
472 * Interrupt entry/exit.
474 * Interrupt entry points save only callee clobbered registers in fast path.
476 * Entry runs with interrupts off.
479 /* 0(%rsp): interrupt number */
480 .macro interrupt func
482 #ifdef CONFIG_DEBUG_INFO
486 * Setup a stack frame pointer. This allows gdb to trace
487 * back to the original stack.
490 CFI_DEF_CFA_REGISTER rbp
493 leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
498 1: incl %gs:pda_irqcount # RED-PEN should check preempt count
499 movq %gs:pda_irqstackptr,%rax
500 cmoveq %rax,%rsp /*todo This needs CFI annotation! */
501 pushq %rdi # save old stack
502 CFI_ADJUST_CFA_OFFSET 8
506 ENTRY(common_interrupt)
509 /* 0(%rsp): oldrsp-ARGOFFSET */
512 CFI_ADJUST_CFA_OFFSET -8
514 decl %gs:pda_irqcount
515 #ifdef CONFIG_DEBUG_INFO
517 CFI_DEF_CFA_REGISTER rsp
519 leaq ARGOFFSET(%rdi),%rsp /*todo This needs CFI annotation! */
521 GET_THREAD_INFO(%rcx)
522 testl $3,CS-ARGOFFSET(%rsp)
525 /* Interrupt came from user space */
527 * Has a correct top of stack, but a partial stack frame
528 * %rcx: thread info. Interrupts off.
530 retint_with_reschedule:
531 movl $_TIF_WORK_MASK,%edi
533 movl threadinfo_flags(%rcx),%edx
545 .section __ex_table,"a"
546 .quad iret_label,bad_iret
549 /* force a signal here? this matches i386 behaviour */
550 /* running with kernel gs */
552 movq $-9999,%rdi /* better code? */
556 /* edi: workmask, edx: work */
559 bt $TIF_NEED_RESCHED,%edx
563 CFI_ADJUST_CFA_OFFSET 8
566 CFI_ADJUST_CFA_OFFSET -8
567 GET_THREAD_INFO(%rcx)
572 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
576 movq $-1,ORIG_RAX(%rsp)
577 xorl %esi,%esi # oldset
578 movq %rsp,%rdi # &pt_regs
579 call do_notify_resume
582 movl $_TIF_NEED_RESCHED,%edi
583 GET_THREAD_INFO(%rcx)
586 #ifdef CONFIG_PREEMPT
587 /* Returning to kernel space. Check if we need preemption */
588 /* rcx: threadinfo. interrupts off. */
591 cmpl $0,threadinfo_preempt_count(%rcx)
592 jnz retint_restore_args
593 bt $TIF_NEED_RESCHED,threadinfo_flags(%rcx)
594 jnc retint_restore_args
595 bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */
596 jnc retint_restore_args
597 call preempt_schedule_irq
605 .macro apicinterrupt num,func
608 CFI_ADJUST_CFA_OFFSET 8
614 ENTRY(thermal_interrupt)
615 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt
617 ENTRY(threshold_interrupt)
618 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt
621 ENTRY(reschedule_interrupt)
622 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt
624 .macro INVALIDATE_ENTRY num
625 ENTRY(invalidate_interrupt\num)
626 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt
638 ENTRY(call_function_interrupt)
639 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
642 #ifdef CONFIG_X86_LOCAL_APIC
643 ENTRY(apic_timer_interrupt)
644 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
646 ENTRY(error_interrupt)
647 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt
649 ENTRY(spurious_interrupt)
650 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
654 * Exception entry points.
658 pushq $0 /* push error code/oldrax */
659 CFI_ADJUST_CFA_OFFSET 8
660 pushq %rax /* push real oldrax to the rdi slot */
661 CFI_ADJUST_CFA_OFFSET 8
667 .macro errorentry sym
670 CFI_ADJUST_CFA_OFFSET 8
676 /* error code is on the stack already */
677 /* handle NMI like exceptions that can happen everywhere */
678 .macro paranoidentry sym, ist=0
682 movl $MSR_GS_BASE,%ecx
690 movq %gs:pda_data_offset, %rbp
693 movq ORIG_RAX(%rsp),%rsi
694 movq $-1,ORIG_RAX(%rsp)
696 subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
700 addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
706 * Exception entry point. This expects an error code/orig_rax on the stack
707 * and the exception handler in %rax.
711 /* rdi slot contains rax, oldrax contains error code */
714 CFI_ADJUST_CFA_OFFSET (14*8)
716 CFI_REL_OFFSET rsi,RSI
717 movq 14*8(%rsp),%rsi /* load rax from rdi slot */
719 CFI_REL_OFFSET rdx,RDX
721 CFI_REL_OFFSET rcx,RCX
722 movq %rsi,10*8(%rsp) /* store rax */
723 CFI_REL_OFFSET rax,RAX
729 CFI_REL_OFFSET r10,R10
731 CFI_REL_OFFSET r11,R11
733 CFI_REL_OFFSET rbx,RBX
735 CFI_REL_OFFSET rbp,RBP
737 CFI_REL_OFFSET r12,R12
739 CFI_REL_OFFSET r13,R13
741 CFI_REL_OFFSET r14,R14
743 CFI_REL_OFFSET r15,R15
752 movq ORIG_RAX(%rsp),%rsi /* get error code */
753 movq $-1,ORIG_RAX(%rsp)
755 /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
760 GET_THREAD_INFO(%rcx)
763 movl threadinfo_flags(%rcx),%edx
764 movl $_TIF_WORK_MASK,%edi
774 /* There are two places in the kernel that can potentially fault with
775 usergs. Handle them here. The exception handlers after
776 iret run with kernel gs again, so don't set the user space flag.
777 B stepping K8s sometimes report an truncated RIP for IRET
778 exceptions returning to compat mode. Check for these here too. */
779 leaq iret_label(%rip),%rbp
782 movl %ebp,%ebp /* zero extend */
785 cmpq $gs_change,RIP(%rsp)
789 /* Reload gs selector with exception handling */
790 /* edi: new selector */
794 CFI_ADJUST_CFA_OFFSET 8
799 2: mfence /* workaround */
802 CFI_ADJUST_CFA_OFFSET -8
806 .section __ex_table,"a"
808 .quad gs_change,bad_gs
811 /* running with kernelgs */
813 swapgs /* switch back to user gs */
820 * Create a kernel thread.
822 * C extern interface:
823 * extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
825 * asm input arguments:
826 * rdi: fn, rsi: arg, rdx: flags
830 FAKE_STACK_FRAME $child_rip
833 # rdi: flags, rsi: usp, rdx: will be &pt_regs
835 orq kernel_thread_flags(%rip),%rdi
848 * It isn't worth to check for reschedule here,
849 * so internally to the x86_64 port you can rely on kernel_thread()
850 * not to reschedule the child before returning, this avoids the need
851 * of hacks for example to fork off the per-CPU idle tasks.
852 * [Hopefully no generic code relies on the reschedule -AK]
862 * Here we are in the child and the registers are set as they were
863 * at kernel_thread() invocation in the parent.
873 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
875 * C extern interface:
876 * extern long execve(char *name, char **argv, char **envp)
878 * asm input arguments:
879 * rdi: name, rsi: argv, rdx: envp
881 * We want to fallback into:
882 * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs)
884 * do_sys_execve asm fallback arguments:
885 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack
895 je int_ret_from_sys_call
901 KPROBE_ENTRY(page_fault)
902 errorentry do_page_fault
905 ENTRY(coprocessor_error)
906 zeroentry do_coprocessor_error
908 ENTRY(simd_coprocessor_error)
909 zeroentry do_simd_coprocessor_error
911 ENTRY(device_not_available)
912 zeroentry math_state_restore
914 /* runs on exception stack */
918 CFI_ADJUST_CFA_OFFSET 8
919 paranoidentry do_debug, DEBUG_STACK
924 /* runs on exception stack */
928 CFI_ADJUST_CFA_OFFSET 8
931 * "Paranoid" exit path from exception stack.
932 * Paranoid because this is used by NMIs and cannot take
933 * any kernel state for granted.
934 * We don't do kernel preemption checks here, because only
935 * NMI should be common and it does not enable IRQs and
936 * cannot get reschedule ticks.
938 /* ebx: no swapgs flag */
940 testl %ebx,%ebx /* swapgs needed? */
943 jnz paranoid_userspace
950 GET_THREAD_INFO(%rcx)
951 movl threadinfo_flags(%rcx),%ebx
952 andl $_TIF_WORK_MASK,%ebx
954 movq %rsp,%rdi /* &pt_regs */
956 movq %rax,%rsp /* switch stack for scheduling */
957 testl $_TIF_NEED_RESCHED,%ebx
958 jnz paranoid_schedule
959 movl %ebx,%edx /* arg3: thread flags */
961 xorl %esi,%esi /* arg2: oldset */
962 movq %rsp,%rdi /* arg1: &pt_regs */
963 call do_notify_resume
965 jmp paranoid_userspace
970 jmp paranoid_userspace
976 CFI_ADJUST_CFA_OFFSET 8
977 paranoidentry do_int3, DEBUG_STACK
983 zeroentry do_overflow
989 zeroentry do_invalid_op
991 ENTRY(coprocessor_segment_overrun)
992 zeroentry do_coprocessor_segment_overrun
995 zeroentry do_reserved
997 /* runs on exception stack */
1000 paranoidentry do_double_fault
1005 errorentry do_invalid_TSS
1007 ENTRY(segment_not_present)
1008 errorentry do_segment_not_present
1010 /* runs on exception stack */
1011 ENTRY(stack_segment)
1013 paranoidentry do_stack_segment
1017 KPROBE_ENTRY(general_protection)
1018 errorentry do_general_protection
1021 ENTRY(alignment_check)
1022 errorentry do_alignment_check
1025 zeroentry do_divide_error
1027 ENTRY(spurious_interrupt_bug)
1028 zeroentry do_spurious_interrupt_bug
1030 #ifdef CONFIG_X86_MCE
1031 /* runs on exception stack */
1032 ENTRY(machine_check)
1035 CFI_ADJUST_CFA_OFFSET 8
1036 paranoidentry do_machine_check
1043 movq %gs:pda_irqstackptr,%rax
1045 CFI_DEF_CFA_REGISTER rdx
1046 incl %gs:pda_irqcount
1049 /*todo CFI_DEF_CFA_EXPRESSION ...*/
1052 CFI_DEF_CFA_REGISTER rsp
1053 decl %gs:pda_irqcount