From b917749842493abdfa49f5265ea236c922c05cb2 Mon Sep 17 00:00:00 2001 From: Bharat Bhushan Date: Fri, 30 Oct 2020 19:05:08 +0100 Subject: vfio: Set IOMMU page size as per host supported page size Set IOMMU supported page size mask same as host Linux supported page size mask. Acked-by: Alex Williamson Reviewed-by: Eric Auger Signed-off-by: Bharat Bhushan Signed-off-by: Jean-Philippe Brucker Message-Id: <20201030180510.747225-9-jean-philippe@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/vfio/common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/vfio') diff --git a/hw/vfio/common.c b/hw/vfio/common.c index e18ea2cf91..35895b18a6 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -789,6 +789,14 @@ static void vfio_listener_region_add(MemoryListener *listener, int128_get64(llend), iommu_idx); + ret = memory_region_iommu_set_page_size_mask(giommu->iommu, + container->pgsizes, + &err); + if (ret) { + g_free(giommu); + goto fail; + } + ret = memory_region_register_iommu_notifier(section->mr, &giommu->n, &err); if (ret) { -- cgit v1.2.3-55-g7522