The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Mostafa Saleh <smostafa@google.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	robin.murphy@arm.com, m.szyprowski@samsung.com, will@kernel.org,
	maz@kernel.org, suzuki.poulose@arm.com, jiri@resnulli.us,
	jgg@ziepe.ca
Subject: Re: [RFC PATCH v3 3/5] dma-mapping: Decrypt memory on remap
Date: Thu, 7 May 2026 18:18:57 +0100	[thread overview]
Message-ID: <afzJgQSN0ROM3lEb@arm.com> (raw)
In-Reply-To: <yq5atstdanx8.fsf@kernel.org>

On Tue, Apr 14, 2026 at 03:01:15PM +0530, Aneesh Kumar K.V wrote:
> Mostafa Saleh <smostafa@google.com> writes:
> > In case memory needs to be remapped on systems with
> > force_dma_unencrypted(), where this memory is not allocated
> > from a restricted-dma pool, this was currently ignored, while only
> > setting the decrypted pgprot in the remapped alias.
> >
> > The memory still needs to be decrypted in that case.
> 
> For ARM CCA, we cannot mark a vmap address as decrypted. I don’t expect
> non-coherent DMA devices to be used in an ARM CCA configuration, but we
> may need a way to document this in the code.

I think you clarified what you meant later. The vmap here is just fine,
we pass pgprot_decrypted(). The key is the dma_set_decrypted() on the
page address before being remapped.

On arm64 we probably don't care but if we want to enforce it for all
architectures, dma_direct_alloc() could return NULL if
force_dma_unencrypted() && remap (maybe together with a WARN_ON_ONCE).
However, the proposed patch is small enough to cover this case as well.

-- 
Catalin

       reply	other threads:[~2026-05-07 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260408194750.2280873-1-smostafa@google.com>
     [not found] ` <20260408194750.2280873-4-smostafa@google.com>
     [not found]   ` <yq5atstdanx8.fsf@kernel.org>
2026-05-07 17:18     ` Catalin Marinas [this message]
2026-05-08  4:03       ` [RFC PATCH v3 3/5] dma-mapping: Decrypt memory on remap Aneesh Kumar K.V
     [not found] ` <20260408194750.2280873-5-smostafa@google.com>
     [not found]   ` <20260410180504.GE2551565@ziepe.ca>
     [not found]     ` <aeJVh5VbkzxHDBEK@google.com>
2026-05-07 17:36       ` [RFC PATCH v3 4/5] dma-mapping: Encapsulate memory state during allocation Catalin Marinas
2026-05-11 10:48         ` 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=afzJgQSN0ROM3lEb@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maz@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=smostafa@google.com \
    --cc=suzuki.poulose@arm.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