AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>,
	Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Joerg Roedel <joro@8bytes.org>,
	 amd-gfx@lists.freedesktop.org,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	"open list:AMD IOMMU (AMD-VI)" <iommu@lists.linux.dev>,
	Jatin Kataria <jkataria@netflix.com>,
	Boqun Feng <boqunf@netflix.com>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>
Subject: Re: [PATCH v2 1/2] iommu/amd: Add PerfOpt IOMMU performance optimization support
Date: Thu, 24 Sep 2026 19:03:56 -0500	[thread overview]
Message-ID: <5a6ba6f3-4d8b-4d67-8e5a-ffbe22126464@kernel.org> (raw)
In-Reply-To: <20260924225018.GB16465@ziepe.ca>



On 9/24/26 5:50 PM, Jason Gunthorpe wrote:
> On Mon, Sep 07, 2026 at 11:12:06PM -0500, Mario Limonciello wrote:
>> +EXPORT_SYMBOL_GPL(amd_iommu_enable_perfopt);
> 
> Last time we hardwired the GPU and IOMMU drivers together it was a
> huge mess to undo.
> 
> Why does the GPU driver have to request this? Why can't the iommu
> driver know that this is a special device that can use this magic fast
> path and then auto set it when identity is asked for?

The reason was to allow an "opt-out" path on the GPU driver.

> 
> How does the GPU driver even know it is magic special?

See patch 2/2.  GPU driver looks if it's an APU and it's in identity 
mode.  The special mode is only for the GPU in an APU.  It shouldn't be 
applied to anything else.
> 
>> +	/*
>> +	 * Restore ATS/PRI/PASID (and thus SVA) by re-homing the device onto its
>> +	 * identity domain with the flag cleared, so a later bind without PerfOpt
>> +	 * sees a normally-capable device. See the locking note in
>> +	 * amd_iommu_enable_perfopt().
>> +	 */
> 
> And this is sort of a wrong thing in the driver, it shouldn't have ATS
> turned on for identitiy mappings, and it certainly shouldn't have PRI
> turned on until a PRI capable domain is attached.
> 
> Jason
> 

amd_iommu_disable_perfopt() only re-applies the policy that was 
previously set before PerfOpt.

If you would like I'll send a follow up patch to clarify this comment.

  reply	other threads:[~2026-09-25  0:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  4:12 [PATCH v2 0/2] IOMMU Performance Optimization support Mario Limonciello
2026-09-08  4:12 ` [PATCH v2 1/2] iommu/amd: Add PerfOpt IOMMU performance optimization support Mario Limonciello
2026-09-24 22:50   ` Jason Gunthorpe
2026-09-25  0:03     ` Mario Limonciello [this message]
2026-09-25  0:17       ` Jason Gunthorpe
2026-09-25  0:21         ` Mario Limonciello
2026-09-25  7:20     ` Joerg Roedel
2026-09-25 12:28       ` Jason Gunthorpe
2026-09-25 13:11         ` Mario Limonciello
2026-09-25 22:39           ` Jason Gunthorpe
2026-09-26  0:33             ` Mario Limonciello
2026-09-28 12:08               ` Jason Gunthorpe
2026-09-28 15:32                 ` Mario Limonciello
2026-09-28 17:11                   ` Jason Gunthorpe
2026-09-28 17:15                     ` Mario Limonciello
2026-09-29  2:53                       ` Deucher, Alexander
2026-09-28  5:17     ` Christoph Hellwig
2026-09-25  7:30   ` Joerg Roedel
2026-09-08  4:12 ` [PATCH v2 2/2] drm/amdgpu: Enable PerfOpt IOMMU perf optimization when GPU in identity domain Mario Limonciello
2026-09-20 14:10 ` [PATCH v2 0/2] IOMMU Performance Optimization support Mario Limonciello
2026-09-20 16:27 ` Boqun Feng
2026-09-24 11:42 ` Joerg Roedel
2026-09-24 13:01   ` Deucher, Alexander
2026-09-24 13:50     ` Joerg Roedel

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=5a6ba6f3-4d8b-4d67-8e5a-ffbe22126464@kernel.org \
    --to=superm1@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=boqunf@netflix.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jkataria@netflix.com \
    --cc=joro@8bytes.org \
    --cc=mario.limonciello@amd.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    /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