[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/8] hw/arm/virt: Reject instantiation of multiple IOMMUs
From: |
Jean-Philippe Brucker |
Subject: |
[PATCH v2 5/8] hw/arm/virt: Reject instantiation of multiple IOMMUs |
Date: |
Fri, 3 Sep 2021 16:32:06 +0200 |
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.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
hw/arm/virt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b4598d3fe6..5ca225291f 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2475,6 +2475,11 @@ static void virt_machine_device_plug_cb(HotplugHandler
*hotplug_dev,
if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
PCIDevice *pdev = PCI_DEVICE(dev);
+ if (vms->iommu != VIRT_IOMMU_NONE) {
+ error_setg(errp, "virt machine does not support multiple IOMMUs");
+ return;
+ }
+
vms->iommu = VIRT_IOMMU_VIRTIO;
vms->virtio_iommu_bdf = pci_get_bdf(pdev);
create_virtio_iommu_dt_bindings(vms);
--
2.33.0
- [PATCH v2 0/8] virtio-iommu: Add ACPI support, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 1/8] acpi: Add VIOT structure definitions, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 3/8] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 2/8] hw/acpi: Add VIOT table, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 5/8] hw/arm/virt: Reject instantiation of multiple IOMMUs,
Jean-Philippe Brucker <=
- [PATCH v2 4/8] hw/arm/virt: Remove device tree restriction for virtio-iommu, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 6/8] pc: Add VIOT table for virtio-iommu, Jean-Philippe Brucker, 2021/09/03
- [PATCH v2 8/8] docs: Add '-device virtio-iommu' entry, Jean-Philippe Brucker, 2021/09/03