Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH V3 0/4] iommufd live update
@ 2024-10-07 17:13 Steve Sistare
  2024-10-07 17:13 ` [PATCH V3 1/4] iommufd: Export do_update_pinned Steve Sistare
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Steve Sistare @ 2024-10-07 17:13 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 V3] iommu_ioas_map_file

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

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

Changes in V3:
  * replaced lockdep_off with down_write_nest_lock
  * cosmetic changes as requested
  * check for zero length in iommufd_ioas_map_file

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                  | 207 ++++++++++++++++++++++++++
 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 |  34 +++--
 9 files changed, 409 insertions(+), 25 deletions(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2024-11-07 20:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 17:13 [PATCH V3 0/4] iommufd live update Steve Sistare
2024-10-07 17:13 ` [PATCH V3 1/4] iommufd: Export do_update_pinned Steve Sistare
2024-10-07 17:13 ` [PATCH V3 2/4] iommufd: Lock all objects Steve Sistare
2024-11-07 20:23   ` Jason Gunthorpe
2024-10-07 17:13 ` [PATCH V3 3/4] iommufd: Add IOMMU_IOAS_CHANGE_PROCESS Steve Sistare
2024-11-06 18:08   ` Jason Gunthorpe
2024-11-06 18:55     ` Steven Sistare
2024-11-07 20:25   ` Jason Gunthorpe
2024-10-07 17:13 ` [PATCH V3 4/4] iommufd: IOMMU_IOAS_CHANGE_PROCESS selftest Steve Sistare
2024-11-07 20:26   ` Jason Gunthorpe
2024-11-07 20:47     ` Steven Sistare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox