diff options
author | jhb <jhb@FreeBSD.org> | 2014-05-18 04:33:24 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-05-18 04:33:24 +0000 |
commit | 5e2f766c6cd64afa82187b1855e1fec05976819a (patch) | |
tree | c325b0c1bd8da28081e6b2811566135735b388c8 /sys/amd64/include | |
parent | 79fa7e0a74ae908ace3288fb0e05ab959d088373 (diff) | |
download | FreeBSD-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 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/vmm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index fab7e74..cc7c7ad 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -177,7 +177,8 @@ enum vcpu_state { VCPU_SLEEPING, }; -int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); +int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state, + bool from_idle); enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu, int *hostcpu); static int __inline |