Skip to content

Commit

Permalink
bhyve: Assert success in a couple of libvmmapi calls
Browse files Browse the repository at this point in the history
- In vmexit_smccc(), copy an assertion from amd64.
- In fbsdrun_addcpu(), make sure that our vm_suspend_cpu() call is
  succesful.
  • Loading branch information
markjdb committed Jul 31, 2024
1 parent f2c95fa commit cf5fe87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion usr.sbin/bhyve/aarch64/vmexit.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ vmexit_smccc(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun)
how = VM_SUSPEND_POWEROFF;
else
how = VM_SUSPEND_RESET;
vm_suspend(ctx, how);
error = vm_suspend(ctx, how);
assert(error == 0 || errno == EALREADY);
break;
default:
break;
Expand Down
3 changes: 2 additions & 1 deletion usr.sbin/bhyve/bhyverun.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ fbsdrun_addcpu(int vcpuid)

CPU_SET_ATOMIC(vcpuid, &cpumask);

vm_suspend_cpu(vi->vcpu);
error = vm_suspend_cpu(vi->vcpu);
assert(error == 0);

error = pthread_create(&thr, NULL, fbsdrun_start_thread, vi);
assert(error == 0);
Expand Down

0 comments on commit cf5fe87

Please sign in to comment.