-/* $OpenBSD: vmm.c,v 1.149 2017/05/30 17:49:47 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.150 2017/05/30 19:13:20 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
}
/* Start / resume the VCPU */
+#ifdef VMM_DEBUG
KERNEL_ASSERT_LOCKED();
+#endif /* VMM_DEBUG */
/* Disable interrupts and save the current FPU state. */
disable_intr();
resume = 1;
if (!(exitinfo & VMX_EXIT_INFO_HAVE_RIP)) {
printf("%s: cannot read guest rip\n", __func__);
+ if (!locked)
+ KERNEL_LOCK();
ret = EINVAL;
break;
}
if (!(exitinfo & VMX_EXIT_INFO_HAVE_REASON)) {
printf("%s: cant read exit reason\n", __func__);
+ if (!locked)
+ KERNEL_LOCK();
ret = EINVAL;
break;
}
} else
ret = EINVAL;
+#ifdef VMM_DEBUG
+ KERNEL_ASSERT_LOCKED();
+#endif /* VMM_DEBUG */
return (ret);
}
}
/* Start / resume the VCPU */
+#ifdef VMM_DEBUG
KERNEL_ASSERT_LOCKED();
+#endif /* VMM_DEBUG */
/* Disable interrupts and save the current FPU state. */
disable_intr();
* handling an exit, a guest interrupt is pending, or we failed in some
* way to enter the guest.
*/
+
+#ifdef VMM_DEBUG
+ KERNEL_ASSERT_LOCKED();
+#endif /* VMM_DEBUG */
return (ret);
}