[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 05/20] hw/arm/smmuv3: Implement get_attr API to report
From: |
Eric Auger |
Subject: |
[Qemu-devel] [RFC 05/20] hw/arm/smmuv3: Implement get_attr API to report IOMMU_ATTR_VFIO_NESTED |
Date: |
Sat, 1 Sep 2018 16:22:57 +0200 |
Virtual SMMUv3 requires physical nested stages for VFIO integration.
Let's advertise this.
Signed-off-by: Eric Auger <address@hidden>
---
hw/arm/smmuv3.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index bb6a24e9b8..80aa4f3793 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1504,6 +1504,17 @@ static void smmuv3_notify_flag_changed(IOMMUMemoryRegion
*iommu,
}
}
+static int smmuv3_get_attr(IOMMUMemoryRegion *iommu,
+ enum IOMMUMemoryRegionAttr attr,
+ void *data)
+{
+ if (attr == IOMMU_ATTR_VFIO_NESTED) {
+ *(bool *) data = true;
+ return 0;
+ }
+ return -EINVAL;
+}
+
static void smmuv3_iommu_memory_region_class_init(ObjectClass *klass,
void *data)
{
@@ -1511,6 +1522,7 @@ static void
smmuv3_iommu_memory_region_class_init(ObjectClass *klass,
imrc->translate = smmuv3_translate;
imrc->notify_flag_changed = smmuv3_notify_flag_changed;
+ imrc->get_attr = smmuv3_get_attr;
}
static const TypeInfo smmuv3_type_info = {
--
2.17.1
- [Qemu-devel] [RFC 14/20] hw/vfio/common: Introduce vfio_alloc_guest_iommu helper, (continued)
- [Qemu-devel] [RFC 14/20] hw/vfio/common: Introduce vfio_alloc_guest_iommu helper, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 13/20] hw/arm/smmuv3: Notify on config changes, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 12/20] hw/arm/smmuv3: Implement dummy replay, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 10/20] memory: Add IOMMUConfigNotifier, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 11/20] hw/arm/smmuv3: Store s1ctrptr in translation config data, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 06/20] hw/vfio/common: Refactor container initialization, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 09/20] memory: rename memory_region notify_iommu, notify_one, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 08/20] memory: Introduce IOMMUIOLTBNotifier, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 07/20] hw/vfio/common: Force nested if iommu requires it, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 04/20] memory: add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 05/20] hw/arm/smmuv3: Implement get_attr API to report IOMMU_ATTR_VFIO_NESTED,
Eric Auger <=
- [Qemu-devel] [RFC 03/20] linux-headers: Partial header update, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 02/20] update-linux-headers: Import iommu.h, Eric Auger, 2018/09/01
- [Qemu-devel] [RFC 01/20] hw/arm/smmu-common: Fix the name of the iommu memory regions, Eric Auger, 2018/09/01