mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Vasant Hegde <vasant.hegde@amd.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Alex Deucher <alexander.deucher@amd.com>,
	Joerg Roedel <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux.dev
Subject: Re: [PATCH v5] iommu/amd: Enable PerfOpt automatically for integrated GPUs
Date: Wed, 18 Nov 2026 12:54:23 -0600	[thread overview]
Message-ID: <73224e5f-e47e-49d7-aa41-8bd1338c831c@kernel.org> (raw)
In-Reply-To: <179502782208.3845434.3028303849229899926.b4-review@b4>

On 11/18/26 12:50, Jason Gunthorpe 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@ziepe.ca>
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>> Changes in v5:
>>   * Enable PerfOpt after identity attachment instead of during early IOMMU init
>>   * Clear PerfOpt before translated or blocked attachments, allowing VFIO use
>>   * Drop require_direct and retain normal capability setup for translated domains
>>   * Replace refcounting with a per-IOMMU activation boolean protected by its lock
>>   * Clear inherited PerfOpt during init, including crash-kernel device-table reuse
>>   * Read hardware feature support before cached features are available and fail
>>     initialization if the initial clear fails
>>   * Preserve activation across suspend and restore it on resume only if active
>>   * Keep identity attachment successful if optional PerfOpt enablement fails
>>   * Link to v4: https://lore.kernel.org/linux-iommu/20261001182410.1525285-1-superm1@kernel.org/
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |   1 -
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  50 ------
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    |  12 --
>>   drivers/iommu/amd/amd_iommu.h              |   3 +-
>>   drivers/iommu/amd/amd_iommu_types.h        |   6 +-
>>   drivers/iommu/amd/init.c                   |  91 ++++++-----
>>   drivers/iommu/amd/iommu.c                  | 252 +++++------------------------
>>   include/linux/amd-iommu.h                  |  11 --
>>   8 files changed, 95 insertions(+), 331 deletions(-)
> 
> Vasant are you going to pick this up? It seems good to me
> 
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> 

FWIW - it was picked up in b32ecac779bba6e7ac7caeae8c40db4280941634.

      reply	other threads:[~2026-11-18 18:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 20:46 Mario Limonciello (AMD)
2026-11-02 14:56 ` Vasant Hegde
2026-11-05 10:25   ` Vasant Hegde
2026-11-05 15:25     ` Deucher, Alexander
2026-11-18 18:50 ` Jason Gunthorpe
2026-11-18 18:54   ` Mario Limonciello [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73224e5f-e47e-49d7-aa41-8bd1338c831c@kernel.org \
    --to=superm1@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®