qemu: Add IOMMU device alias to command line

Note that we can only do this for intel-iommu and virtio-iommu,
which are configured using -device; smmuv3 is configured using
a machine type property, so there's no room on the command line
for an alias in that case.

https://bugzilla.redhat.com/show_bug.cgi?id=2108483

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2022-07-21 11:14:21 +02:00
parent 0ee76b1dfa
commit 5105409614
8 changed files with 9 additions and 7 deletions

View File

@ -6441,6 +6441,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
if (virJSONValueObjectAdd(&props,
"s:driver", "intel-iommu",
"s:id", iommu->info.alias,
"S:intremap", qemuOnOffAuto(iommu->intremap),
"T:caching-mode", iommu->caching_mode,
"S:eim", qemuOnOffAuto(iommu->eim),
@ -6457,6 +6458,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
if (virJSONValueObjectAdd(&props,
"s:driver", "virtio-iommu",
"s:id", iommu->info.alias,
NULL) < 0) {
return -1;
}

View File

@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"intel-iommu","intremap":"on","aw-bits":48}' \
-device '{"driver":"intel-iommu","id":"iommu0","intremap":"on","aw-bits":48}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"intel-iommu","intremap":"on","caching-mode":true}' \
-device '{"driver":"intel-iommu","id":"iommu0","intremap":"on","caching-mode":true}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"intel-iommu","intremap":"on","device-iotlb":true}' \
-device '{"driver":"intel-iommu","id":"iommu0","intremap":"on","device-iotlb":true}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"intel-iommu","intremap":"on","eim":"on"}' \
-device '{"driver":"intel-iommu","id":"iommu0","intremap":"on","eim":"on"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"intel-iommu"}' \
-device '{"driver":"intel-iommu","id":"iommu0"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
-device '{"driver":"virtio-iommu","bus":"pcie.0","addr":"0x1"}' \
-device '{"driver":"virtio-iommu","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
-device '{"driver":"virtio-iommu","bus":"pcie.0","addr":"0x1"}' \
-device '{"driver":"virtio-iommu","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on