From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
Timo Witte <timo.witte@gmail.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
"Hegde, Vasant" <Vasant.Hegde@amd.com>
Cc: "robin.murphy@arm.com" <robin.murphy@arm.com>,
"joro@8bytes.org" <joro@8bytes.org>
Subject: Re: [BUG] iommu/dma: "Not yet supported" CC_SHARED rejection regresses dma_alloc_attrs() on SME hosts with IOMMU-attached GPUs (commit 8277a12d0d60)
Date: Mon, 07 Sep 2026 19:25:20 +0530 [thread overview]
Message-ID: <yq5abja9p3nb.fsf@kernel.org> (raw)
In-Reply-To: <f48c2a3f-38c8-44ab-8352-35ee1874b420@samsung.com>
Marek Szyprowski <m.szyprowski@samsung.com> writes:
> On 02.09.2026 20:26, Deucher, Alexander wrote:
>>> -----Original Message-----
>>> From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
>>> Sent: Wednesday, September 2, 2026 6:16 AM
>>> To: Timo Witte <timo.witte@gmail.com>; iommu@lists.linux.dev
>>> Cc: m.szyprowski@samsung.com; robin.murphy@arm.com;
>>> joro@8bytes.org; Deucher, Alexander <Alexander.Deucher@amd.com>
>>> Subject: Re: [BUG] iommu/dma: "Not yet supported" CC_SHARED rejection
>>> regresses dma_alloc_attrs() on SME hosts with IOMMU-attached GPUs
>>> (commit 8277a12d0d60)
>>>
>>> Timo Witte <timo.witte@gmail.com> writes:
>>>
>>>> Commit 8277a12d0d60 ("dma-pool: track decrypted atomic pools and
>>>> select them via attrs") added to iommu_dma_alloc():
>>>>
>>>> /* Not yet supported */
>>>> if (is_alloc_cc_shared)
>>>> return NULL;
>>>>
>>>> dma_alloc_attrs() auto-sets __DMA_ATTR_ALLOC_CC_SHARED whenever
>>>> force_dma_unencrypted() is true. On an SME host (mem_encrypt=on) an
>>>> AMD GPU with a 44-bit DMA mask hits that condition, so every GTT
>>>> (system-RAM) allocation fails with NULL/-ENOMEM, amdgpu init aborts
>>>> and the system boots without a display.
>>>> IOMMU in Translated/DMA-FQ mode (iommu group 29).
>>>>
>>>> Before the mentioned patch it worked: the IOMMU PTE carries the SME
>>>> C-bit, so the memory controller transparently decrypts for the device
>>>> while pages stay encrypted at rest. For IOMMU-backed devices
>>>> force_dma_unencrypted() is a false positive - the device DMA mask does
>>>> not limit addressing once the IOMMU translates, so CC_SHARED should
>>>> not be auto-set for them.
>>>>
>>>
>>> This means that, with host memory encryption, DMA does not need to be
>>> forced unencrypted when the device uses the IOMMU?
>> + Tom and Vasant.
>>
>> Yes, otherwise most devices won't be able to work with encrypted memory since most devices don't support a DMA mask large enough to cover the C bit.
>
> Is this the proper fix/workaround for v7.3-rc? If so, then Aneesh, please
> send it as a complete patch so I will take it to the dma-mapping-fixes.
>
I am still waiting for testing feedback. I sent a reminder on Friday.
-aneesh
next prev parent reply other threads:[~2026-09-07 13:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANB4YXR7h8V5Xp=MXVZeSdvw9UiriSagp=E+ju5RRDNghoPHLQ@mail.gmail.com>
2026-09-02 9:59 ` [BUG] iommu/dma: "Not yet supported" CC_SHARED rejection regresses dma_alloc_attrs() on SME hosts with IOMMU-attached GPUs (commit 8277a12d0d60) Aneesh Kumar K.V
2026-09-02 10:15 ` Aneesh Kumar K.V
2026-09-02 18:26 ` Deucher, Alexander
2026-09-07 8:25 ` Marek Szyprowski
2026-09-07 13:55 ` Aneesh Kumar K.V [this message]
2026-09-07 20:35 ` Timo Witte
2026-09-09 11:26 ` Vasant Hegde
2026-09-01 21:09 Timo Witte
2026-09-02 10:20 ` Mostafa Saleh
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=yq5abja9p3nb.fsf@kernel.org \
--to=aneesh.kumar@kernel.org \
--cc=Alexander.Deucher@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=Vasant.Hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=timo.witte@gmail.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.