All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Vasant Hegde <vashegde@amd.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	iommu@lists.linux.dev, joro@8bytes.org,
	suravee.suthikulpanit@amd.com, alexander.deucher@amd.com,
	baolu.lu@linux.intel.com, Eric Wagner <ewagner12@gmail.com>,
	stable@kernel.org
Subject: Re: [PATCH v2] iommu/amd: Enhance def_domain_type to handle untrusted device
Date: Wed, 24 Apr 2024 10:08:49 -0300	[thread overview]
Message-ID: <20240424130849.GG231144@ziepe.ca> (raw)
In-Reply-To: <c255ccb1-68ac-485b-807e-a4c38786f116@amd.com>

On Wed, Apr 24, 2024 at 01:41:57PM +0530, Vasant Hegde wrote:
> Hi Robin,
> 
> 
> On 4/23/2024 4:56 PM, Robin Murphy wrote:
> > On 23/04/2024 12:17 pm, Vasant Hegde wrote:
> >> Previously, IOMMU core layer was forcing IOMMU_DOMAIN_DMA domain for
> >> untrusted device. This always took precedence over driver's
> >> def_domain_type(). Commit 59ddce4418da ("iommu: Reorganize
> >> iommu_get_default_domain_type() to respect def_domain_type()") changed
> >> the behaviour. Current code calls def_domain_type() but if it doesn't
> >> return IOMMU_DOMAIN_DMA for untrusted device it throws error. This
> >> results in IOMMU group (and potentially IOMMU itself) in undetermined
> >> state.
> >>
> >> This patch adds untrusted check in AMD IOMMU driver code. So that it
> >> allows eGPUs behind Thunderbolt work again.
> > 
> > Sorry, but I firmly disagree with this approach - regardless of what the AMD
> > driver is currently doing and how appropriate it may or may not be, we should
> > not be duplicating core code policy in drivers, 

Then AMD should remove the PASID stuff from def_domain_type and we
need to fix it with properly designed core support for this limitation
before merging the SVA support.

> > and we certainly shouldn't be
> > doing so to bodge around a breakage in how the core code implements said policy.

It isn't breakage. It is evolution of the API.

Hacking in the AMD driver is temprary and Vasant will eventually fix
it. Regressing the core code to go back to allowing drivers to inform
policy is much harder to undo.

Jason

  reply	other threads:[~2024-04-24 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 11:17 [PATCH v2] iommu/amd: Enhance def_domain_type to handle untrusted device Vasant Hegde
2024-04-23 11:26 ` Robin Murphy
2024-04-24  8:11   ` Vasant Hegde
2024-04-24 13:08     ` Jason Gunthorpe [this message]
2024-04-26 10:11 ` 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=20240424130849.GG231144@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alexander.deucher@amd.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=ewagner12@gmail.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=vashegde@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.