On Tue, Jul 08, 2025 at 04:40:45PM +0100, Shameer Kolothum wrote:
> @@ -937,11 +939,32 @@ static void smmu_base_realize(DeviceState *dev, Error 
> **errp)
>                                       g_free, g_free);
>      s->smmu_pcibus_by_busptr = g_hash_table_new(NULL, NULL);

Although this is not introduced by this patch, is there a
g_hash_table_remove() somewhere in the code?

> +    /*
> +     * We only allow default PCIe Root Complex(pcie.0) or pxb-pcie based 
> extra
> +     * root complexes to be associated with SMMU.
> +     */
> +    if (pci_bus_is_express(pci_bus) && pci_bus_is_root(pci_bus) &&
> +        object_dynamic_cast(OBJECT(pci_bus)->parent, TYPE_PCI_HOST_BRIDGE)) {
> +        /*
> +         * For pxb-pcie, parent_dev will be set. Make sure it is
> +         * pxb-pcie indeed.
> +         */
> +        if (pci_bus->parent_dev) {
> +            if (!object_dynamic_cast(OBJECT(pci_bus), TYPE_PXB_PCIE_BUS)) {

The pci_bus_is_express(pci_bus) at the top is equivalent to:
        object_dynamic_cast(OBJECT(pci_bus), TYPE_PCIE_BUS)
Then here it is doing:
        object_dynamic_cast(OBJECT(pci_bus), TYPE_PXB_PCIE_BUS)

So, this checks the same pci_bus but expects two different types?

I don't see the code check "PCIe Root Complex" explicitly, which
should be TYPE_GPEX_HOST?

Thanks
Nicolin

Reply via email to