vmenter.S (a4721ced760684d1776bf31f7925aa41bb3f4846) vmenter.S (f14eec0a32038f2d6c05b8ea91c7701f65ce7418)
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <linux/linkage.h>
3#include <asm/asm.h>
4#include <asm/bitsperlong.h>
5#include <asm/kvm_vcpu_regs.h>
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <linux/linkage.h>
3#include <asm/asm.h>
4#include <asm/bitsperlong.h>
5#include <asm/kvm_vcpu_regs.h>
6#include <asm/nospec-branch.h>
6
7#define WORD_SIZE (BITS_PER_LONG / 8)
8
9/* Intentionally omit RAX as it's context switched by hardware */
10#define VCPU_RCX __VCPU_REGS_RCX * WORD_SIZE
11#define VCPU_RDX __VCPU_REGS_RDX * WORD_SIZE
12#define VCPU_RBX __VCPU_REGS_RBX * WORD_SIZE
13/* Intentionally omit RSP as it's context switched by hardware */

--- 59 unchanged lines hidden (view full) ---

73 mov VCPU_R14(%_ASM_AX), %r14
74 mov VCPU_R15(%_ASM_AX), %r15
75#endif
76
77 /* "POP" @vmcb to RAX. */
78 pop %_ASM_AX
79
80 /* Enter guest mode */
7
8#define WORD_SIZE (BITS_PER_LONG / 8)
9
10/* Intentionally omit RAX as it's context switched by hardware */
11#define VCPU_RCX __VCPU_REGS_RCX * WORD_SIZE
12#define VCPU_RDX __VCPU_REGS_RDX * WORD_SIZE
13#define VCPU_RBX __VCPU_REGS_RBX * WORD_SIZE
14/* Intentionally omit RSP as it's context switched by hardware */

--- 59 unchanged lines hidden (view full) ---

74 mov VCPU_R14(%_ASM_AX), %r14
75 mov VCPU_R15(%_ASM_AX), %r15
76#endif
77
78 /* "POP" @vmcb to RAX. */
79 pop %_ASM_AX
80
81 /* Enter guest mode */
82 sti
811: vmload %_ASM_AX
82 jmp 3f
832: cmpb $0, kvm_rebooting
84 jne 3f
85 ud2
86 _ASM_EXTABLE(1b, 2b)
87
883: vmrun %_ASM_AX

--- 5 unchanged lines hidden (view full) ---

94
955: vmsave %_ASM_AX
96 jmp 7f
976: cmpb $0, kvm_rebooting
98 jne 7f
99 ud2
100 _ASM_EXTABLE(5b, 6b)
1017:
831: vmload %_ASM_AX
84 jmp 3f
852: cmpb $0, kvm_rebooting
86 jne 3f
87 ud2
88 _ASM_EXTABLE(1b, 2b)
89
903: vmrun %_ASM_AX

--- 5 unchanged lines hidden (view full) ---

96
975: vmsave %_ASM_AX
98 jmp 7f
996: cmpb $0, kvm_rebooting
100 jne 7f
101 ud2
102 _ASM_EXTABLE(5b, 6b)
1037:
104 cli
105
106#ifdef CONFIG_RETPOLINE
107 /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
108 FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
109#endif
110
102 /* "POP" @regs to RAX. */
103 pop %_ASM_AX
104
105 /* Save all guest registers. */
106 mov %_ASM_CX, VCPU_RCX(%_ASM_AX)
107 mov %_ASM_DX, VCPU_RDX(%_ASM_AX)
108 mov %_ASM_BX, VCPU_RBX(%_ASM_AX)
109 mov %_ASM_BP, VCPU_RBP(%_ASM_AX)

--- 53 unchanged lines hidden ---
111 /* "POP" @regs to RAX. */
112 pop %_ASM_AX
113
114 /* Save all guest registers. */
115 mov %_ASM_CX, VCPU_RCX(%_ASM_AX)
116 mov %_ASM_DX, VCPU_RDX(%_ASM_AX)
117 mov %_ASM_BX, VCPU_RBX(%_ASM_AX)
118 mov %_ASM_BP, VCPU_RBP(%_ASM_AX)

--- 53 unchanged lines hidden ---