]> git.baikalelectronics.ru Git - kernel.git/commit
vfio: Introduce DMA logging uAPIs
authorYishai Hadas <yishaih@nvidia.com>
Thu, 8 Sep 2022 18:34:41 +0000 (21:34 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 8 Sep 2022 18:59:00 +0000 (12:59 -0600)
commit5b1a727bac0a7cf3f86697debc59c471f1826e17
treed8a3b7c8a515b5cac64918f6d23f80ae25c4de0d
parente3d8b5b7f948ea327deba3b40c42e2f0096b1a89
vfio: Introduce DMA logging uAPIs

DMA logging allows a device to internally record what DMAs the device is
initiating and report them back to userspace. It is part of the VFIO
migration infrastructure that allows implementing dirty page tracking
during the pre copy phase of live migration. Only DMA WRITEs are logged,
and this API is not connected to VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE.

This patch introduces the DMA logging involved uAPIs.

It uses the FEATURE ioctl with its GET/SET/PROBE options as of below.

It exposes a PROBE option to detect if the device supports DMA logging.
It exposes a SET option to start device DMA logging in given IOVAs
ranges.
It exposes a SET option to stop device DMA logging that was previously
started.
It exposes a GET option to read back and clear the device DMA log.

Extra details exist as part of vfio.h per a specific option.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20220908183448.195262-4-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
include/uapi/linux/vfio.h