All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC V1 0/4] iommufd live update
@ 2024-07-20 18:56 Steve Sistare
  2024-07-20 18:56 ` [RFC V1 1/4] iommufd: Export do_update_pinned Steve Sistare
                   ` (7 more replies)
  0 siblings, 8 replies; 27+ messages in thread
From: Steve Sistare @ 2024-07-20 18:56 UTC (permalink / raw)
  To: iommu
  Cc: Jason Gunthorpe, Kevin Tian, Alex Williamson, Cornelia Huck,
	Steve Sistare

Live update is a technique wherein an application saves its state, launches
an updated version of itself, and restores its state.  Clients of the
application experience a brief suspension of service, on the order of
100's of milliseconds, but are otherwise unaffected.

Define the IOMMU_IOAS_CHANGE_PROCESS ioctl to allow management and use
of an iommufd device to be transferred from one process to another.  The
application is responsible for transferring the device descriptor to the new
process, eg either by preservation across fork and exec or via SCM_RIGHTS.

All memory objects that were mapped for iommufd DMA in the old process
must also be mapped in the new process, but they may have different virtual
addresses in the new.  The application passes an array of new addresses to
IOMMU_IOAS_CHANGE_PROCESS, and it atomically updates everything to the current
process, grabbing the new mm, transferring pinned page counts, and recording
new virtual addresses.

If the application directly exec's the new version of itself, it must take
special care if the mappings may be accessed by kernel threads, such as by
vfio mdevs.  The original process must fork an identical caretaker
process which calls VFIO_IOAS_CHANGE_PROCESS to take temporary ownership
of the mappings without changing VA's.  The original process then exec's
its successor, which calls VFIO_IOAS_CHANGE_PROCESS with new VA's to take
ownership from the caretaker.  

Thanks to Jason Gunthorpe for code and ideas in this series.

This is implemented in QEMU by the patch series "Live update: iommufd"
  https://lore.kernel.org/qemu-devel   (to be posted shortly)

Steve Sistare (4):
  iommufd: Export do_update_pinned
  iommufd: Lock all objects
  iommufd: Add IOMMU_IOAS_CHANGE_PROCESS
  iommufd: update VA

 drivers/iommu/iommufd/io_pagetable.h    |   6 +
 drivers/iommu/iommufd/ioas.c            | 291 ++++++++++++++++++++++++++++++++
 drivers/iommu/iommufd/iommufd_private.h |   2 +
 drivers/iommu/iommufd/main.c            |   3 +
 drivers/iommu/iommufd/pages.c           |  10 +-
 include/uapi/linux/iommufd.h            |  56 ++++++
 6 files changed, 363 insertions(+), 5 deletions(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2024-09-26 14:00 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-20 18:56 [RFC V1 0/4] iommufd live update Steve Sistare
2024-07-20 18:56 ` [RFC V1 1/4] iommufd: Export do_update_pinned Steve Sistare
2024-07-20 18:56 ` [RFC V1] iommufd debug print Steve Sistare
2024-07-20 19:01   ` Steven Sistare
2024-07-20 18:56 ` [RFC V1 2/4] iommufd: Lock all objects Steve Sistare
2024-07-22 15:37   ` Jason Gunthorpe
2024-08-05 19:01     ` Steven Sistare
2024-09-26 14:00       ` Steven Sistare
2024-07-20 18:56 ` [RFC V1 3/4] iommufd: Add IOMMU_IOAS_CHANGE_PROCESS Steve Sistare
2024-07-20 18:56 ` [RFC V1 4/4] iommufd: update VA Steve Sistare
2024-07-22 15:51   ` Jason Gunthorpe
2024-08-05 19:02     ` Steven Sistare
2024-08-06 12:54       ` Jason Gunthorpe
2024-07-20 19:21 ` [RFC V1 0/4] iommufd live update Steven Sistare
2024-07-22 15:55 ` Jason Gunthorpe
2024-08-05 19:03   ` Steven Sistare
2024-08-06 12:56     ` Jason Gunthorpe
2024-08-08 19:15       ` Steven Sistare
2024-08-08 19:52         ` Jason Gunthorpe
2024-08-12 17:41           ` Steven Sistare
2024-08-19 14:59             ` Jason Gunthorpe
2024-08-21 17:54               ` Steven Sistare
2024-08-21 18:04                 ` Jason Gunthorpe
2024-08-22 21:05                   ` Steven Sistare
2024-08-22 21:10                     ` Jason Gunthorpe
2024-07-23 12:48 ` Jason Gunthorpe
2024-08-05 19:02   ` Steven Sistare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.