qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC V1 00/12] Live update: iommufd
@ 2024-07-20 19:15 Steve Sistare
  2024-07-20 19:15 ` [RFC V1 01/12] vfio: move cpr_exec_notifier Steve Sistare
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Steve Sistare @ 2024-07-20 19:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Yi Liu, Eric Auger, Zhenzhong Duan, Alex Williamson,
	Cedric Le Goater, Michael S. Tsirkin, Peter Xu, Fabiano Rosas,
	Philippe Mathieu-Daude, David Hildenbrand, Steve Sistare

Support iommufd devices with the cpr-exec live migration mode.
No user-visible interfaces are added.

Pass the iommufd and vfio device descriptors from old to new QEMU.  In new
QEMU, during vfio_realize, skip the ioctls that configure the device, because
it is already configured.

In new QEMU, call ioctl(IOMMU_IOAS_CHANGE_PROCESS) to update the mm ownership,
locked memory accounting, and virtual address of all DMA mappings.  The old
virtual address of each memory region is needed to identify the existing
mapping, so pass the host address of each RAMBlock in the migration data
stream.

Block CPR if the iommufd container has any vfio mdevs (mediated devices).
IOMMU_IOAS_CHANGE_PROCESS can be used as-is to support mdevs, but it requires
extra work in userland at CPR time so that kernel threads have access to the
old mappings until the mappings are updated in new QEMU.  I have prototyped
those changes but they need more work before posting.

This series depends on the following qemu series
  [PATCH V1 00/08] Live update: vfio
  https://lore.kernel.org/qemu-devel/1720558737-451106-1-git-send-email-steven.sistare@oracle.com/

This series depends on the IOMMU_IOAS_CHANGE_PROCESS kernel interface which
is a work in progress:
  iommufd live update
  https://lore.kernel.org/linux-iommu/1721501805-86928-1-git-send-email-steven.sistare@oracle.com

Steve Sistare (12):
  vfio: move cpr_exec_notifier
  iommufd: no DMA to BARs
  iommufd: pass name to connect
  migration: cpr_find_fd_any
  iommufd: preserve device fd
  iommufd: export iommufd_cdev_get_info_iova_range
  iommufd: change_process kernel interface
  vfio/iommufd: register container for cpr
  vfio/iommufd: rebuild device
  migration/ram: old host address
  iommufd: update DMA virtual addresses
  vfio: mdev blocker

 backends/iommufd.c                    | 113 ++++++++++++++++++++++++++++++++--
 hw/core/machine.c                     |   6 ++
 hw/vfio/common.c                      |   3 +-
 hw/vfio/cpr-iommufd.c                 |  84 +++++++++++++++++++++++++
 hw/vfio/cpr-legacy.c                  |  10 +--
 hw/vfio/helpers.c                     |   1 +
 hw/vfio/iommufd.c                     |  43 ++++++++++---
 hw/vfio/meson.build                   |   1 +
 hw/vfio/pci.c                         |  10 +++
 include/exec/memory.h                 |   1 +
 include/exec/ramblock.h               |   1 +
 include/hw/vfio/vfio-common.h         |   7 ++-
 include/hw/vfio/vfio-container-base.h |   3 +
 include/migration/cpr.h               |   1 +
 include/sysemu/iommufd.h              |   7 ++-
 linux-headers/linux/iommufd.h         |  19 ++++++
 migration/cpr.c                       |  15 +++++
 migration/migration.h                 |   2 +
 migration/options.c                   |   2 +
 migration/ram.c                       |   7 +++
 20 files changed, 316 insertions(+), 20 deletions(-)
 create mode 100644 hw/vfio/cpr-iommufd.c

-- 
1.8.3.1



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

end of thread, other threads:[~2024-08-16 18:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-20 19:15 [RFC V1 00/12] Live update: iommufd Steve Sistare
2024-07-20 19:15 ` [RFC V1 01/12] vfio: move cpr_exec_notifier Steve Sistare
2024-07-20 19:15 ` [RFC V1 02/12] iommufd: no DMA to BARs Steve Sistare
2024-08-12 22:05   ` Alex Williamson
2024-08-13  1:39   ` Yi Liu
2024-08-13 14:53     ` Steven Sistare
2024-07-20 19:15 ` [RFC V1 03/12] iommufd: pass name to connect Steve Sistare
2024-07-20 19:15 ` [RFC V1 04/12] migration: cpr_find_fd_any Steve Sistare
2024-07-20 19:15 ` [RFC V1 05/12] iommufd: preserve device fd Steve Sistare
2024-07-20 19:15 ` [RFC V1 06/12] iommufd: export iommufd_cdev_get_info_iova_range Steve Sistare
2024-07-20 19:15 ` [RFC V1 07/12] iommufd: change_process kernel interface Steve Sistare
2024-07-20 19:15 ` [RFC V1 08/12] vfio/iommufd: register container for cpr Steve Sistare
2024-07-20 19:15 ` [RFC V1 09/12] vfio/iommufd: rebuild device Steve Sistare
2024-07-20 19:15 ` [RFC V1 10/12] migration/ram: old host address Steve Sistare
2024-08-16 17:57   ` Fabiano Rosas
2024-08-16 18:13     ` Steven Sistare
2024-07-20 19:15 ` [RFC V1 11/12] iommufd: update DMA virtual addresses Steve Sistare
2024-07-20 19:15 ` [RFC V1 12/12] vfio: mdev blocker Steve Sistare

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