Skip to content

RFC arm: Add DMA remapping for CCA

Jean-Philippe Brucker qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2system/memory: Allow creating IOMMU mappings from RAM discard populate notifiersinclude/exec/memory.h system/memory.c+7 -110 replies
2/2target/arm/kvm-rme: Add DMA remapping for the shared memory regionhw/arm/virt.c target/arm/kvm-rme.c target/arm/kvm_arm.h+237 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/2] arm: Add DMA remapping for CCA

These two patches will be included in the series that adds support for Arm CCA guests to QEMU, which isn't ready to be merged [1], but I'm sending them as RFC first to seek advice about the best way to implement this.

There is a breaking change to CCA guests, where DMA addresses now have the "shared" top bit set. The VMM needs to strip the address before accessing memory. See more details on patch 2 of this RFC and on the Linux change:

https://lore.kernel.org/all/[email protected]/

Patch 2 inserts an IOMMUMemoryRegion on the DMA path, so all DMA accesses get the top bit stripped. It also adds RAM discard listeners (guest_memfd -> IOMMU notifiers) so that we can create VFIO mappings in the top half of the guest address space. Patch 1 is a hack to support GPA->VA translation during the discard_populate notification.

I'm testing VFIO support using Chenyi Qiang's series for shared device assignment [2]

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/

Jean-Philippe Brucker (2):
system/memory: Allow creating IOMMU mappings from RAM discard populate
notifiers
target/arm/kvm-rme: Add DMA remapping for the shared memory region

 include/exec/memory.h |   5 +
 target/arm/kvm_arm.h  |  15 +++
 hw/arm/virt.c         |   2 +
 system/memory.c       |   3 +-
 target/arm/kvm-rme.c  | 220 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 244 insertions(+), 1 deletion(-)
Signature · 1 line
2.48.1