On Tue, Jul 08, 2025 at 04:40:45PM +0100, Shameer Kolothum wrote:
> We only allow default PCIe Root Complex(pcie.0) or pxb-pcie based extra
> root complexes to be associated with SMMU.
> 
> Although this change does not affect functionality at present, it is
> required when we add support for user-creatable SMMUv3 devices in
> future patches.
> 
> Note: Added a specific check to identify pxb-pcie to avoid matching
> pxb-cxl host bridges, which are also of type PCI_HOST_BRIDGE. This
> restriction can be relaxed once support for CXL devices on arm/virt
> is added and validated with SMMUv3.
> 
> Reviewed-by: Jonathan Cameron <jonathan.came...@huawei.com>
> Reviewed-by: Eric Auger <eric.au...@redhat.com>
> Tested-by: Nathan Chen <nath...@nvidia.com>
> Tested-by: Eric Auger <eric.au...@redhat.com> 
> Signed-off-by: Shameer Kolothum <shameerali.kolothum.th...@huawei.com>

Reviewed-by: Nicolin Chen <nicol...@nvidia.com>

With a small suggestion for clarification.

> +    /*
> +     * 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.
> +         */

        /*
         * While pcie.0 doesn't set the parent_dev, either pxb-pcie or pxb-cxl
         * does. Re-test the type to make sure it is pxb-pcie indeed.
         */

> +        if (pci_bus->parent_dev) {
> +            if (!object_dynamic_cast(OBJECT(pci_bus), TYPE_PXB_PCIE_BUS)) {
> +                goto out_err;

Reply via email to