Currently the VFIO resolver uses GuestMemory::full_mapping() to get a single contiguous VA for all guest memory, then identity-maps each shareable region via map_dma(gpa, base_va + gpa, size).
For future non-linear memory layouts (e.g., hotplug), this won't work. Instead, mmap each ShareableRegion's backing fd individually to get per-region VAs for map_dma. This would also support GuestMemorySharing change notifications when hotplug is implemented.
From PR #3248 discussion.
Currently the VFIO resolver uses
GuestMemory::full_mapping()to get a single contiguous VA for all guest memory, then identity-maps each shareable region viamap_dma(gpa, base_va + gpa, size).For future non-linear memory layouts (e.g., hotplug), this won't work. Instead, mmap each
ShareableRegion's backing fd individually to get per-region VAs formap_dma. This would also supportGuestMemorySharingchange notifications when hotplug is implemented.From PR #3248 discussion.