Add encrypt/decrypt support for vmalloc regions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v1 Latest posting 2/22 patches 9 repliesIn review
- v1 posting 1/22 patches 0 repliesSuperseded
Patches in v1 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | dma/pool: Use vmap() address for memory encryption helpers on ARM64kernel/ | +4 | 4 replies | |
| 2/2 | arm64: Add encrypt/decrypt support for vmalloc regionsarch/ | +48 | 5 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RESEND PATCH 0/2] Add encrypt/decrypt support for vmalloc regions
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(-)
Signature · 1 line
2.25.1