-/* $OpenBSD: vmm.c,v 1.337 2023/01/30 14:05:36 dv Exp $ */
+/* $OpenBSD: vmm.c,v 1.338 2023/04/16 01:50:12 dv Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
ctrlval = vcpu->vc_vmx_exit_ctls;
}
+ if (rcr4() & CR4_CET)
+ want1 |= IA32_VMX_LOAD_HOST_CET_STATE;
+ else
+ want0 |= IA32_VMX_LOAD_HOST_CET_STATE;
+
if (vcpu_vmx_compute_ctrl(ctrlval, ctrl, want1, want0, &exit)) {
DPRINTF("%s: error computing exit controls\n", __func__);
ret = EINVAL;
ctrlval = vcpu->vc_vmx_entry_ctls;
}
+ if (rcr4() & CR4_CET)
+ want1 |= IA32_VMX_LOAD_GUEST_CET_STATE;
+ else
+ want0 |= IA32_VMX_LOAD_GUEST_CET_STATE;
+
if (vcpu_vmx_compute_ctrl(ctrlval, ctrl, want1, want0, &entry)) {
ret = EINVAL;
goto exit;