[PATCH v2 0/2] Drivers: hv: decrypt netvsc buffers on contiguous direct-map addresses

From: Kameron Carr

Date: Thu Jul 30 2026 - 19:40:13 EST


Arm CCA Realms implement set_memory_decrypted() only for addresses in the
kernel linear map; vmalloc()/vmap() addresses are rejected. netvsc
allocates its large send and receive buffers with vzalloc() and passes
those addresses to vmbus_establish_gpadl(), which calls
set_memory_decrypted(), causing GPADL establishment to fail in a Realm.

This series allocates shared buffers as a list of chunks, each physically
contiguous, decrypts each chunk through its direct-map address, and
combines them into a virtually contiguous mapping with vmap(). Private
buffers continue to use vzalloc().

Changes since v1 [1]:
Patch 1:
- Add HV_GPADL_BUFFER_DECRYPTED to enum hv_gpadl_type to indicate a
buffer that has already been decrypted.
Patch 2:
- Rename netvsc_{alloc,free}_buf_pages() -> vmbus_{alloc,free}_buffer()
and move them to channel.c.
- Remove struct netvsc_buf_chunk and replace with page folio in
compound pages.
- vmbus_alloc_buffer():
- use vzalloc() for non-host-visible buffers and remove the
encryption decision out of netvsc.
- min_t() -> min().
- zero the memory after allocation.
- specify @size "will be rounded up to PAGE_SIZE" in the docstring.

[1]: https://lore.kernel.org/all/20260721195633.1438361-1-kameroncarr@xxxxxxxxxxxxxxxxxxx/

Kameron Carr (2):
Drivers: hv: vmbus: add vmbus_establish_gpadl_caller_decrypted()
hv_netvsc: Allocate host-visible GPADL buffers as decrypted contiguous
chunks

drivers/hv/channel.c | 185 +++++++++++++++++++++++++++++++-
drivers/net/hyperv/hyperv_net.h | 8 +-
drivers/net/hyperv/netvsc.c | 104 ++++++++++++------
drivers/net/hyperv/netvsc_drv.c | 6 ++
include/linux/hyperv.h | 15 ++-
5 files changed, 281 insertions(+), 37 deletions(-)

--
2.45.4