HomeFreeBSD

libvmmapi: Make memory segment handling a bit more abstract

Description

libvmmapi: Make memory segment handling a bit more abstract

libvmmapi leaves a hole at [3GB, 4GB) in the guest physical address
space. This hole is not used in the arm64 port, which maps everything
above 4GB. This change makes the code a bit more general to accomodate
arm64 more naturally. In particular:

  • Remove vm_set_lowmem_limit(): it is unused and doesn't have well-defined constraints, e.g., nothing prevents a consumer from setting a lowmem limit above the highmem base.
  • Define a constant for the highmem base and use that everywhere that the base is currently hard-coded.
  • Make the lowmem limit a compile-time constant instead of a vmctx field.
  • Store segment info in an array.
  • Add vm_get_highmem_base(), for use in bhyve since the current value is hard-coded in some places.

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D41004

Details

Provenance
markjAuthored on Apr 3 2024, 5:01 PM
Reviewer
corvink
Differential Revision
D41004: libvmmapi: Make memory segment handling a bit more abstract
Parents
rG8b06bdc91ddf: libvmmapi: Move PCI passthrough ioctl wrappers into a separate file
Branches
Unknown
Tags
Unknown