On a Wednesday in 2025, Nathan Chen via Devel wrote:
Introduce support for "smmuv3Dev" IOMMU model and its "parentIdx" driver attribute. The "parentIdx" attribute indicates the index of the controller that a smmuv3Dev IOMMU device is attached to.
Signed-off-by: Nathan Chen <nathanc@nvidia.com> --- docs/formatdomain.rst | 9 +++- src/conf/domain_conf.c | 17 ++++++++ src/conf/domain_conf.h | 2 + src/conf/domain_validate.c | 26 +++++++++-- src/conf/schemas/domaincommon.rng | 6 +++ src/qemu/qemu_command.c | 72 +++++++++++++++++++++++++++++-- src/qemu/qemu_domain_address.c | 2 + src/qemu/qemu_validate.c | 16 +++++++ 8 files changed, 141 insertions(+), 9 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f50dce477f..6a62291600 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -9161,8 +9161,9 @@ Example: ``model`` Supported values are ``intel`` (for Q35 guests) ``smmuv3`` (:since:`since 5.5.0`, for ARM virt guests), ``virtio`` - (:since:`since 8.3.0`, for Q35 and ARM virt guests) and - ``amd`` (:since:`since 11.5.0`). + (:since:`since 8.3.0`, for Q35 and ARM virt guests), + ``amd`` (:since:`since 11.5.0`), and ``smmuv3Dev`` (for + ARM virt guests).
``driver`` The ``driver`` subelement can be used to configure additional options, some @@ -9212,6 +9213,10 @@ Example: Enable x2APIC mode. Useful for higher number of guest CPUs. :since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
+ ``parentIdx`` + The ``parentIdx`` attribute notes the index of the controller that an + IOMMU device is attached to. (QEMU/KVM and ``smmuv3Dev`` model only) + The ``virtio`` IOMMU devices can further have ``address`` element as described in `Device addresses`_ (address has to by type of ``pci``).
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 281846dfbe..6d1adb831d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1353,6 +1353,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel, "smmuv3", "virtio", "amd", + "smmuv3Dev",
Is a separate device model necessary here? The 'smmuv3' model is already there and the presence of the parentIdx/pciBus attribute specifies whether -machine or -device should be used.
);
VIR_ENUM_IMPL(virDomainVsockModel, @@ -2813,6 +2814,8 @@ virDomainIOMMUDefNew(void)
iommu = g_new0(virDomainIOMMUDef, 1);
+ iommu->parent_idx = -1; + return g_steal_pointer(&iommu); }
@@ -14439,6 +14442,10 @@ virDomainIOMMUDefParseXML(virDomainXMLOption *xmlopt, if (virXMLPropTristateSwitch(driver, "passthrough", VIR_XML_PROP_NONE, &iommu->pt) < 0) return NULL; + + if (virXMLPropInt(driver, "parentIdx", 10, VIR_XML_PROP_NONE,
To me, parentIdx somehow implies that this is also a PCI controller. Jano
+ &iommu->parent_idx, -1) < 0) + return NULL; }
if (virDomainDeviceInfoParseXML(xmlopt, node, ctxt,