提交 60f4c413 编写于 作者: A Andrea Bolognani

conf: Parse and format SMMUv3 IOMMU

SMMUv3 is an IOMMU implementation for ARM virt guests.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 124eb803
......@@ -8675,14 +8675,17 @@ qemu-kvm -net nic,model=? /dev/null
<dt><code>model</code></dt>
<dd>
<p>
Currently only the <code>intel</code> model is supported.
Supported values are <code>intel</code> (for Q35 guests) and,
<span class="since">since 5.5.0</span>, <code>smmuv3</code> (for
ARM virt guests).
</p>
</dd>
<dt><code>driver</code></dt>
<dd>
<p>
The <code>driver</code> subelement can be used to configure
additional options:
additional options, some of which might only be available for
certain IOMMU models:
</p>
<dl>
<dt><code>intremap</code></dt>
......
......@@ -4375,7 +4375,10 @@
<define name="iommu">
<element name="iommu">
<attribute name="model">
<value>intel</value>
<choice>
<value>intel</value>
<value>smmuv3</value>
</choice>
</attribute>
<optional>
<element name="driver">
......
......@@ -1122,6 +1122,7 @@ VIR_ENUM_IMPL(virDomainTPMVersion,
VIR_ENUM_IMPL(virDomainIOMMUModel,
VIR_DOMAIN_IOMMU_MODEL_LAST,
"intel",
"smmuv3",
);
VIR_ENUM_IMPL(virDomainVsockModel,
......
......@@ -2296,6 +2296,7 @@ struct _virDomainSEVDef {
typedef enum {
VIR_DOMAIN_IOMMU_MODEL_INTEL,
VIR_DOMAIN_IOMMU_MODEL_SMMUV3,
VIR_DOMAIN_IOMMU_MODEL_LAST
} virDomainIOMMUModel;
......
......@@ -6967,6 +6967,9 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd,
break;
}
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
break;
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
......@@ -7612,6 +7615,10 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU))
virBufferAddLit(&buf, ",iommu=on");
break;
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
break;
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, def->iommu->model);
......
......@@ -6135,6 +6135,9 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMMUDef *iommu,
}
break;
case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
break;
case VIR_DOMAIN_IOMMU_MODEL_LAST:
default:
virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
......
LC_ALL=C \
PATH=/bin \
HOME=/tmp/lib/domain--1-guest \
USER=test \
LOGNAME=test \
XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
QEMU_AUDIO_DRV=none \
/usr/bin/qemu-system-aarch64 \
-name guest=guest,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-guest/master-key.aes \
-machine virt,accel=tcg,usb=off,dump-guest-core=off,gic-version=2 \
-m 1024 \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=1729,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
-no-acpi \
-boot strict=on \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
<domain type='qemu'>
<name>guest</name>
<uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
<memory unit='KiB'>1048576</memory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
</os>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<controller type='usb' model='none'/>
<memballoon model='none'/>
<iommu model='smmuv3'/>
</devices>
</domain>
......@@ -2813,6 +2813,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("intel-iommu-eim");
DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb");
DO_TEST_PARSE_ERROR("intel-iommu-wrong-machine", NONE);
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64");
DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
DO_TEST_PARSE_ERROR("cpu-hotplug-granularity",
......
<domain type='qemu'>
<name>guest</name>
<uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<gic version='2'/>
</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-aarch64</emulator>
<controller type='usb' index='0' model='none'/>
<controller type='pci' index='0' model='pcie-root'/>
<memballoon model='none'/>
<iommu model='smmuv3'/>
</devices>
</domain>
......@@ -1207,6 +1207,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
DO_TEST_CAPS_LATEST("intel-iommu-eim");
DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb");
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64");
DO_TEST("cpu-check-none", NONE);
DO_TEST("cpu-check-partial", NONE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册