Centralize mapping vCPU IDs to struct vcpu objects in vmmdev_ioctl and
pass vcpu pointers to the routines in vmm.c. For operations that want
to perform an action on all vCPUs or on a single vCPU, pass pointers
to both the VM and the vCPU using a NULL vCPU pointer to request
global actions.
Details
Details
- Reviewers
markj corvink - Group Reviewers
bhyve - Commits
- rG3348ba1d6da9: vmm: Lookup vcpu pointers in vmmdev_ioctl.
rG3f0f4b1598e0: vmm: Lookup vcpu pointers in vmmdev_ioctl.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 48040 Build 44927: arc lint + arc unit
Event Timeline
sys/amd64/vmm/vmm_dev.c | ||
---|---|---|
435 | vcpu is initialized to NULL here btw. |
sys/amd64/vmm/vmm_lapic.c | ||
---|---|---|
80 | This is a semantic change, right? Before, if vm_active_cpus() is empty, this function would do nothing and return 0 instead of ENOENT. |
sys/amd64/vmm/vmm_lapic.c | ||
---|---|---|
80 | Hmm, it is. Probably I shouldn't change the semantics in this commit (enough moving parts). |
sys/amd64/vmm/vmm_lapic.c | ||
---|---|---|
80 | Btw: why did you changed the layout of the function? The old layout avoids some nesting. This commit could change it to something like: if (vcpu == NULL) dmask = vm_active_cpus(vm); else CPU_SETOF(vcpu_vcpuid(vcpu), &dmask); error = 0; CPU_FOREACH_ISSET(cpuid, &dmask) ... |
sys/amd64/vmm/vmm_lapic.c | ||
---|---|---|
80 | I think it was just to avoid doing a round trip of vcpu = vm_vcpu(vm, vm_vcpuid(vcpu)). |
sys/amd64/vmm/vmm_lapic.c | ||
---|---|---|
80 | Yeah, this round trip looks unnecessary. The old layout avoids some code duplication for vlapic = vm_lapic(vcpu); error = vlapic_trigger_lvt(vlapic, vector);. |