entry_64.S (67e93ddd5d0b84ac17bddb13d98533e425282421) | entry_64.S (c063a217bc0726c2560138229de5673dbb253a02) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * linux/arch/x86_64/entry.S 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs 7 * Copyright (C) 2000 Pavel Machek <pavel@suse.cz> 8 * --- 78 unchanged lines hidden (view full) --- 87SYM_CODE_START(entry_SYSCALL_64) 88 UNWIND_HINT_ENTRY 89 ENDBR 90 91 swapgs 92 /* tss.sp2 is scratch space. */ 93 movq %rsp, PER_CPU_VAR(cpu_tss_rw + TSS_sp2) 94 SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * linux/arch/x86_64/entry.S 4 * 5 * Copyright (C) 1991, 1992 Linus Torvalds 6 * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs 7 * Copyright (C) 2000 Pavel Machek <pavel@suse.cz> 8 * --- 78 unchanged lines hidden (view full) --- 87SYM_CODE_START(entry_SYSCALL_64) 88 UNWIND_HINT_ENTRY 89 ENDBR 90 91 swapgs 92 /* tss.sp2 is scratch space. */ 93 movq %rsp, PER_CPU_VAR(cpu_tss_rw + TSS_sp2) 94 SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp |
95 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp | 95 movq PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %rsp |
96 97SYM_INNER_LABEL(entry_SYSCALL_64_safe_stack, SYM_L_GLOBAL) 98 ANNOTATE_NOENDBR 99 100 /* Construct struct pt_regs on stack */ 101 pushq $__USER_DS /* pt_regs->ss */ 102 pushq PER_CPU_VAR(cpu_tss_rw + TSS_sp2) /* pt_regs->sp */ 103 pushq %r11 /* pt_regs->flags */ --- 1100 unchanged lines hidden (view full) --- 1204 * We also must not push anything to the stack before switching 1205 * stacks lest we corrupt the "NMI executing" variable. 1206 */ 1207 1208 swapgs 1209 FENCE_SWAPGS_USER_ENTRY 1210 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx 1211 movq %rsp, %rdx | 96 97SYM_INNER_LABEL(entry_SYSCALL_64_safe_stack, SYM_L_GLOBAL) 98 ANNOTATE_NOENDBR 99 100 /* Construct struct pt_regs on stack */ 101 pushq $__USER_DS /* pt_regs->ss */ 102 pushq PER_CPU_VAR(cpu_tss_rw + TSS_sp2) /* pt_regs->sp */ 103 pushq %r11 /* pt_regs->flags */ --- 1100 unchanged lines hidden (view full) --- 1204 * We also must not push anything to the stack before switching 1205 * stacks lest we corrupt the "NMI executing" variable. 1206 */ 1207 1208 swapgs 1209 FENCE_SWAPGS_USER_ENTRY 1210 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx 1211 movq %rsp, %rdx |
1212 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp | 1212 movq PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %rsp |
1213 UNWIND_HINT_IRET_REGS base=%rdx offset=8 1214 pushq 5*8(%rdx) /* pt_regs->ss */ 1215 pushq 4*8(%rdx) /* pt_regs->rsp */ 1216 pushq 3*8(%rdx) /* pt_regs->flags */ 1217 pushq 2*8(%rdx) /* pt_regs->cs */ 1218 pushq 1*8(%rdx) /* pt_regs->rip */ 1219 UNWIND_HINT_IRET_REGS 1220 pushq $-1 /* pt_regs->orig_ax */ --- 299 unchanged lines hidden (view full) --- 1520 1521.pushsection .text, "ax" 1522 __FUNC_ALIGN 1523SYM_CODE_START_NOALIGN(rewind_stack_and_make_dead) 1524 UNWIND_HINT_FUNC 1525 /* Prevent any naive code from trying to unwind to our caller. */ 1526 xorl %ebp, %ebp 1527 | 1213 UNWIND_HINT_IRET_REGS base=%rdx offset=8 1214 pushq 5*8(%rdx) /* pt_regs->ss */ 1215 pushq 4*8(%rdx) /* pt_regs->rsp */ 1216 pushq 3*8(%rdx) /* pt_regs->flags */ 1217 pushq 2*8(%rdx) /* pt_regs->cs */ 1218 pushq 1*8(%rdx) /* pt_regs->rip */ 1219 UNWIND_HINT_IRET_REGS 1220 pushq $-1 /* pt_regs->orig_ax */ --- 299 unchanged lines hidden (view full) --- 1520 1521.pushsection .text, "ax" 1522 __FUNC_ALIGN 1523SYM_CODE_START_NOALIGN(rewind_stack_and_make_dead) 1524 UNWIND_HINT_FUNC 1525 /* Prevent any naive code from trying to unwind to our caller. */ 1526 xorl %ebp, %ebp 1527 |
1528 movq PER_CPU_VAR(cpu_current_top_of_stack), %rax | 1528 movq PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %rax |
1529 leaq -PTREGS_SIZE(%rax), %rsp 1530 UNWIND_HINT_REGS 1531 1532 call make_task_dead 1533SYM_CODE_END(rewind_stack_and_make_dead) 1534.popsection | 1529 leaq -PTREGS_SIZE(%rax), %rsp 1530 UNWIND_HINT_REGS 1531 1532 call make_task_dead 1533SYM_CODE_END(rewind_stack_and_make_dead) 1534.popsection |