qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2] arm: Add DMA remapping for CCA
@ 2025-02-20 16:13 Jean-Philippe Brucker
  2025-02-20 16:13 ` [RFC 1/2] system/memory: Allow creating IOMMU mappings from RAM discard populate notifiers Jean-Philippe Brucker
  2025-02-20 16:13 ` [RFC 2/2] target/arm/kvm-rme: Add DMA remapping for the shared memory region Jean-Philippe Brucker
  0 siblings, 2 replies; 13+ messages in thread
From: Jean-Philippe Brucker @ 2025-02-20 16:13 UTC (permalink / raw)
  To: philmd, david, peterx, pbonzini, peter.maydell
  Cc: qemu-arm, qemu-devel, Jean-Philippe Brucker

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/20250219220751.1276854-1-suzuki.poulose@arm.com/

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/20241125195626.856992-2-jean-philippe@linaro.org/
[2] https://lore.kernel.org/qemu-devel/20250217081833.21568-1-chenyi.qiang@intel.com/

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(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-28  5:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 16:13 [RFC 0/2] arm: Add DMA remapping for CCA Jean-Philippe Brucker
2025-02-20 16:13 ` [RFC 1/2] system/memory: Allow creating IOMMU mappings from RAM discard populate notifiers Jean-Philippe Brucker
2025-02-20 19:39   ` David Hildenbrand
2025-02-21  2:25     ` Chenyi Qiang
2025-02-21  8:09       ` David Hildenbrand
2025-02-21 10:04         ` Chenyi Qiang
2025-02-25  2:00           ` Chenyi Qiang
2025-02-25  9:41             ` David Hildenbrand
2025-02-26 12:43               ` Chenyi Qiang
2025-02-27  3:26                 ` Chenyi Qiang
2025-02-27 11:27                   ` David Hildenbrand
2025-02-28  5:39                     ` Chenyi Qiang
2025-02-20 16:13 ` [RFC 2/2] target/arm/kvm-rme: Add DMA remapping for the shared memory region Jean-Philippe Brucker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).