vfio: Introduce the DMA logging feature support
authorYishai Hadas <yishaih@nvidia.com>
Thu, 8 Sep 2022 18:34:43 +0000 (21:34 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 8 Sep 2022 18:59:00 +0000 (12:59 -0600)
commit80c4b92a2dc48cce82a0348add48533db7e07314
tree43ceafc9db32536a1a784a366c74bf2a3f69c75e
parent58ccf0190d19d9a8a41f8a02b9e06742b58df4a1
vfio: Introduce the DMA logging feature support

Introduce the DMA logging feature support in the vfio core layer.

It includes the processing of the device start/stop/report DMA logging
UAPIs and calling the relevant driver 'op' to do the work.

Specifically,
Upon start, the core translates the given input ranges into an interval
tree, checks for unexpected overlapping, non aligned ranges and then
pass the translated input to the driver for start tracking the given
ranges.

Upon report, the core translates the given input user space bitmap and
page size into an IOVA kernel bitmap iterator. Then it iterates it and
call the driver to set the corresponding bits for the dirtied pages in a
specific IOVA range.

Upon stop, the driver is called to stop the previous started tracking.

The next patches from the series will introduce the mlx5 driver
implementation for the logging ops.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20220908183448.195262-6-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/Kconfig
drivers/vfio/pci/vfio_pci_core.c
drivers/vfio/vfio_main.c
include/linux/vfio.h