diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -322,6 +322,7 @@ typedef void (*vm_rendezvous_func_t)(struct vcpu *vcpu, void *arg); int vm_smp_rendezvous(struct vcpu *vcpu, cpuset_t dest, vm_rendezvous_func_t func, void *arg); +bool vm_handle_rendezvous_help_one(struct vcpu *vcpu); cpuset_t vm_active_cpus(struct vm *vm); cpuset_t vm_debug_cpus(struct vm *vm); diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -151,9 +151,17 @@ int error; uint16_t i, j, maxcpus; +again: + error = 0; vm_slock_vcpus(sc->vm); maxcpus = vm_get_maxcpus(sc->vm); for (i = 0; i < maxcpus; i++) { + for (j = 0; j < i; j++) { + if (vm_handle_rendezvous_help_one(vm_vcpu(sc->vm, j))) { + error = EJUSTRETURN; + break; + } + } vcpu = vm_vcpu(sc->vm, i); if (vcpu == NULL) continue; @@ -171,6 +179,8 @@ } vm_unlock_vcpus(sc->vm); } + if (error == EJUSTRETURN) + goto again; return (error); }