From: Shanker Donthineni <sdonthineni@nvidia.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Steven Price <steven.price@arm.com>,
<linux-arm-kernel@lists.infradead.org>
Cc: Robin Murphy <robin.murphy@arm.com>,
Gavin Shan <gshan@redhat.com>, "Mike Rapoport" <rppt@kernel.org>,
Shanker Donthineni <sdonthineni@nvidia.com>,
Vikram Sethi <vsethi@nvidia.com>,
Jason Sequeira <jsequeira@nvidia.com>,
"Dev Jain" <dev.jain@arm.com>,
David Rientjes <rientjes@google.com>,
<linux-kernel@vger.kernel.org>, <iommu@lists.linux.dev>
Subject: [RESEND PATCH 0/2] Add encrypt/decrypt support for vmalloc regions
Date: Sun, 10 Aug 2025 19:50:33 -0500 [thread overview]
Message-ID: <20250811005036.714274-1-sdonthineni@nvidia.com> (raw)
This series fixes two related issues in the handling of memory encryption
attributes on ARM64 systems with Confidential Compute Architecture (CCA)
enabled.
Currently, certain code paths assume that the target address for
set_memory_encrypted()/set_memory_decrypted() is always part of the
linear mapping. This assumption breaks on ARM64 when
CONFIG_DMA_DIRECT_REMAP=y or when operating on vmalloc-backed memory
regions, leading to incorrect encryption attribute updates and, in
some cases, system crashes.
Patch 1 addresses an ARM64-specific bug in the DMA atomic pool expansion
path, where the wrong virtual address was passed to the memory encryption
helpers. On CCA-enabled systems, this resulted in corruption or crashes
during pool expansion.
Patch 2 extends the ARM64 memory attribute change functions to handle
vmalloc and other non-linear mappings correctly. A new helper is introduced
to detect such mappings, translate them to physical pages, and update
attributes on a per-page basis. This resolves failures and crashes in
scenarios such as NVMe device pass-through where vmalloc-backed memory
is involved CONFIG_DMA_DIRECT_REMAP=y.
Both changes have been tested on an ARM64 CCA-enabled environment with
NVMe pass-through feature.
Shanker Donthineni (2):
dma/pool: Use vmap() address for memory encryption helpers on ARM64
arm64: Add encrypt/decrypt support for vmalloc regions
arch/arm64/mm/pageattr.c | 55 +++++++++++++++++++++++++++++++++++-----
kernel/dma/pool.c | 8 +++---
2 files changed, 52 insertions(+), 11 deletions(-)
--
2.25.1
next reply other threads:[~2025-08-11 0:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 0:50 Shanker Donthineni [this message]
2025-08-11 0:50 ` [RESEND PATCH 1/2] dma/pool: Use vmap() address for memory encryption helpers on ARM64 Shanker Donthineni
2025-08-11 8:48 ` Mike Rapoport
2025-08-11 12:09 ` Robin Murphy
2025-08-11 17:26 ` Catalin Marinas
2025-08-11 18:31 ` Shanker Donthineni
2025-08-11 0:50 ` [RESEND PATCH 2/2] arm64: Add encrypt/decrypt support for vmalloc regions Shanker Donthineni
2025-08-11 8:51 ` Mike Rapoport
2025-08-11 13:23 ` Shanker Donthineni
2025-08-11 12:31 ` Robin Murphy
2025-08-11 13:05 ` Shanker Donthineni
2025-08-11 14:17 ` Robin Murphy
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=20250811005036.714274-1-sdonthineni@nvidia.com \
--to=sdonthineni@nvidia.com \
--cc=catalin.marinas@arm.com \
--cc=dev.jain@arm.com \
--cc=gshan@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jsequeira@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=rientjes@google.com \
--cc=robin.murphy@arm.com \
--cc=rppt@kernel.org \
--cc=steven.price@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=vsethi@nvidia.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 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.