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>
47 #ifndef CONFIG_PREEMPT
48 #define retint_kernel retint_restore_args
52 * C code is not supposed to know about undefined top of stack. Every time
53 * a C function with an pt_regs argument is called from the SYSCALL based
54 * fast path FIXUP_TOP_OF_STACK is needed.
55 * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
59 /* %rsp:at FRAMEEND */
60 .macro FIXUP_TOP_OF_STACK tmp
61 movq %gs:pda_oldrsp,\tmp
63 movq $__USER_DS,SS(%rsp)
64 movq $__USER_CS,CS(%rsp)
66 movq R11(%rsp),\tmp /* get eflags */
67 movq \tmp,EFLAGS(%rsp)
70 .macro RESTORE_TOP_OF_STACK tmp,offset=0
71 movq RSP-\offset(%rsp),\tmp
72 movq \tmp,%gs:pda_oldrsp
73 movq EFLAGS-\offset(%rsp),\tmp
74 movq \tmp,R11-\offset(%rsp)
77 .macro FAKE_STACK_FRAME child_rip
78 /* push in order ss, rsp, eflags, cs, rip */
81 CFI_ADJUST_CFA_OFFSET 8
82 /*CFI_REL_OFFSET ss,0*/
84 CFI_ADJUST_CFA_OFFSET 8
86 pushq $(1<<9) /* eflags - interrupts on */
87 CFI_ADJUST_CFA_OFFSET 8
88 /*CFI_REL_OFFSET rflags,0*/
89 pushq $__KERNEL_CS /* cs */
90 CFI_ADJUST_CFA_OFFSET 8
91 /*CFI_REL_OFFSET cs,0*/
92 pushq \child_rip /* rip */
93 CFI_ADJUST_CFA_OFFSET 8
95 pushq %rax /* orig rax */
96 CFI_ADJUST_CFA_OFFSET 8
99 .macro UNFAKE_STACK_FRAME
101 CFI_ADJUST_CFA_OFFSET -(6*8)
104 .macro CFI_DEFAULT_STACK start=1
109 CFI_DEF_CFA_OFFSET SS+8
111 CFI_REL_OFFSET r15,R15
112 CFI_REL_OFFSET r14,R14
113 CFI_REL_OFFSET r13,R13
114 CFI_REL_OFFSET r12,R12
115 CFI_REL_OFFSET rbp,RBP
116 CFI_REL_OFFSET rbx,RBX
117 CFI_REL_OFFSET r11,R11
118 CFI_REL_OFFSET r10,R10
121 CFI_REL_OFFSET rax,RAX
122 CFI_REL_OFFSET rcx,RCX
123 CFI_REL_OFFSET rdx,RDX
124 CFI_REL_OFFSET rsi,RSI
125 CFI_REL_OFFSET rdi,RDI
126 CFI_REL_OFFSET rip,RIP
127 /*CFI_REL_OFFSET cs,CS*/
128 /*CFI_REL_OFFSET rflags,EFLAGS*/
129 CFI_REL_OFFSET rsp,RSP
130 /*CFI_REL_OFFSET ss,SS*/
133 * A newly forked process directly context switches into this.
139 GET_THREAD_INFO(%rcx)
140 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
144 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread?
145 je int_ret_from_sys_call
146 testl $_TIF_IA32,threadinfo_flags(%rcx)
147 jnz int_ret_from_sys_call
148 RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
149 jmp ret_from_sys_call
152 call syscall_trace_leave
153 GET_THREAD_INFO(%rcx)
158 * System call entry. Upto 6 arguments in registers are supported.
160 * SYSCALL does not save anything on the stack and does not change the
166 * rax system call number
168 * rcx return address for syscall/sysret, C arg3
171 * r10 arg3 (--> moved to rcx for C)
174 * r11 eflags for syscall/sysret, temporary for C
175 * r12-r15,rbp,rbx saved by C code, not touched.
177 * Interrupts are off on entry.
178 * Only called from user space.
180 * XXX if we had a free scratch register we could save the RSP into the stack frame
181 * and report it properly in ps. Unfortunately we haven't.
188 /*CFI_REGISTER rflags,r11*/
190 movq %rsp,%gs:pda_oldrsp
191 movq %gs:pda_kernelstack,%rsp
194 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
195 movq %rcx,RIP-ARGOFFSET(%rsp)
196 CFI_REL_OFFSET rip,RIP-ARGOFFSET
197 GET_THREAD_INFO(%rcx)
198 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
201 cmpq $__NR_syscall_max,%rax
204 call *sys_call_table(,%rax,8) # XXX: rip relative
205 movq %rax,RAX-ARGOFFSET(%rsp)
207 * Syscall return path ending with SYSRET (fast path)
208 * Has incomplete stack frame and undefined top of stack.
210 .globl ret_from_sys_call
212 movl $_TIF_ALLWORK_MASK,%edi
215 GET_THREAD_INFO(%rcx)
217 movl threadinfo_flags(%rcx),%edx
221 movq RIP-ARGOFFSET(%rsp),%rcx
223 RESTORE_ARGS 0,-ARG_SKIP,1
224 /*CFI_REGISTER rflags,r11*/
225 movq %gs:pda_oldrsp,%rsp
229 /* Handle reschedules */
230 /* edx: work, edi: workmask */
233 bt $TIF_NEED_RESCHED,%edx
237 CFI_ADJUST_CFA_OFFSET 8
240 CFI_ADJUST_CFA_OFFSET -8
243 /* Handle a signal */
246 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
249 /* Really a signal */
250 /* edx: work flags (arg3) */
251 leaq do_notify_resume(%rip),%rax
252 leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
253 xorl %esi,%esi # oldset -> arg2
254 call ptregscall_common
255 1: movl $_TIF_NEED_RESCHED,%edi
259 movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
260 jmp ret_from_sys_call
262 /* Do syscall tracing */
266 movq $-ENOSYS,RAX(%rsp)
267 FIXUP_TOP_OF_STACK %rdi
269 call syscall_trace_enter
270 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
272 cmpq $__NR_syscall_max,%rax
274 movq %r10,%rcx /* fixup for C */
275 call *sys_call_table(,%rax,8)
276 movq %rax,RAX-ARGOFFSET(%rsp)
279 call syscall_trace_leave
280 RESTORE_TOP_OF_STACK %rbx
282 jmp ret_from_sys_call
286 * Syscall return path ending with IRET.
287 * Has correct top of stack, but partial stack frame.
289 ENTRY(int_ret_from_sys_call)
291 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
292 /*CFI_REL_OFFSET ss,SS-ARGOFFSET*/
293 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
294 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
295 /*CFI_REL_OFFSET cs,CS-ARGOFFSET*/
296 CFI_REL_OFFSET rip,RIP-ARGOFFSET
297 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
298 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
299 CFI_REL_OFFSET rax,RAX-ARGOFFSET
300 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
301 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
302 CFI_REL_OFFSET r8,R8-ARGOFFSET
303 CFI_REL_OFFSET r9,R9-ARGOFFSET
304 CFI_REL_OFFSET r10,R10-ARGOFFSET
305 CFI_REL_OFFSET r11,R11-ARGOFFSET
307 testl $3,CS-ARGOFFSET(%rsp)
308 je retint_restore_args
309 movl $_TIF_ALLWORK_MASK,%edi
310 /* edi: mask to check */
312 GET_THREAD_INFO(%rcx)
313 movl threadinfo_flags(%rcx),%edx
318 /* Either reschedule or signal or syscall exit tracking needed. */
319 /* First do a reschedule test. */
320 /* edx: work, edi: workmask */
322 bt $TIF_NEED_RESCHED,%edx
326 CFI_ADJUST_CFA_OFFSET 8
329 CFI_ADJUST_CFA_OFFSET -8
333 /* handle signals and tracing -- both require a full stack frame */
337 /* Check for syscall exit trace */
338 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx
341 CFI_ADJUST_CFA_OFFSET 8
342 leaq 8(%rsp),%rdi # &ptregs -> arg1
343 call syscall_trace_leave
345 CFI_ADJUST_CFA_OFFSET -8
346 andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi
351 testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
353 movq %rsp,%rdi # &ptregs -> arg1
354 xorl %esi,%esi # oldset -> arg2
355 call do_notify_resume
356 1: movl $_TIF_NEED_RESCHED,%edi
364 * Certain special system calls that need to save a complete full stack frame.
367 .macro PTREGSCALL label,func,arg
370 leaq \func(%rip),%rax
371 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
372 jmp ptregscall_common
377 PTREGSCALL stub_clone, sys_clone, %r8
378 PTREGSCALL stub_fork, sys_fork, %rdi
379 PTREGSCALL stub_vfork, sys_vfork, %rdi
380 PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx
381 PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
382 PTREGSCALL stub_iopl, sys_iopl, %rsi
384 ENTRY(ptregscall_common)
386 CFI_ADJUST_CFA_OFFSET -8
387 CFI_REGISTER rip, r11
390 CFI_REGISTER rip, r15
391 FIXUP_TOP_OF_STACK %r11
393 RESTORE_TOP_OF_STACK %r11
395 CFI_REGISTER rip, r11
398 CFI_ADJUST_CFA_OFFSET 8
399 CFI_REL_OFFSET rip, 0
406 CFI_ADJUST_CFA_OFFSET -8
407 CFI_REGISTER rip, r11
410 CFI_REGISTER rip, r15
411 FIXUP_TOP_OF_STACK %r11
413 GET_THREAD_INFO(%rcx)
414 bt $TIF_IA32,threadinfo_flags(%rcx)
417 RESTORE_TOP_OF_STACK %r11
419 CFI_REGISTER rip, r11
422 CFI_ADJUST_CFA_OFFSET 8
423 CFI_REL_OFFSET rip, 0
430 jmp int_ret_from_sys_call
434 * sigreturn is special because it needs to restore all registers on return.
435 * This cannot be done with SYSRET, so use the IRET return path instead.
437 ENTRY(stub_rt_sigreturn)
440 CFI_ADJUST_CFA_OFFSET -8
443 FIXUP_TOP_OF_STACK %r11
444 call sys_rt_sigreturn
445 movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
447 jmp int_ret_from_sys_call
451 * initial frame state for interrupts and exceptions
455 CFI_DEF_CFA rsp,SS+8-\ref
456 /*CFI_REL_OFFSET ss,SS-\ref*/
457 CFI_REL_OFFSET rsp,RSP-\ref
458 /*CFI_REL_OFFSET rflags,EFLAGS-\ref*/
459 /*CFI_REL_OFFSET cs,CS-\ref*/
460 CFI_REL_OFFSET rip,RIP-\ref
463 /* initial frame state for interrupts (and exceptions without error code) */
464 #define INTR_FRAME _frame RIP
465 /* initial frame state for exceptions with error code (and interrupts with
466 vector already pushed) */
467 #define XCPT_FRAME _frame ORIG_RAX
470 * Interrupt entry/exit.
472 * Interrupt entry points save only callee clobbered registers in fast path.
474 * Entry runs with interrupts off.
477 /* 0(%rsp): interrupt number */
478 .macro interrupt func
480 #ifdef CONFIG_DEBUG_INFO
484 * Setup a stack frame pointer. This allows gdb to trace
485 * back to the original stack.
488 CFI_DEF_CFA_REGISTER rbp
491 leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
496 1: incl %gs:pda_irqcount # RED-PEN should check preempt count
497 movq %gs:pda_irqstackptr,%rax
498 cmoveq %rax,%rsp /*todo This needs CFI annotation! */
499 pushq %rdi # save old stack
500 CFI_ADJUST_CFA_OFFSET 8
504 ENTRY(common_interrupt)
507 /* 0(%rsp): oldrsp-ARGOFFSET */
510 CFI_ADJUST_CFA_OFFSET -8
512 decl %gs:pda_irqcount
513 #ifdef CONFIG_DEBUG_INFO
515 CFI_DEF_CFA_REGISTER rsp
517 leaq ARGOFFSET(%rdi),%rsp /*todo This needs CFI annotation! */
519 GET_THREAD_INFO(%rcx)
520 testl $3,CS-ARGOFFSET(%rsp)
523 /* Interrupt came from user space */
525 * Has a correct top of stack, but a partial stack frame
526 * %rcx: thread info. Interrupts off.
528 retint_with_reschedule:
529 movl $_TIF_WORK_MASK,%edi
531 movl threadinfo_flags(%rcx),%edx
543 .section __ex_table,"a"
544 .quad iret_label,bad_iret
547 /* force a signal here? this matches i386 behaviour */
548 /* running with kernel gs */
550 movq $-9999,%rdi /* better code? */
554 /* edi: workmask, edx: work */
557 bt $TIF_NEED_RESCHED,%edx
561 CFI_ADJUST_CFA_OFFSET 8
564 CFI_ADJUST_CFA_OFFSET -8
565 GET_THREAD_INFO(%rcx)
570 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
574 movq $-1,ORIG_RAX(%rsp)
575 xorl %esi,%esi # oldset
576 movq %rsp,%rdi # &pt_regs
577 call do_notify_resume
580 movl $_TIF_NEED_RESCHED,%edi
581 GET_THREAD_INFO(%rcx)
584 #ifdef CONFIG_PREEMPT
585 /* Returning to kernel space. Check if we need preemption */
586 /* rcx: threadinfo. interrupts off. */
589 cmpl $0,threadinfo_preempt_count(%rcx)
590 jnz retint_restore_args
591 bt $TIF_NEED_RESCHED,threadinfo_flags(%rcx)
592 jnc retint_restore_args
593 bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */
594 jnc retint_restore_args
595 call preempt_schedule_irq
603 .macro apicinterrupt num,func
606 CFI_ADJUST_CFA_OFFSET 8
612 ENTRY(thermal_interrupt)
613 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt
615 ENTRY(threshold_interrupt)
616 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt
619 ENTRY(reschedule_interrupt)
620 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt
622 .macro INVALIDATE_ENTRY num
623 ENTRY(invalidate_interrupt\num)
624 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt
636 ENTRY(call_function_interrupt)
637 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
640 #ifdef CONFIG_X86_LOCAL_APIC
641 ENTRY(apic_timer_interrupt)
642 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
644 ENTRY(error_interrupt)
645 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt
647 ENTRY(spurious_interrupt)
648 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
652 * Exception entry points.
656 pushq $0 /* push error code/oldrax */
657 CFI_ADJUST_CFA_OFFSET 8
658 pushq %rax /* push real oldrax to the rdi slot */
659 CFI_ADJUST_CFA_OFFSET 8
665 .macro errorentry sym
668 CFI_ADJUST_CFA_OFFSET 8
674 /* error code is on the stack already */
675 /* handle NMI like exceptions that can happen everywhere */
676 .macro paranoidentry sym
680 movl $MSR_GS_BASE,%ecx
687 movq ORIG_RAX(%rsp),%rsi
688 movq $-1,ORIG_RAX(%rsp)
694 * Exception entry point. This expects an error code/orig_rax on the stack
695 * and the exception handler in %rax.
699 /* rdi slot contains rax, oldrax contains error code */
702 CFI_ADJUST_CFA_OFFSET (14*8)
704 CFI_REL_OFFSET rsi,RSI
705 movq 14*8(%rsp),%rsi /* load rax from rdi slot */
707 CFI_REL_OFFSET rdx,RDX
709 CFI_REL_OFFSET rcx,RCX
710 movq %rsi,10*8(%rsp) /* store rax */
711 CFI_REL_OFFSET rax,RAX
717 CFI_REL_OFFSET r10,R10
719 CFI_REL_OFFSET r11,R11
721 CFI_REL_OFFSET rbx,RBX
723 CFI_REL_OFFSET rbp,RBP
725 CFI_REL_OFFSET r12,R12
727 CFI_REL_OFFSET r13,R13
729 CFI_REL_OFFSET r14,R14
731 CFI_REL_OFFSET r15,R15
740 movq ORIG_RAX(%rsp),%rsi /* get error code */
741 movq $-1,ORIG_RAX(%rsp)
743 /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
748 GET_THREAD_INFO(%rcx)
751 movl threadinfo_flags(%rcx),%edx
752 movl $_TIF_WORK_MASK,%edi
762 /* There are two places in the kernel that can potentially fault with
763 usergs. Handle them here. The exception handlers after
764 iret run with kernel gs again, so don't set the user space flag.
765 B stepping K8s sometimes report an truncated RIP for IRET
766 exceptions returning to compat mode. Check for these here too. */
767 leaq iret_label(%rip),%rbp
770 movl %ebp,%ebp /* zero extend */
773 cmpq $gs_change,RIP(%rsp)
777 /* Reload gs selector with exception handling */
778 /* edi: new selector */
782 CFI_ADJUST_CFA_OFFSET 8
787 2: mfence /* workaround */
790 CFI_ADJUST_CFA_OFFSET -8
794 .section __ex_table,"a"
796 .quad gs_change,bad_gs
799 /* running with kernelgs */
801 swapgs /* switch back to user gs */
808 * Create a kernel thread.
810 * C extern interface:
811 * extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
813 * asm input arguments:
814 * rdi: fn, rsi: arg, rdx: flags
818 FAKE_STACK_FRAME $child_rip
821 # rdi: flags, rsi: usp, rdx: will be &pt_regs
823 orq kernel_thread_flags(%rip),%rdi
836 * It isn't worth to check for reschedule here,
837 * so internally to the x86_64 port you can rely on kernel_thread()
838 * not to reschedule the child before returning, this avoids the need
839 * of hacks for example to fork off the per-CPU idle tasks.
840 * [Hopefully no generic code relies on the reschedule -AK]
850 * Here we are in the child and the registers are set as they were
851 * at kernel_thread() invocation in the parent.
861 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
863 * C extern interface:
864 * extern long execve(char *name, char **argv, char **envp)
866 * asm input arguments:
867 * rdi: name, rsi: argv, rdx: envp
869 * We want to fallback into:
870 * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs)
872 * do_sys_execve asm fallback arguments:
873 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack
883 je int_ret_from_sys_call
889 KPROBE_ENTRY(page_fault)
890 errorentry do_page_fault
893 ENTRY(coprocessor_error)
894 zeroentry do_coprocessor_error
896 ENTRY(simd_coprocessor_error)
897 zeroentry do_simd_coprocessor_error
899 ENTRY(device_not_available)
900 zeroentry math_state_restore
902 /* runs on exception stack */
906 CFI_ADJUST_CFA_OFFSET 8
907 paranoidentry do_debug
912 /* runs on exception stack */
916 CFI_ADJUST_CFA_OFFSET 8
919 * "Paranoid" exit path from exception stack.
920 * Paranoid because this is used by NMIs and cannot take
921 * any kernel state for granted.
922 * We don't do kernel preemption checks here, because only
923 * NMI should be common and it does not enable IRQs and
924 * cannot get reschedule ticks.
926 /* ebx: no swapgs flag */
928 testl %ebx,%ebx /* swapgs needed? */
931 jnz paranoid_userspace
938 GET_THREAD_INFO(%rcx)
939 movl threadinfo_flags(%rcx),%ebx
940 andl $_TIF_WORK_MASK,%ebx
942 movq %rsp,%rdi /* &pt_regs */
944 movq %rax,%rsp /* switch stack for scheduling */
945 testl $_TIF_NEED_RESCHED,%ebx
946 jnz paranoid_schedule
947 movl %ebx,%edx /* arg3: thread flags */
949 xorl %esi,%esi /* arg2: oldset */
950 movq %rsp,%rdi /* arg1: &pt_regs */
951 call do_notify_resume
953 jmp paranoid_userspace
958 jmp paranoid_userspace
966 zeroentry do_overflow
972 zeroentry do_invalid_op
974 ENTRY(coprocessor_segment_overrun)
975 zeroentry do_coprocessor_segment_overrun
978 zeroentry do_reserved
980 /* runs on exception stack */
983 paranoidentry do_double_fault
988 errorentry do_invalid_TSS
990 ENTRY(segment_not_present)
991 errorentry do_segment_not_present
993 /* runs on exception stack */
996 paranoidentry do_stack_segment
1000 KPROBE_ENTRY(general_protection)
1001 errorentry do_general_protection
1004 ENTRY(alignment_check)
1005 errorentry do_alignment_check
1008 zeroentry do_divide_error
1010 ENTRY(spurious_interrupt_bug)
1011 zeroentry do_spurious_interrupt_bug
1013 #ifdef CONFIG_X86_MCE
1014 /* runs on exception stack */
1015 ENTRY(machine_check)
1018 CFI_ADJUST_CFA_OFFSET 8
1019 paranoidentry do_machine_check
1025 zeroentry do_call_debug
1029 movq %gs:pda_irqstackptr,%rax
1031 CFI_ADJUST_CFA_OFFSET 8
1033 CFI_DEF_CFA_REGISTER r15
1034 incl %gs:pda_irqcount
1038 CFI_DEF_CFA_REGISTER rsp
1039 decl %gs:pda_irqcount
1041 CFI_ADJUST_CFA_OFFSET -8