From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Michael Kelley <mhklinux@outlook.com>,
"Aneesh Kumar K.V (Arm)" <aneesh.kumar@kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
Mostafa Saleh <smostafa@google.com>,
"Alexander.Deucher@amd.com" <Alexander.Deucher@amd.com>,
"Thomas.Lendacky@amd.com" <Thomas.Lendacky@amd.com>,
"Vasant.Hegde@amd.com" <Vasant.Hegde@amd.com>,
Timo Witte <timo.witte@gmail.com>
Subject: Re: [PATCH] x86/mm: Don't force unencrypted DMA for IOMMU-backed devices
Date: Tue, 8 Sep 2026 16:31:57 +0200 [thread overview]
Message-ID: <fc0bc0c2-59ca-40b9-9d98-d5aebebeb4a3@samsung.com> (raw)
In-Reply-To: <SN6PR02MB41571F1762544B6157C475BFD4B12@SN6PR02MB4157.namprd02.prod.outlook.com>
On 08.09.2026 16:24, Michael Kelley wrote:
> From: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> Sent: Tuesday, September 8, 2026 4:33 AM
>> Commit 8277a12d0d60 ("dma-pool: track decrypted atomic pools and select
>> them via attrs") exposed an issue with force_dma_unencrypted() on
>> systems using host memory encryption.
>>
>> force_dma_unencrypted() checks whether the device DMA mask can address
>> the encryption bit and, if not, requires DMA allocations to use
>> unencrypted memory. However, this check is not applicable when the
>> device is using the IOMMU. In that case, the device DMA mask constrains
>> the IOVA seen by the device, not the backing physical address, so it
>> does not need to cover the C-bit.
>>
>> This currently causes dma_alloc_attrs() to set
>> __DMA_ATTR_ALLOC_CC_SHARED for such devices. iommu_dma_alloc() does not
>> support that attribute and rejects the allocation, causing DMA
>> allocations to fail.
>>
>> Do not force DMA allocations to be unencrypted when the device is using
>> the IOMMU. This allows the IOMMU to map the encrypted physical pages as
>> before and avoids incorrectly requesting CC_SHARED allocations.
>>
>> Fixes: 8277a12d0d60 ("dma-pool: track decrypted atomic pools and select them via attrs")
>> Reported-by: Timo Witte <timo.witte@gmail.com>
>> Link: https://lore.kernel.org/all/CANB4YXR7h8V5Xp=MXVZeSdvw9UiriSagp=E+ju5RRDNghoPHLQ@mail.gmail.com
> There seems to be something wrong with this link. Just viewing the
> email thread in lore.kernel.org shows a [not found] error in the thread.
Indeed, this one works better:
https://lore.kernel.org/all/CANB4YXS=Nf-co3t8eMHtqrW4sn=1BDcP6o=EoTrgZm0WYMYTyw@mail.gmail.com/
I will amend it while applying, but I want give everyone some time for comments.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2026-09-08 14:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260908113247eucas1p12e67fcdf50573da0c0fac36cee4b06e9@eucas1p1.samsung.com>
2026-09-08 11:32 ` [PATCH] x86/mm: Don't force unencrypted DMA for IOMMU-backed devices Aneesh Kumar K.V (Arm)
2026-09-08 14:24 ` Michael Kelley
2026-09-08 14:31 ` Marek Szyprowski [this message]
2026-09-10 4:30 ` Alexey Kardashevskiy
2026-09-10 6:55 ` Aneesh Kumar K.V
2026-09-11 8:32 ` Marek Szyprowski
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=fc0bc0c2-59ca-40b9-9d98-d5aebebeb4a3@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=Alexander.Deucher@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=Vasant.Hegde@amd.com \
--cc=aneesh.kumar@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=smostafa@google.com \
--cc=tglx@kernel.org \
--cc=timo.witte@gmail.com \
--cc=x86@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 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.