From 80d28ccdb99de4f256f03977471dbf6544bb0df8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker Date: Fri, 10 Dec 2021 17:04:11 +0000 Subject: [PATCH] hw/arm/virt: Reject instantiation of multiple IOMMUs We do not support instantiating multiple IOMMUs. Before adding a virtio-iommu, check that no other IOMMU is present. This will detect both "iommu=smmuv3" machine parameter and another virtio-iommu instance. Fixes: 70e89132c9 ("hw/arm/virt: Add the virtio-iommu device tree mappings") Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed-off-by: Jean-Philippe Brucker Message-id: 20211210170415.583179-4-jean-philippe@linaro.org Signed-off-by: Peter Maydell --- hw/arm/virt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e621cada99..41c9808a3f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2493,6 +2493,11 @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, hwaddr db_start = 0, db_end = 0; char *resv_prop_str; + if (vms->iommu != VIRT_IOMMU_NONE) { + error_setg(errp, "virt machine does not support multiple IOMMUs"); + return; + } + switch (vms->msi_controller) { case VIRT_MSI_CTRL_NONE: return;