All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/4] iommufd live update
@ 2024-09-26 13:53 Steve Sistare
  2024-09-26 13:53 ` [PATCH V2 1/4] iommufd: Export do_update_pinned Steve Sistare
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Steve Sistare @ 2024-09-26 13:53 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.
It atomically updates everything to the current process, grabbing the new mm,
and transferring pinned page counts.

IOMMU_IOAS_CHANGE_PROCESS only supports DMA mappings created with
IOMMU_IOAS_MAP_FILE, because the kernel metadata for such mappings does not 
depend on the userland VA of the pages (which is different in the new process).
IOMMU_IOAS_CHANGE_PROCESS fails if other types of mappings are present.  

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

This series depends on the series:
  [PATCH V2] iommu_ioas_map_file

This is implemented in QEMU by the series:
   [PATCH] Live update: iommufd (V2 to be posted shortly)

Changes in V2:
  * deleted interface to update VA
  * add selftest cases

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

 drivers/iommu/iommufd/io_pagetable.h          |   6 +
 drivers/iommu/iommufd/ioas.c                  | 209 ++++++++++++++++++++++++++
 drivers/iommu/iommufd/iommufd_private.h       |   2 +
 drivers/iommu/iommufd/main.c                  |   3 +
 drivers/iommu/iommufd/pages.c                 |  10 +-
 include/uapi/linux/iommufd.h                  |  23 +++
 tools/testing/selftests/iommu/Makefile        |   1 +
 tools/testing/selftests/iommu/iommufd.c       | 148 +++++++++++++++++-
 tools/testing/selftests/iommu/iommufd_utils.h |   8 +-
 9 files changed, 398 insertions(+), 12 deletions(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2024-10-07 16:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 13:53 [PATCH V2 0/4] iommufd live update Steve Sistare
2024-09-26 13:53 ` [PATCH V2 1/4] iommufd: Export do_update_pinned Steve Sistare
2024-10-02 17:34   ` Jason Gunthorpe
2024-09-26 13:53 ` [PATCH V2 2/4] iommufd: Lock all objects Steve Sistare
2024-10-07 16:18   ` Steven Sistare
2024-10-07 16:43     ` Jason Gunthorpe
2024-09-26 13:53 ` [PATCH V2 3/4] iommufd: Add IOMMU_IOAS_CHANGE_PROCESS Steve Sistare
2024-10-02 17:51   ` Jason Gunthorpe
2024-10-04 19:43     ` Steven Sistare
2024-10-04 20:20       ` Jason Gunthorpe
2024-09-26 13:53 ` [PATCH V2 4/4] iommufd: IOMMU_IOAS_CHANGE_PROCESS selftest Steve Sistare
2024-10-07 16:05   ` Steven Sistare
2024-10-07 16:56     ` Jason Gunthorpe

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.