<span class="since">Since 3.4.0</span> (QEMU/KVM only)
</p>
</dd>
+ <dt><code>iotlb</code></dt>
+ <dd>
+ <p>
+ The <code>iotlb</code> attribute with possible values
+ <code>on</code> and <code>off</code> can be used to
+ turn on the IOTLB used to cache address translation
+ requests from devices.
+ <span class="since">Since 3.5.0</span> (QEMU/KVM only)
+ </p>
+ </dd>
</dl>
</dd>
</dl>
<ref name="virOnOff"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="iotlb">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
</element>
</optional>
</element>
}
iommu->caching_mode = val;
}
+ VIR_FREE(tmp);
+ if ((tmp = virXPathString("string(./driver/@iotlb)", ctxt))) {
+ if ((val = virTristateSwitchTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR, _("unknown iotlb value: %s"), tmp);
+ goto cleanup;
+ }
+ iommu->iotlb = val;
+ }
VIR_FREE(tmp);
if ((tmp = virXPathString("string(./driver/@eim)", ctxt))) {
virTristateSwitchTypeToString(src->eim));
return false;
}
+ if (src->iotlb != dst->iotlb) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target domain IOMMU device iotlb value '%s' "
+ "does not match source '%s'"),
+ virTristateSwitchTypeToString(dst->iotlb),
+ virTristateSwitchTypeToString(src->iotlb));
+ return false;
+ }
return true;
}
virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2);
if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT ||
- iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT) {
+ iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT) {
virBufferAddLit(&childBuf, "<driver");
if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT) {
virBufferAsprintf(&childBuf, " intremap='%s'",
virBufferAsprintf(&childBuf, " eim='%s'",
virTristateSwitchTypeToString(iommu->eim));
}
+ if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&childBuf, " iotlb='%s'",
+ virTristateSwitchTypeToString(iommu->iotlb));
+ }
virBufferAddLit(&childBuf, "/>\n");
}
virTristateSwitch intremap;
virTristateSwitch caching_mode;
virTristateSwitch eim;
+ virTristateSwitch iotlb;
};
/*
* Guest VM main configuration
--- /dev/null
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <ioapic driver='qemu'/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ <iommu model='intel'>
+ <driver intremap='on' iotlb='on'/>
+ </iommu>
+ </devices>
+</domain>
--- /dev/null
+../qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml
\ No newline at end of file
DO_TEST("intel-iommu-ioapic", NONE);
DO_TEST("intel-iommu-caching-mode", NONE);
DO_TEST("intel-iommu-eim", NONE);
+ DO_TEST("intel-iommu-device-iotlb", NONE);
DO_TEST("cpu-check-none", NONE);
DO_TEST("cpu-check-partial", NONE);