Linux IOMMU Development
 help / color / mirror / Atom feed
From: Vasant Hegde <vashegde@amd.com>
To: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Hegde, Vasant" <Vasant.Hegde@amd.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"joro@8bytes.org" <joro@8bytes.org>
Cc: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	Eric Wagner <ewagner12@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"stable@kernel.org" <stable@kernel.org>
Subject: Re: [PATCH] iommu/amd: Enhance def_domain_type to handle untrusted device
Date: Tue, 23 Apr 2024 15:41:35 +0530	[thread overview]
Message-ID: <52c162ae-a66a-4e73-a953-22da43c30390@amd.com> (raw)
In-Reply-To: <BL1PR12MB514484CC63FA4A5193A6C580F70D2@BL1PR12MB5144.namprd12.prod.outlook.com>

Alex,


On 4/19/2024 8:54 PM, Deucher, Alexander wrote:
> [Public]
> 
>> -----Original Message-----
>> From: Hegde, Vasant <Vasant.Hegde@amd.com>
>> Sent: Friday, April 19, 2024 7:47 AM
>> To: iommu@lists.linux.dev; joro@8bytes.org
>> Cc: Suthikulpanit, Suravee <Suravee.Suthikulpanit@amd.com>; Deucher,
>> Alexander <Alexander.Deucher@amd.com>; Hegde, Vasant
>> <Vasant.Hegde@amd.com>; Eric Wagner <ewagner12@gmail.com>; Robin
>> Murphy <robin.murphy@arm.com>; Jason Gunthorpe <jgg@ziepe.ca>;
>> stable@kernel.org
>> Subject: [PATCH] iommu/amd: Enhance def_domain_type to handle
>> untrusted device
>>
>> 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 sstate.
>>
>> This patch adds untrusted check in AMD IOMMU driver code. So that it lets
>> eGPUs behind Thunderbolt work again.
>>
>> Fine tuning amd_iommu_def_domain_type() will be done later.
>>
>> Reported-by: Eric Wagner <ewagner12@gmail.com>
>> Link: https://lore.kernel.org/linux-iommu/CAHudX3zLH6CsRmLE-yb+gRjhh-
>> v4bU5_1jW_xCcxOo_oUUZKYg@mail.gmail.com
>> Fixes: 59ddce4418da ("iommu: Reorganize
>> iommu_get_default_domain_type() to respect def_domain_type()")
>> Cc: Robin Murphy <robin.murphy@arm.com>
>> Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> Cc: stable@kernel.org # v6.7+
>> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
> 
> Assuming it fixes the issue, please add:
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3182

Sure. Will add it in v2.

-Vasant


  reply	other threads:[~2024-04-23 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 11:47 [PATCH] iommu/amd: Enhance def_domain_type to handle untrusted device Vasant Hegde
2024-04-19 12:12 ` Jason Gunthorpe
2024-04-19 15:24 ` Deucher, Alexander
2024-04-23 10:11   ` Vasant Hegde [this message]
2024-04-19 18:14 ` Eric Wagner
2024-04-21  1:45 ` Baolu Lu
2024-04-23 10:10   ` Vasant Hegde

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=52c162ae-a66a-4e73-a953-22da43c30390@amd.com \
    --to=vashegde@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=Vasant.Hegde@amd.com \
    --cc=ewagner12@gmail.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@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