Delete 108 lines of ASM from vmx_enter_guest() that predated lots
authorguenther <guenther@openbsd.org>
Mon, 1 Apr 2024 05:11:49 +0000 (05:11 +0000)
committerguenther <guenther@openbsd.org>
Mon, 1 Apr 2024 05:11:49 +0000 (05:11 +0000)
commitc04d1b34942009a09b1284605d539f1382aa35bb
tree4120028e0da3d79f3158d359b0cd0e97298d886c
parent1b1d6ffb8adc51703986c16ea2cd87ad9cef7d60
Delete 108 lines of ASM from vmx_enter_guest() that predated lots
of later enhancements, removing the save/restore of flags, selectors,
and MSRs: flags are caller-saved and don't need restoring while
selectors and MSRs are auto-restored.  The FSBASE, GSBASE, and
KERNELGSBASE MSRs just need the correct values set with vmwrite()
in the "on new CPU?" block of vcpu_run_vmx().

Also, only rdmsr(MSR_MISC_ENABLE) once in vcpu_reset_regs_vmx(),
give symbolic names to the exit-load MSR slots, eliminate
VMX_NUM_MSR_STORE, and #if 0 the vc_vmx_msr_entry_load_{va,pa} code
and definitions as unused.

ok dv@
sys/arch/amd64/amd64/vmm_machdep.c
sys/arch/amd64/amd64/vmm_support.S
sys/arch/amd64/include/vmmvar.h