virDomainIOMMUModelTypeToString(iommu->model));
return -1;
}
- if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("iommu: interrupt remapping is not supported "
- "with this QEMU binary"));
- return -1;
- }
- if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("iommu: caching mode is not supported "
- "with this QEMU binary"));
- return -1;
- }
- if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("iommu: eim is not supported "
- "with this QEMU binary"));
- return -1;
- }
- if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("iommu: device IOTLB is not supported "
- "with this QEMU binary"));
- return -1;
- }
break;
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
return -1;
}
+ /* These capability checks ensure we're not trying to use features
+ * of Intel IOMMU that the QEMU binary does not support, but they
+ * also make sure we report an error when trying to use features
+ * that are not implemented by SMMUv3 */
+
+ if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("iommu: interrupt remapping is not supported "
+ "with this QEMU binary"));
+ return -1;
+ }
+ if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("iommu: caching mode is not supported "
+ "with this QEMU binary"));
+ return -1;
+ }
+ if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("iommu: eim is not supported "
+ "with this QEMU binary"));
+ return -1;
+ }
+ if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("iommu: device IOTLB is not supported "
+ "with this QEMU binary"));
+ return -1;
+ }
+
return 0;
}