Re: [PATCH v5] iommu/amd: Enable PerfOpt automatically for integrated GPUs

From: Vasant Hegde

Date: Mon Nov 02 2026 - 10:55:28 EST




On 10/23/2026 2:16 AM, Mario Limonciello (AMD) wrote:
> PerfOpt is usable by integrated GPUs in identity mode. Enable it from
> the IOMMU driver's domain attachment paths instead of requiring an
> amdgpu policy knob and exported enable/disable interfaces.
>
> Mark supported integrated GPUs as PerfOpt-eligible when selecting their
> default identity domain. Skip GCR3 setup and ATS/PRI/PASID enablement for
> these identity attachments, then enable PerfOpt after installing the DTE.
> Clear PerfOpt before attaching an eligible GPU to a translated or blocked
> domain, including unmanaged domains used by VFIO. Propagate failures to
> clear bypass, but keep a completed identity attachment successful if the
> optional PerfOpt enable fails.
>
> Clear inherited PerfOpt state during initialization, including when a crash
> kernel reuses device tables. Read feature support directly from hardware
> because cached features may not be available yet, and stop initialization
> if the initial clear fails.
>
> Each IOMMU has at most one PerfOpt-eligible GPU, so track activation with a
> boolean under the IOMMU lock. Preserve this state while clearing hardware
> at suspend and shutdown, and restore the bit on resume only where it was
> active. Do not enable PerfOpt unconditionally during early IOMMU
> initialization.
>
> Remove the amdgpu parameter, driver callbacks, and exported interfaces.
> Translated attachments retain their normal device capability setup.
>
> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxx>
> Signed-off-by: Mario Limonciello (AMD) <superm1@xxxxxxxxxx>

Looks good. Queued for rc.


-Vasant