summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/bhyverun.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-05-18 04:33:24 +0000
committerjhb <jhb@FreeBSD.org>2014-05-18 04:33:24 +0000
commit5e2f766c6cd64afa82187b1855e1fec05976819a (patch)
treec325b0c1bd8da28081e6b2811566135735b388c8 /usr.sbin/bhyve/bhyverun.c
parent79fa7e0a74ae908ace3288fb0e05ab959d088373 (diff)
downloadFreeBSD-src-5e2f766c6cd64afa82187b1855e1fec05976819a.zip
FreeBSD-src-5e2f766c6cd64afa82187b1855e1fec05976819a.tar.gz
MFC 259737, 262646:
Fix a couple of issues with vcpu state: - Add a parameter to 'vcpu_set_state()' to enforce that the vcpu is in the IDLE state before the requested state transition. This guarantees that there is exactly one ioctl() operating on a vcpu at any point in time and prevents unintended state transitions. - Fix a race between VMRUN() and vcpu_notify_event() due to 'vcpu->hostcpu' being updated outside of the vcpu_lock().
Diffstat (limited to 'usr.sbin/bhyve/bhyverun.c')
-rw-r--r--usr.sbin/bhyve/bhyverun.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index c1bc0d2..5cde323 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -493,19 +493,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip)
while (1) {
error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]);
- if (error != 0) {
- /*
- * It is possible that 'vmmctl' or some other process
- * has transitioned the vcpu to CANNOT_RUN state right
- * before we tried to transition it to RUNNING.
- *
- * This is expected to be temporary so just retry.
- */
- if (errno == EBUSY)
- continue;
- else
- break;
- }
+ if (error != 0)
+ break;
prevcpu = vcpu;
OpenPOWER on IntegriCloud