]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libvmmapi: Make memory segment handling a bit more abstract
authorMark Johnston <markj@FreeBSD.org>
Wed, 3 Apr 2024 17:01:31 +0000 (13:01 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 10 Apr 2024 15:17:56 +0000 (11:17 -0400)
commit7e0fa794123eb8395fffa976c47e8ba4f44f2df0
treebb090270578d75835a213841676ed21f65e392ea
parent8b06bdc91ddff995beed7bdcb6e5541c5ca227ef
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
lib/libvmmapi/internal.h
lib/libvmmapi/vmmapi.c
lib/libvmmapi/vmmapi.h