Hi Pavel,

On 2/23/2026 12:21 PM, Pavel Hrdina wrote:
+   ``ril``
+      The ``ril`` attribute with possible values ``on`` and ``off`` can be used
+      to report whether Range Invalidation for smmuv3Dev IOMMU devices with
+      ``accel`` set to ``on`` is compatible with host SMMUv3 support.
+      (QEMU/KVM and ``smmuv3`` model only)
Current default in QEMU is `on` but if `accel` is enabled it has to match
what is supported by host SMMUv3 and QEMU errors out if incorrect value
is used.

I wonder why QEMU cannot figure out the default value if nothing is
specified? This way when acceleration is enabled and host SMMUv3 doesn't
support RIL user needs to manually set this option as well.

+
+   ``ssidSize``
+      The ``ssidSize`` attribute sets the number of bits used to represent
+      SubstreamIDs. A value of N allows SSIDs in the range [0 .. 2^N - 1].
+      The valid range is 0-20, and a value greater than 0 is required for
+      enabling PASID support, as doing so advertises PASID capability to
+      the vIOMMU. (QEMU/KVM and ``smmuv3`` model only)
By default this is disabled in QEMU and can be used only with accel
enabled. If user picks 20 it can be still rejected by QEMU if the host
doesn't support that size.

Is this necessary to be enabled and what is reasonable default user
should use?

+   ``oas``
+      The ``oas`` attribute sets the output address size in units of bits.
+      (QEMU/KVM and ``smmuv3`` model only)
Currently supported values in QEMU are 44 and 48
bits. QEMU defaults to 44, if accel is off it has to be 44, if accel
is on it can be 48. In addition QEMU also errors out if user sets OAS
greater than what is supported by host.

How is user supposed to figure this out and why QEMU cannot pick
reasonable default?

  The ``virtio`` IOMMU devices can further have ``address`` element as described
  in `Device addresses`_ (address has to by type of ``pci``).
For all these options we should store the default value in XML if user
doesn't provide it to make sure that existing VMs will not change if
QEMU changes its defaults.

There has been some discussion on supporting an 'auto' value for these properties in the QEMU layer [0]. I think it would make sense to refresh this series with support for the 'auto' value, deriving these properties from host IOMMU capabilities so Libvirt users do not have to introspect host settings.

Would you suggest consolidating this implementation into a single 'accel' driver attribute, and then setting the values for ril, ssidsize, and oas to 'auto' in the qemu command line when accel=on? Or still supporting user-defined values for ril, ssidsize, and oas but also supporting 'auto'? Noted for the latter option that we should store the default value in XML if user does not provide it.

Thanks,
Nathan

[0] https://lore.kernel.org/qemu-devel/[email protected]/

Reply via email to