Re: [PATCH v3] iommu/amd: Make PerfOpt compulsory
From: Vasant Hegde
Date: Thu Oct 01 2026 - 07:35:11 EST
On 10/1/2026 4:10 AM, Jason Gunthorpe wrote:
>> [ ... 336 lines skipped ... ]
>> @@ -2370,7 +2370,7 @@ static int attach_device(struct device *dev,
>> if (ret)
>> goto out;
>>
>> - if (dev_data->perfopt)
>> + if (dev_data->perfopt && pdom_is_in_pt_mode(domain))
>> goto skip_caps;
>
> This should also disable PASID support since without a gcr3 table
> that's broken. Set the max_pasid to zero during probe device.
I think we can add it inside amd_iommu_probe_device().
>
> The flow is weird like this because the driver still hasn't cleaned up
> the identity/blocking domain flows. There is no need to track them in
> lists and things because they never need invalidation..
Right. attach_device path cleanup is in my list. Now that _probe() path is
settled (thanks to Pranjal), this is probably next item to pick up.
>
> This is much nicer if the above could be written in side
> amd_iommu_identity_attach().
I'd say for now its fine to keep it in attach_device() as it gets called anyway.
When I rework, will make sure its moved under amd_iommu_identity_attach().
>
> Also, I'm a little confused, I thought this had to be toggled on and
> off so it is only set while in identity, how does the DTE influence
> what happens when in this special mode? I was sort of expecting it was
> ignored entirely in HW. This version seems to lock it to always on,
> but still permits a blocking domain to attach.
>
Mario, Can you check what happens if we move device to BLOCKED domain (DTE[v]=0) ?
-Vasant