-/* $OpenBSD: vmm_support.S,v 1.16 2019/05/17 19:07:16 guenther Exp $ */
+/* $OpenBSD: vmm_support.S,v 1.17 2021/02/13 07:47:37 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
/*
* XXX duplicated in vmmvar.h due to song-and-dance with sys/rwlock.h inclusion
- * here
+ * here
*/
#define VMX_FAIL_LAUNCH_UNKNOWN 1
#define VMX_FAIL_LAUNCH_INVALID_VMCS 2
/* XXX get the right cacheline size from cpuid */
addq $0x40, %r9
cmpq $VMX_L1D_FLUSH_SIZE, %r9
- jne l1df_load_cache
+ jne l1df_load_cache
lfence
-
+
done_flush:
testq %r8, %r8
jnz do_resume
popq %r15
RETGUARD_POP(r11)
-
+
/*
* Restore saved MSRs
*/
popq %rax
movq $MSR_CSTAR, %rcx
wrmsr
-
+
popq %rdx
popq %rax
movq $MSR_LSTAR, %rcx
popq %rdx
popq %rax
movq $MSR_GSBASE, %rcx
- wrmsr
+ wrmsr
popw %fs
popq %rdx
movq %rdi, %rax
RETGUARD_CHECK(vmx_enter_guest, r11)
- ret
-
+ ret
+
_C_LABEL(svm_enter_guest):
RETGUARD_SETUP(svm_enter_guest, r11)
clgi
popq %r15
RETGUARD_POP(r11)
-
+
/*
* Restore saved MSRs
*/
popq %rax
movq $MSR_CSTAR, %rcx
wrmsr
-
+
popq %rdx
popq %rax
movq $MSR_LSTAR, %rcx
popq %rdx
popq %rax
movq $MSR_GSBASE, %rcx
- wrmsr
+ wrmsr
popw %fs
popq %rdx
/* rdx = GDTR base addr */
andb $0xF9, 5(%rdx, %rax)
-
+
ltrw %ax
popfq
movq %rdi, %rax
RETGUARD_CHECK(svm_enter_guest, r11)
- ret
+ ret