Add device DMA logging support for mlx5 driver
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | vfio/mlx5: Protect mlx5vf_disable_fds() upon close devicedrivers/ drivers/ drivers/ | +12 | 0 replies | |
| 2/13 | vfio: Split migration ops from main device opsdrivers/ drivers/ drivers/ +4 more | +51 | 0 replies | |
| 3/13 | net/mlx5: Introduce ifc bits for page trackerinclude/ | +78 | 0 replies | |
| 4/13 | net/mlx5: Query ADV_VIRTUALIZATION capabilitiesdrivers/ drivers/ include/ | +16 | 0 replies | |
| 5/13 | vfio: Introduce DMA logging uAPIsinclude/ | +79 | 0 replies | |
| 6/13 | vfio: Move vfio.c to vfio_main.cdrivers/ drivers/ | +2 | 0 replies | |
| 7/13 | vfio: Add an IOVA bitmap supportdrivers/ drivers/ include/ | +214 | 0 replies | |
| 8/13 | vfio: Introduce the DMA logging feature supportdrivers/ drivers/ include/ | +186 | 1 reply | |
| 9/13 | vfio/mlx5: Init QP based resources for dirty trackingdrivers/ drivers/ | +636 | 0 replies | |
| 10/13 | vfio/mlx5: Create and destroy page tracker objectdrivers/ drivers/ | +148 | 0 replies | |
| 11/13 | vfio/mlx5: Report dirty pages from trackerdrivers/ drivers/ | +195 | 0 replies | |
| 12/13 | vfio/mlx5: Manage error scenarios on trackerdrivers/ drivers/ | +61 | 0 replies | |
| 13/13 | vfio/mlx5: Set the driver DMA logging callbacksdrivers/ drivers/ drivers/ | +14 | 0 replies |
Reviews trailers per patch
2 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Kevin Tian |
|---|---|
| 1/13 | R-b |
| 2/13 | R-b |
| 3/13 | |
| 4/13 | |
| 5/13 | |
| 6/13 | |
| 7/13 | |
| 8/13 | |
| 9/13 | |
| 10/13 | |
| 11/13 | |
| 12/13 | |
| 13/13 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH vfio 00/13] Add device DMA logging support for mlx5 driver
This series adds device DMA logging uAPIs and their implementation as part of mlx5 driver.
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.
The uAPIs are based on the FEATURE ioctl as were introduced earlier by the below RFC [1] and follows the notes that were discussed in the mailing list.
It includes:
- A PROBE option to detect if the device supports DMA logging.
- A SET option to start device DMA logging in given IOVAs ranges.
- A GET option to read back and clear the device DMA log.
- A SET option to stop device DMA logging that was previously started.
Extra details exist as part of relevant patches in the series.
In addition, the series adds some infrastructure support for managing an IOVA bitmap done by Joao Martins.
It abstracts how an IOVA range is represented in a bitmap that is granulated by a given page_size. So it translates all the lifting of dealing with user pointers into its corresponding kernel addresses backing said user memory into doing finally the bitmap ops to change various bits.
This functionality will be used as part of IOMMUFD series for the system IOMMU tracking.
Finally, we come with mlx5 implementation based on its device specification for the DMA logging APIs.
The matching qemu changes can be previewed here [2].
They come on top of the v2 migration protocol patches that were sent already to the mailing list.
Few notes:
- The first 2 patches were sent already separately, as the series relies on add them here as well.
- As this series touched mlx5_core parts we may need to send the net/mlx5 patches as a pull request format to VFIO to avoid conflicts before acceptance.
[1] https://lore.kernel.org/all/[email protected]/T/
[2] https://github.com/avihai1122/qemu/commits/device_dirty_tracking
Yishai
Jason Gunthorpe (1):
vfio: Move vfio.c to vfio_main.c
Joao Martins (1):
vfio: Add an IOVA bitmap support
Yishai Hadas (11):
vfio/mlx5: Protect mlx5vf_disable_fds() upon close device
vfio: Split migration ops from main device ops net/mlx5: Introduce ifc bits for page tracker net/mlx5: Query ADV_VIRTUALIZATION capabilities
vfio: Introduce DMA logging uAPIs
vfio: Introduce the DMA logging feature support vfio/mlx5: Init QP based resources for dirty tracking vfio/mlx5: Create and destroy page tracker object vfio/mlx5: Report dirty pages from tracker vfio/mlx5: Manage error scenarios on tracker vfio/mlx5: Set the driver DMA logging callbacks
drivers/net/ethernet/mellanox/mlx5/core/fw.c | 6 +
.../net/ethernet/mellanox/mlx5/core/main.c | 1 +
drivers/vfio/Makefile | 4 +
drivers/vfio/iova_bitmap.c | 164 +++
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 11 +-
drivers/vfio/pci/mlx5/cmd.c | 1007 ++++++++++++++++-
drivers/vfio/pci/mlx5/cmd.h | 65 +-
drivers/vfio/pci/mlx5/main.c | 18 +-
drivers/vfio/pci/vfio_pci_core.c | 12 +
drivers/vfio/{vfio.c => vfio_main.c} | 173 ++-
include/linux/iova_bitmap.h | 46 +
include/linux/mlx5/device.h | 9 +
include/linux/mlx5/mlx5_ifc.h | 79 +-
include/linux/vfio.h | 47 +-
include/uapi/linux/vfio.h | 79 ++
15 files changed, 1683 insertions(+), 38 deletions(-)
create mode 100644 drivers/vfio/iova_bitmap.c
rename drivers/vfio/{vfio.c => vfio_main.c} (93%)
create mode 100644 include/linux/iova_bitmap.hSignature · 1 line
2.18.1