]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/container: restore DMA vaddr
authorSteve Sistare <steven.sistare@oracle.com>
Tue, 10 Jun 2025 15:39:19 +0000 (08:39 -0700)
committerCédric Le Goater <clg@redhat.com>
Wed, 11 Jun 2025 12:01:58 +0000 (14:01 +0200)
commit7e9f21411302d823e9ee563ff6a2a40b1ffc1266
tree0c6c8539d7c63e0b84ba19dd95278b5a91f983f9
parent1faadd96306b428f2e8e35f71761c333a6777f55
vfio/container: restore DMA vaddr

In new QEMU, do not register the memory listener at device creation time.
Register it later, in the container post_load handler, after all vmstate
that may affect regions and mapping boundaries has been loaded.  The
post_load registration will cause the listener to invoke its callback on
each flat section, and the calls will match the mappings remembered by the
kernel.

The listener calls a special dma_map handler that passes the new VA of each
section to the kernel using VFIO_DMA_MAP_FLAG_VADDR.  Restore the normal
handler at the end.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/1749569991-25171-7-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/container.c
hw/vfio/cpr-legacy.c
include/hw/vfio/vfio-cpr.h