History

RDMA/uverbs: Expose CoCo DMA bounce requirement to userspace

In CoCo guests, guest memory is encrypted and untrusted (T=0) devices cannot DMA to it directly; such transfers must go through unencrypted bounce buffers. RDMA registers user pages for direct device access, bypassing the DMA layer and thus any bouncing, so registered memory does not work in this configuration. Until trusted (T=1) device detection is available, conservatively flag every device attached to a CoCo guest. Expose the condition to userspace as IB_UVERBS_DEVICE_CC_DMA_BOUNCE in device_cap_flags_ex so applications can avoid memory registration and fall back to copying buffers through send/recv.

Jiri Pirko committed 6 months ago

Commit d7a40b51 parent 93ce7764 files · +16 −0Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/rdma/ib_user_verbs.h+2−0
@@ -1368,6 +1368,8 @@ enum ib_uverbs_device_cap_flags { · 1367 unmodified lines
13681368 IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39,
13691369 /* Atomic write attributes */
13701370 IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
1371+ /* CoCo guest with DMA bounce buffering required */
1372+ IB_UVERBS_DEVICE_CC_DMA_BOUNCE = 1ULL << 41,
13711373 };
13721374
13731375 enum ib_uverbs_raw_packet_caps {