[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 04/10] hw/arm/virt: Reject instantiation of multiple IOMMU
From: |
Eric Auger |
Subject: |
Re: [PATCH v3 04/10] hw/arm/virt: Reject instantiation of multiple IOMMUs |
Date: |
Thu, 16 Sep 2021 14:45:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
Hi Jean,
On 9/14/21 4:19 PM, Jean-Philippe Brucker wrote:
> 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 <eric.auger@redhat.com>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Tested-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> hw/arm/virt.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index f238766aa1..26069f943a 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2471,6 +2471,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);
- [PATCH v3 00/10] virtio-iommu: Add ACPI support, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 01/10] hw/acpi: Add VIOT table, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 03/10] hw/arm/virt: Remove device tree restriction for virtio-iommu, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 09/10] tests/acpi: add expected DSDT blob for VIOT test on q35, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 08/10] tests/acpi: add expected VIOT blob for virt machine, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 02/10] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 04/10] hw/arm/virt: Reject instantiation of multiple IOMMUs, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 05/10] pc: Allow instantiating a virtio-iommu device, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 10/10] tests/acpi: add expected VIOT blob for q35 machine, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 06/10] tests/acpi: allow updates of VIOT expected data files, Jean-Philippe Brucker, 2021/09/14
- [PATCH v3 07/10] tests/acpi: add test cases for VIOT, Jean-Philippe Brucker, 2021/09/14