aboutsummaryrefslogtreecommitdiff
path: root/softmmu/memory.c
diff options
context:
space:
mode:
authorBharat Bhushan <bbhushan2@marvell.com>2020-10-30 19:05:07 +0100
committerMichael S. Tsirkin <mst@redhat.com>2020-11-03 07:19:27 -0500
commit457f8cbbd80f631cee02057c3c844a43ca65b5c4 (patch)
tree23fea6608b60d057ca3c2e6c7a3fbf38fa337bd0 /softmmu/memory.c
parent6978bfaa688df55dc9ea581fe32b226f81aebc3a (diff)
memory: Add interface to set iommu page size mask
Allow to set the page size mask supported by an iommu memory region. This enables a vIOMMU to communicate the page size granule supported by an assigned device, on hosts that use page sizes greater than 4kB. Acked-by: Peter Xu <peterx@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Bharat Bhushan <bbhushan2@marvell.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Message-Id: <20201030180510.747225-8-jean-philippe@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'softmmu/memory.c')
-rw-r--r--softmmu/memory.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 21d533d8ed..71951fe4dc 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1841,6 +1841,19 @@ static int memory_region_update_iommu_notify_flags(IOMMUMemoryRegion *iommu_mr,
return ret;
}
+int memory_region_iommu_set_page_size_mask(IOMMUMemoryRegion *iommu_mr,
+ uint64_t page_size_mask,
+ Error **errp)
+{
+ IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_GET_CLASS(iommu_mr);
+ int ret = 0;
+
+ if (imrc->iommu_set_page_size_mask) {
+ ret = imrc->iommu_set_page_size_mask(iommu_mr, page_size_mask, errp);
+ }
+ return ret;
+}
+
int memory_region_register_iommu_notifier(MemoryRegion *mr,
IOMMUNotifier *n, Error **errp)
{