Re: [PATCH v6 13/13] iommu/amd: Add support for nested domain attach/detach

Jason Gunthorpe
2026-01-19T17:15:38Z

On Thu, Jan 15, 2026 at 06:08:14AM +0000, Suravee Suthikulpanit wrote:
> +static int nested_attach_device(struct iommu_domain *dom, struct device *dev,
> + struct iommu_domain *old)
> +{
> + struct dev_table_entry new = {0};
> + struct iommu_dev_data *dev_data = dev_iommu_priv_get(dev);
> + struct amd_iommu *iommu = get_amd_iommu_from_dev_data(dev_data);
> + int ret = 0;
> +
> + /*
> + * Needs to make sure PASID is not enabled
> + * for this attach path.
> + */
> + if (WARN_ON(dev_data->pasid_enabled))
> + return -EINVAL;

Well, that's one way, but a rather big hammer as we do want to support
assigning PASID capable functions to VMs.

You have it on your list to fix it up properly?

Jason