From: "Arnd Bergmann" <arnd@kernel.org>
To: "Linus Walleij" <linusw@kernel.org>, "Jason Gunthorpe" <jgg@ziepe.ca>
Cc: "Aneesh Kumar K.V (Arm)" <aneesh.kumar@kernel.org>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Robin Murphy" <robin.murphy@arm.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Suzuki K Poulose" <suzuki.poulose@arm.com>,
"Dmitry Osipenko" <digetx@gmail.com>,
"Thierry Reding" <treding@nvidia.com>
Subject: Re: [PATCH v2] dma-direct: set decrypted flag for remapped DMA allocations
Date: Wed, 07 Jan 2026 16:03:54 +0100 [thread overview]
Message-ID: <0dccea36-0d79-42cc-a12f-5a890061ff59@app.fastmail.com> (raw)
In-Reply-To: <CAD++jLnfWuoYavrOKoxd6=UvPhuWJmKzHWe76-FM2S+raUnEuw@mail.gmail.com>
On Wed, Jan 7, 2026, at 15:26, Linus Walleij wrote:
> On Mon, Jan 5, 2026 at 6:53 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
>>
>> On Fri, Jan 02, 2026 at 09:20:37PM +0530, Aneesh Kumar K.V (Arm) wrote:
>> > Devices that are DMA non-coherent and require a remap were skipping
>> > dma_set_decrypted(), leaving DMA buffers encrypted even when the device
>> > requires unencrypted access. Move the call after the if (remap) branch
>> > so that both the direct and remapped allocation paths correctly mark the
>> > allocation as decrypted (or fail cleanly) before use.
>>
>> This is probably fine, but IMHO, we should be excluding the
>> combination of highmem and CC at the kconfig level :\
>
> The only way you can get CMA in highmem is by passing in a highmem
> location to the allocator from the command line.
What about those that declare a "shared-dma-pool" node in DT?
I don't quite understand how the alloc-ranges are picked here, but
from what I can tell, most of them are intentionally limiting
themselves to the smallest lowmem area (CONFIG_VMSPLIT_3G), while
at least three others seem to intentionally pick a highmem area,
specifically these tegra114 and tegra20 (but not tegra30) devices:
arch/arm/boot/dts/nvidia/tegra114-asus-tf701t.dts- alloc-ranges = <0x80000000 0x30000000>;
arch/arm/boot/dts/nvidia/tegra20-acer-a500-picasso.dts- alloc-ranges = <0x30000000 0x10000000>;
arch/arm/boot/dts/nvidia/tegra20-asus-transformer-common.dtsi- alloc-ranges = <0x30000000 0x10000000>;
[cc Dmitry and Thierry in case they remember why this was done]
With my proposed change to increase the default lowmem size,
all of these would be in the lowmem area after all, so it does
not actually matter, but there are probably other out-of-tree
dtbs doing the same thing.
> I have a strong urge to just patch CMA to not allow that and see what
> happens. Or at least have it print a big fat warning that this will go
> away soon.
>
> I think this is only used on legacy ARM32 products that are no longer
> maintained, but I might be wrong.
It's hard to know, I can definitely think of reasons to do this
intentionally on machines that are still supported, using either
a custom dtb or a custom command line. We can of course decide to not
support this configuration any more, and move the CMA area down
in those cases.
Arnd
next prev parent reply other threads:[~2026-01-07 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 15:50 Aneesh Kumar K.V (Arm)
2026-01-05 17:53 ` Jason Gunthorpe
2026-01-07 14:26 ` Linus Walleij
2026-01-07 15:03 ` Arnd Bergmann [this message]
2026-01-07 17:41 ` Linus Walleij
2026-01-07 21:23 ` Arnd Bergmann
2026-01-14 9:47 ` Aneesh Kumar K.V
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=0dccea36-0d79-42cc-a12f-5a890061ff59@app.fastmail.com \
--to=arnd@kernel.org \
--cc=aneesh.kumar@kernel.org \
--cc=digetx@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=treding@nvidia.com \
--cc=willy@infradead.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
all inboxes | Powered by JetHome®