HomeFreeBSD

vmm: Consolidate code which manages guest memory regions

Description

vmm: Consolidate code which manages guest memory regions

On all three platforms supported by vmm, we have mostly duplicated code
to manage guest physical memory regions. Deduplicate much of this code
and move it into sys/dev/vmm/vmm_mem.c.

To avoid exporting struct vm outside of machdep vmm.c, add a new
struct vm_mem to contain the memory segment descriptors, and add a
vm_mem() accessor, akin to vm_vmspace(). This way vmm_mem.c can
implement its routines without needing to see the layout of struct vm.

The handling of the per-VM vmspace is also duplicated but will be moved
to vmm_mem.c in a follow-up patch.

On amd64, move the ppt_is_mmio() check out of vm_mem_allocated() to keep
the code MI, as PPT is only implemented on amd64. There are only a
couple of callers, so this is not unreasonable.

No functional change intended.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D48270

Details

Provenance
markjAuthored on Tue, Feb 18, 3:53 PM
Reviewer
jhb
Differential Revision
D48270: vmm: Consolidate code which manages guest memory regions
Parents
rG896f5be77beb: RELNOTES: document pf's ABI breakage
Branches
Unknown
Tags
Unknown