[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for vir
From: |
Eric Auger |
Subject: |
Re: [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu |
Date: |
Tue, 5 Oct 2021 13:57:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
Hi Jean,
On 10/1/21 7:33 PM, Jean-Philippe Brucker wrote:
> virtio-iommu is now supported with ACPI VIOT as well as device tree.
> Remove the restriction that prevents from instantiating a virtio-iommu
> device under ACPI.
>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
> hw/arm/virt.c | 10 ++--------
> hw/virtio/virtio-iommu-pci.c | 7 -------
> 2 files changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 1d59f0e59f..56e8fc7059 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2561,16 +2561,10 @@ static HotplugHandler
> *virt_machine_get_hotplug_handler(MachineState *machine,
> MachineClass *mc = MACHINE_GET_CLASS(machine);
>
> if (device_is_dynamic_sysbus(mc, dev) ||
> - (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM))) {
> + object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) ||
> + object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
> return HOTPLUG_HANDLER(machine);
> }
> - if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
> - VirtMachineState *vms = VIRT_MACHINE(machine);
> -
> - if (!vms->bootinfo.firmware_loaded || !virt_is_acpi_enabled(vms)) {
> - return HOTPLUG_HANDLER(machine);
> - }
> - }
> return NULL;
> }
>
> diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c
> index 770c286be7..f30eb16cbf 100644
> --- a/hw/virtio/virtio-iommu-pci.c
> +++ b/hw/virtio/virtio-iommu-pci.c
> @@ -48,16 +48,9 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy
> *vpci_dev, Error **errp)
> VirtIOIOMMU *s = VIRTIO_IOMMU(vdev);
>
> if (!qdev_get_machine_hotplug_handler(DEVICE(vpci_dev))) {
> - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
> -
> - error_setg(errp,
> - "%s machine fails to create iommu-map device tree
> bindings",
> - mc->name);
actually this does not work. To add a hint you need the *errp to be set.
Otherwise when running through this path you will get
emu-system-x86_64: ../util/error.c:158: error_append_hint: Assertion
`err && errp != &error_abort && errp != &error_fatal' failed.
replace the error_append_hint with an error_setg (without the \n)
Thanks
Eric
> error_append_hint(errp,
> "Check your machine implements a hotplug handler "
> "for the virtio-iommu-pci device\n");
> - error_append_hint(errp, "Check the guest is booted without FW or
> with "
> - "-no-acpi\n");
> return;
> }
> for (int i = 0; i < s->nb_reserved_regions; i++) {
- [PATCH v4 00/11] virtio-iommu: Add ACPI support, Jean-Philippe Brucker, 2021/10/01
- [PATCH v4 01/11] hw/acpi: Add VIOT table, Jean-Philippe Brucker, 2021/10/01
- [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu, Jean-Philippe Brucker, 2021/10/01
- Re: [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu,
Eric Auger <=
- [PATCH v4 05/11] hw/arm/virt: Use object_property_set instead of qdev_prop_set, Jean-Philippe Brucker, 2021/10/01
- [PATCH v4 04/11] hw/arm/virt: Reject instantiation of multiple IOMMUs, Jean-Philippe Brucker, 2021/10/01
- [PATCH v4 07/11] pc: Allow instantiating a virtio-iommu device, Jean-Philippe Brucker, 2021/10/01