Page MenuHomeFreeBSD

vmm: Consolidate vm and vcpu definitions
Needs ReviewPublic

Authored by markj on Tue, Nov 4, 4:40 PM.
Tags
None
Referenced Files
F138061850: D53584.diff
Fri, Nov 28, 2:14 PM
Unknown Object (File)
Wed, Nov 19, 7:21 PM
Unknown Object (File)
Mon, Nov 17, 4:26 PM
Unknown Object (File)
Sun, Nov 16, 5:00 PM
Unknown Object (File)
Thu, Nov 6, 6:30 AM
Unknown Object (File)
Thu, Nov 6, 6:30 AM
Unknown Object (File)
Thu, Nov 6, 4:41 AM
Unknown Object (File)
Wed, Nov 5, 11:02 AM

Details

Reviewers
andrew
manu
Group Reviewers
bhyve
Summary

There is quite a lot of duplication of code between amd64, arm64 and
riscv with respect to VM and vCPU state management. This is a bit
tricky to resolve since struct vm and struct vcpu are private to vmm.c
and both structures contain a mix of machine-dependent and
machine-independent fields.

To allow deduplication without also introducing a lot of churn, follow
the approach of struct pcpu and 1) lift the definitions of those
structures into a new header, sys/dev/vmm/vmm_vm.h, and 2) define
machine-dependent macros, VMM_VM_MD_FIELDS and VMM_VCPU_MD_FIELDS which
lay out the machine-dependent fields.

One disadvantage of this approach is that the two structures are now
exposed to other compilation units, but I think this is not a major
problem.

No functional change intended. A follow-up change will move a good deal
of machine/vmm/vmm.c into sys/dev/vmm/vmm_vm.c.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68415
Build 65298: arc lint + arc unit