vmm(4): treat vcpu lists as immutable, reducing complexity.
authordv <dv@openbsd.org>
Wed, 9 Nov 2022 17:53:12 +0000 (17:53 +0000)
committerdv <dv@openbsd.org>
Wed, 9 Nov 2022 17:53:12 +0000 (17:53 +0000)
commit2ef7560e3a04bfd37fcc08ecd39f003a03ebd93e
tree3d88ef9f91c25bd2589887e012cb3eae4303cc4a
parentd13005d79199f86dcc4737e2f0a701e766afbdce
vmm(4): treat vcpu lists as immutable, reducing complexity.

Since vmm doesn't support hot-plug vcpus we can reduce complexity
by treating the vcpu list per vm as immutable after creation.

As a consequence, we can use the vm reference count to protect the
lifetime of the vcpus, removing the need for reference counting
individual vcpu objects. With an immutable list, we no longer need
a rwlock protecting it either.

Original diff from dlg@ that I reworked and tested.

ok dlg@, mlarkin@
sys/arch/amd64/amd64/vmm.c
sys/arch/amd64/include/vmmvar.h