-/* $OpenBSD: vmm.c,v 1.308 2022/05/04 02:24:26 dv Exp $ */
+/* $OpenBSD: vmm.c,v 1.309 2022/05/13 18:19:32 dv Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
int fault_type, ret;
fault_type = vmx_get_guest_faulttype();
- if (fault_type == -1) {
+ switch (fault_type) {
+ case -1:
printf("%s: invalid fault type\n", __func__);
return (EINVAL);
- }
-
- if (fault_type == VM_FAULT_PROTECT) {
+ case VM_FAULT_PROTECT:
vcpu->vc_exit.vee.vee_fault_type = VEE_FAULT_PROTECT;
return (EAGAIN);
+ default:
+ vcpu->vc_exit.vee.vee_fault_type = VEE_FAULT_HANDLED;
+ break;
}
/* We may sleep during uvm_fault(9), so reload VMCS. */
-/* $OpenBSD: vmmvar.h,v 1.75 2022/05/03 21:39:19 dv Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.76 2022/05/13 18:19:32 dv Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
};
enum {
- VEE_FAULT_PROTECT
+ VEE_FAULT_HANDLED,
+ VEE_FAULT_PROTECT,
};
enum {