On Thu, Sep 12, 2024 at 06:17:29AM -0700, Yi Liu wrote:
> @@ -1242,6 +1245,28 @@ int iommufd_get_hw_info(struct iommufd_ucmd *ucmd)
>       if (device_iommu_capable(idev->dev, IOMMU_CAP_DIRTY_TRACKING))
>               cmd->out_capabilities |= IOMMU_HW_CAP_DIRTY_TRACKING;
>  
> +     cmd->out_max_pasid_log2 = 0;
> +
> +     if (dev_is_pci(idev->dev)) {
> +             struct pci_dev *pdev = to_pci_dev(idev->dev);
> +             int ctrl;
> +
> +             if (pdev->is_virtfn)
> +                     pdev = pci_physfn(pdev);

Don't we do this twice now?

Let's just keep it in the pci core?

It looks Ok otherwise

Reviewed-by: Jason Gunthorpe <j...@nvidia.com>

Jason

Reply via email to