virtio-iommu: Compute host reserved regions
authorEric Auger <eric.auger@redhat.com>
Fri, 14 Jun 2024 09:52:55 +0000 (11:52 +0200)
committerCédric Le Goater <clg@redhat.com>
Mon, 24 Jun 2024 21:15:30 +0000 (23:15 +0200)
commitcf2647a76e7854ff28c21c8fb4bfca1da603e007
treef72c360a0a4514b6a92db24b3673b4a64c2800fb
parenta95264191f10173e27b175ebc4a487520a523d62
virtio-iommu: Compute host reserved regions

Compute the host reserved regions in virtio_iommu_set_iommu_device().
The usable IOVA regions are retrieved from the HostIOMMUDevice.
The virtio_iommu_set_host_iova_ranges() helper turns usable regions
into complementary reserved regions while testing the inclusion
into existing ones. virtio_iommu_set_host_iova_ranges() reuse the
implementation of virtio_iommu_set_iova_ranges() which will be
removed in subsequent patches. rebuild_resv_regions() is just moved.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-iommu.c