> -----Original Message-----
> From: Nicolin Chen <nicol...@nvidia.com>
> Sent: Friday, May 2, 2025 6:55 PM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.th...@huawei.com>
> Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org;
> eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com;
> ddut...@redhat.com; berra...@redhat.com; nath...@nvidia.com;
> mo...@nvidia.com; smost...@google.com; Linuxarm
> <linux...@huawei.com>; Wangzhou (B) <wangzh...@hisilicon.com>;
> jiangkunkun <jiangkun...@huawei.com>; Jonathan Cameron
> <jonathan.came...@huawei.com>; zhangfei....@linaro.org
> Subject: Re: [PATCH v2 5/6] hw/arm/virt: Add support for smmuv3 device
> 
> On Fri, May 02, 2025 at 11:27:06AM +0100, Shameer Kolothum wrote:
> > @@ -2972,6 +3004,21 @@ static void
> virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
> >          virtio_md_pci_plug(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev),
> errp);
> >      }
> >
> > +    if (object_dynamic_cast(OBJECT(dev), TYPE_ARM_SMMUV3)) {
> 
> This seems to be on the path of a hotplug function? Mind elaborating
> why, while PATCH-1 sets hotpluggable to false?

Not really. Qemu has this path for both cold plug case(which is before the Guest
is booted, ie, -device arm-smmuv3, case) and for hot plug case (where we try to
add the device after Guest is booted, ie,  device_add arm-smmuv3, case).

We are preventing only the hot plug case.

> 
> > +        if (!vms->legacy_smmuv3_present && vms->platform_bus_dev) {
> > +            VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
> > +
> > +            create_smmuv3_dev_dtb(vms, dev);
> > +            if (vms->iommu != VIRT_IOMMU_SMMUV3) {
> 
> Should this be VIRT_IOMMU_NONE only as the other cases are rejected?

The check is basically to handle cases where we will have multiple SMMUv3 
devices
and to set this only once.

Thanks,
Shameer

Reply via email to