Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Kuehling, Felix" <felix.kuehling@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org,
	linux-pci@vger.kernel.org, will@kernel.org, robin.murphy@arm.com,
	suravee.suthikulpanit@amd.com, bhelgaas@google.com,
	Amandeep Kaur Longia <AmandeepKaur.Longia@amd.com>
Subject: Re: [PATCH 2/2] iommu/amd: Force identity mode for selected GPUs only
Date: Tue, 28 Jul 2026 14:57:55 -0500	[thread overview]
Message-ID: <bacdf160-8ab2-4bd6-aa9d-ab63b16527fa@amd.com> (raw)
In-Reply-To: <2f400c7f-eada-45e3-9079-7b5727ecb5c3@amd.com>



On 7/28/26 14:10, Kuehling, Felix wrote:
> On 2026-07-28 01:31, Mario Limonciello wrote:
>> +Felix
>>
>> On 7/27/26 23:52, Vasant Hegde wrote:
>>> Mario,
>>>
>>>
>>> On 7/27/2026 8:15 PM, Mario Limonciello wrote:
>>>>
>>>>
>>>> On 7/26/26 23:19, Vasant Hegde wrote:
>>>>>
>>>>>
>>>
>>> .../...
>>>
>>>>>>
>>>>>> I think this can probably be dropped now? There is no intersection of
>>>>>> this old broken embedded GPU and a CPU that supports CC right?
>>>>>
>>>>>
>>>>> I did consider dropping these two checks, but I was not entirely 
>>>>> sure. So I kept
>>>>> as is for now. Once these series settles and I can go with next 
>>>>> step of dropping
>>>>> these two checks.
>>>>>
>>>>> @Alex, @Mario, Any suggestions ?
>>>>>
>>>>
>>>> The background comes from this series:
>>>>
>>>> https://lore.kernel.org/all/20200824105415.21000-1-joro@8bytes.org/
>>>
>>>
>>> Thanks for old link. So it looks like we are good to drop SME check?
>>
>> Yeah I think so.
>>
>>>
>>> Also is it safe to assume SNP is not enabled on these platform and 
>>> drop that
>>> check? Anyway SNP requirement (which doesn't support identity 
>>> mapping) and APU
>>> requirement (needs identity mapping) is conflicting.
>>>
>>
>> The current platforms I think this is a safe assumption.
>>
>> Felix,
>>
>> Can we revisit the requirement of identity mapping for APU?  Does it 
>> still hold with the current hardware and software?
> 
> I'm not sure what this means. Is Identity mode something like pass- 
> through? I don't know why this is required on APUs. If it's related to 
> IOMMUv2 support, then it's probably no longer needed. We're not using 
> IOMMUv2 on our APUs any more. Support for that was removed from the 
> amdgpu driver a few years ago.
> 

Hmm, I just had a try with this on a few years old APU (PHX).  It's 
flicker central with this (7.2-rc5~ish tree):

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 29dc18d3d22e5..1e792cee7f4cd 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3134,19 +3134,6 @@ static int amd_iommu_def_domain_type(struct 
device *dev)
         if (dev_is_pci(dev) && to_pci_dev(dev)->untrusted)
                 return IOMMU_DOMAIN_DMA;

-       /*
-        * Do not identity map IOMMUv2 capable devices when:
-        *  - memory encryption is active, because some of those devices
-        *    (AMD GPUs) don't have the encryption bit in their DMA-mask
-        *    and require remapping.
-        *  - SNP is enabled, because it prohibits DTE[Mode]=0.
-        */
-       if (pdev_pasid_supported(dev_data) &&
-           !cc_platform_has(CC_ATTR_MEM_ENCRYPT) &&
-           !amd_iommu_snp_en) {
-               return IOMMU_DOMAIN_IDENTITY;
-       }
-
         return 0;
  }

The flicking is reminencent of issues moving BOs between VRAM and GTT 
from a few years ago.

So I don't think it can be dropped (just) yet.

  reply	other threads:[~2026-07-28 19:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  6:15 [PATCH 0/2] iommu/amd: Fix default domain selection for PASID-capable devices Vasant Hegde
2026-07-23  6:15 ` [PATCH 1/2] PCI: Mark Radeon Pro WX 4100 ATS as broken Vasant Hegde
2026-07-23  6:21   ` sashiko-bot
2026-07-23 15:42   ` Bjorn Helgaas
2026-07-23 15:45     ` Mario Limonciello
2026-07-23 16:51       ` Vasant Hegde
2026-07-23  6:15 ` [PATCH 2/2] iommu/amd: Force identity mode for selected GPUs only Vasant Hegde
2026-07-23  6:25   ` sashiko-bot
2026-07-23 15:53   ` Ankit Soni
2026-07-23 16:29     ` Vasant Hegde
2026-07-23 15:59   ` Bjorn Helgaas
2026-07-23 16:11     ` Mario Limonciello
2026-07-23 16:23       ` Vasant Hegde
2026-07-23 16:32         ` Mario Limonciello
2026-07-23 16:55           ` Vasant Hegde
2026-07-23 19:53           ` Bjorn Helgaas
2026-07-23 19:58             ` Mario Limonciello
2026-07-23 21:02               ` Bjorn Helgaas
2026-07-24 15:11                 ` Jason Gunthorpe
2026-07-27  4:13                   ` Vasant Hegde
2026-07-23 16:33     ` Vasant Hegde
2026-07-24 15:15   ` Jason Gunthorpe
2026-07-27  4:19     ` Vasant Hegde
2026-07-27 14:45       ` Mario Limonciello
2026-07-28  4:52         ` Vasant Hegde
2026-07-28  5:31           ` Mario Limonciello
2026-07-28 19:10             ` Kuehling, Felix
2026-07-28 19:57               ` Mario Limonciello [this message]
2026-07-30 11:26                 ` Vasant Hegde
2026-08-05  1:07                   ` Jason Gunthorpe
2026-08-05 14:37                     ` Vasant Hegde
2026-08-05 17:22                       ` Deucher, Alexander
2026-08-05 17:53                         ` Jason Gunthorpe
2026-08-05 18:12                           ` Deucher, Alexander
2026-08-05 19:11                             ` Jason Gunthorpe
2026-07-31 20:23                 ` Deucher, Alexander
2026-07-31 20:19             ` Deucher, Alexander

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=bacdf160-8ab2-4bd6-aa9d-ab63b16527fa@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=AmandeepKaur.Longia@amd.com \
    --cc=bhelgaas@google.com \
    --cc=felix.kuehling@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-pci@vger.kernel.org \
    --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