xen-asm.S (448cc2fb3a7b327823a9afd374808c37b8e6194f) | xen-asm.S (5c8f6a2e316efebb3ba93d8c1af258155dcf5632) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Asm versions of Xen pv-ops, suitable for direct use. 4 * 5 * We only bother with direct forms (ie, vcpu in percpu data) of the 6 * operations here; the indirect forms are better handled in C. 7 */ 8 --- 6 unchanged lines hidden (view full) --- 15#include <asm/asm.h> 16#include <asm/frame.h> 17#include <asm/unwind_hints.h> 18 19#include <xen/interface/xen.h> 20 21#include <linux/init.h> 22#include <linux/linkage.h> | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Asm versions of Xen pv-ops, suitable for direct use. 4 * 5 * We only bother with direct forms (ie, vcpu in percpu data) of the 6 * operations here; the indirect forms are better handled in C. 7 */ 8 --- 6 unchanged lines hidden (view full) --- 15#include <asm/asm.h> 16#include <asm/frame.h> 17#include <asm/unwind_hints.h> 18 19#include <xen/interface/xen.h> 20 21#include <linux/init.h> 22#include <linux/linkage.h> |
23#include <../entry/calling.h> |
|
23 24.pushsection .noinstr.text, "ax" 25/* 26 * Disabling events is simply a matter of making the event mask 27 * non-zero. 28 */ 29SYM_FUNC_START(xen_irq_disable_direct) 30 movb $1, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask --- 157 unchanged lines hidden (view full) --- 188 */ 189SYM_CODE_START(xen_iret) 190 UNWIND_HINT_EMPTY 191 pushq $0 192 jmp hypercall_iret 193SYM_CODE_END(xen_iret) 194 195/* | 24 25.pushsection .noinstr.text, "ax" 26/* 27 * Disabling events is simply a matter of making the event mask 28 * non-zero. 29 */ 30SYM_FUNC_START(xen_irq_disable_direct) 31 movb $1, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask --- 157 unchanged lines hidden (view full) --- 189 */ 190SYM_CODE_START(xen_iret) 191 UNWIND_HINT_EMPTY 192 pushq $0 193 jmp hypercall_iret 194SYM_CODE_END(xen_iret) 195 196/* |
197 * XEN pv doesn't use trampoline stack, PER_CPU_VAR(cpu_tss_rw + TSS_sp0) is 198 * also the kernel stack. Reusing swapgs_restore_regs_and_return_to_usermode() 199 * in XEN pv would cause %rsp to move up to the top of the kernel stack and 200 * leave the IRET frame below %rsp, which is dangerous to be corrupted if #NMI 201 * interrupts. And swapgs_restore_regs_and_return_to_usermode() pushing the IRET 202 * frame at the same address is useless. 203 */ 204SYM_CODE_START(xenpv_restore_regs_and_return_to_usermode) 205 UNWIND_HINT_REGS 206 POP_REGS 207 208 /* stackleak_erase() can work safely on the kernel stack. */ 209 STACKLEAK_ERASE_NOCLOBBER 210 211 addq $8, %rsp /* skip regs->orig_ax */ 212 jmp xen_iret 213SYM_CODE_END(xenpv_restore_regs_and_return_to_usermode) 214 215/* |
|
196 * Xen handles syscall callbacks much like ordinary exceptions, which 197 * means we have: 198 * - kernel gs 199 * - kernel rsp 200 * - an iret-like stack frame on the stack (including rcx and r11): 201 * ss 202 * rsp 203 * rflags --- 76 unchanged lines hidden --- | 216 * Xen handles syscall callbacks much like ordinary exceptions, which 217 * means we have: 218 * - kernel gs 219 * - kernel rsp 220 * - an iret-like stack frame on the stack (including rcx and r11): 221 * ss 222 * rsp 223 * rflags --- 76 unchanged lines hidden --- |