]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb6f1f901ac60cec08d40f19fd8f43c805cd7981c
tree43ceafc9db32536a1a784a366c74bf2a3f69c75e
parentcee037ae658d45c0c53ca93306e8d39f41cc8ea2
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