example to efficiently enable more than 255 vCPUs.
:since:`Since 10.7.0` (QEMU/KVM and ``intel`` model only)
+ ``passthrough``
+ Enable passthrough. In this mode, DMA read/writes are not translated.
+ :since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
+
+ ``xtsup``
+ Enable x2APIC mode. Useful for higher number of guest CPUs.
+ :since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
+
The ``virtio`` IOMMU devices can further have ``address`` element as described
in `Device addresses`_ (address has to by type of ``pci``).
if (virXMLPropTristateSwitch(driver, "dma_translation", VIR_XML_PROP_NONE,
&iommu->dma_translation) < 0)
return NULL;
+
+ if (virXMLPropTristateSwitch(driver, "xtsup", VIR_XML_PROP_NONE,
+ &iommu->xtsup) < 0)
+ return NULL;
+
+ if (virXMLPropTristateSwitch(driver, "passthrough", VIR_XML_PROP_NONE,
+ &iommu->pt) < 0)
+ return NULL;
}
if (virDomainDeviceInfoParseXML(xmlopt, node, ctxt,
virTristateSwitchTypeToString(src->dma_translation));
return false;
}
+ if (src->pt != dst->pt) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device dma translation '%1$s' does not match source '%2$s'"),
+ virTristateSwitchTypeToString(dst->pt),
+ virTristateSwitchTypeToString(src->pt));
+ return false;
+ }
+ if (src->xtsup != dst->xtsup) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device dma translation '%1$s' does not match source '%2$s'"),
+ virTristateSwitchTypeToString(dst->xtsup),
+ virTristateSwitchTypeToString(src->xtsup));
+ return false;
+ }
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
}
virBufferAsprintf(&driverAttrBuf, " dma_translation='%s'",
virTristateSwitchTypeToString(iommu->dma_translation));
}
+ if (iommu->pt != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&driverAttrBuf, " passthrough='%s'",
+ virTristateSwitchTypeToString(iommu->pt));
+ }
+ if (iommu->xtsup != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&driverAttrBuf, " xtsup='%s'",
+ virTristateSwitchTypeToString(iommu->xtsup));
+ }
virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL);
break;
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
+ if (iommu->pt != VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->xtsup != VIR_TRISTATE_SWITCH_ABSENT) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("iommu model '%1$s' doesn't support some additional attributes"),
+ virDomainIOMMUModelTypeToString(iommu->model));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_IOMMU_MODEL_LAST:
break;
}
-no-shutdown \
-boot strict=on \
-device '{"driver":"AMDVI-PCI","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
--device '{"driver":"amd-iommu","pci-id":"iommu0","intremap":"on","device-iotlb":true}' \
+-device '{"driver":"amd-iommu","pci-id":"iommu0","intremap":"on","pt":true,"xtsup":true,"device-iotlb":true}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-global ICH9-LPC.noreboot=off \
-watchdog-action reset \