[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v4 07/27] hw/arm/smmuv3: Advertise VFIO_NESTED and MSI
From: |
Eric Auger |
Subject: |
[Qemu-devel] [RFC v4 07/27] hw/arm/smmuv3: Advertise VFIO_NESTED and MSI_TRANSLATE attributes |
Date: |
Mon, 27 May 2019 13:41:43 +0200 |
Virtual SMMUv3 requires physical nested stages for VFIO integration
and translates MSIs. So let's advertise those attributes.
Signed-off-by: Eric Auger <address@hidden>
---
v2 -> v3:
- also advertise MSI_TRANSLATE
---
hw/arm/smmuv3.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index fd8ec7860e..761d722395 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1490,6 +1490,20 @@ 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;
+ } else if (attr == IOMMU_ATTR_MSI_TRANSLATE) {
+ *(bool *) data = true;
+ return 0;
+ }
+ return -EINVAL;
+}
+
static void smmuv3_iommu_memory_region_class_init(ObjectClass *klass,
void *data)
{
@@ -1497,6 +1511,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.20.1
- [Qemu-devel] [RFC v4 00/27] vSMMUv3/pSMMUv3 2 stage VFIO integration, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 01/27] vfio/common: Introduce vfio_set_irq_signaling helper, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 02/27] update-linux-headers: Import iommu.h, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 03/27] update-linux-headers: Add sve_context.h to asm-arm64, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 04/27] header update against 5.2.0-rc1 and IOMMU/VFIO nested stage APIs, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 05/27] memory: add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 06/27] memory: add IOMMU_ATTR_MSI_TRANSLATE IOMMU memory region attribute, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 07/27] hw/arm/smmuv3: Advertise VFIO_NESTED and MSI_TRANSLATE attributes,
Eric Auger <=
- [Qemu-devel] [RFC v4 08/27] hw/vfio/common: Force nested if iommu requires it, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 09/27] memory: Prepare for different kinds of IOMMU MR notifiers, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 10/27] memory: Add IOMMUConfigNotifier, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 11/27] memory: Add arch_id and leaf fields in IOTLBEntry, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 12/27] hw/arm/smmuv3: Store the PASID table GPA in the translation config, Eric Auger, 2019/05/27
- [Qemu-devel] [RFC v4 13/27] hw/arm/smmuv3: Implement dummy replay, Eric Auger, 2019/05/27