linux/drivers/vfio/pci
Longfang Liu b398f91779 hisi_acc_vfio_pci: register debugfs for hisilicon migration driver
On the debugfs framework of VFIO, if the CONFIG_VFIO_DEBUGFS macro is
enabled, the debug function is registered for the live migration driver
of the HiSilicon accelerator device.

After registering the HiSilicon accelerator device on the debugfs
framework of live migration of vfio, a directory file "hisi_acc"
of debugfs is created, and then three debug function files are
created in this directory:

   vfio
    |
    +---<dev_name1>
    |    +---migration
    |        +--state
    |        +--hisi_acc
    |            +--dev_data
    |            +--migf_data
    |            +--cmd_state
    |
    +---<dev_name2>
         +---migration
             +--state
             +--hisi_acc
                 +--dev_data
                 +--migf_data
                 +--cmd_state

dev_data file: read device data that needs to be migrated from the
current device in real time
migf_data file: read the migration data of the last live migration
from the current driver.
cmd_state: used to get the cmd channel state for the device.

+----------------+        +--------------+       +---------------+
| migration dev  |        |   src  dev   |       |   dst  dev    |
+-------+--------+        +------+-------+       +-------+-------+
        |                        |                       |
        |                 +------v-------+       +-------v-------+
        |                 |  saving_migf |       | resuming_migf |
  read  |                 |     file     |       |     file      |
        |                 +------+-------+       +-------+-------+
        |                        |          copy         |
        |                        +------------+----------+
        |                                     |
+-------v--------+                    +-------v--------+
|   data buffer  |                    |   debug_migf   |
+-------+--------+                    +-------+--------+
        |                                     |
   cat  |                                 cat |
+-------v--------+                    +-------v--------+
|   dev_data     |                    |   migf_data    |
+----------------+                    +----------------+

When accessing debugfs, user can obtain the most recent status data
of the device through the "dev_data" file. It can read recent
complete status data of the device. If the current device is being
migrated, it will wait for it to complete.
The data for the last completed migration function will be stored
in debug_migf. Users can read it via "migf_data".

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Link: https://lore.kernel.org/r/20241112073322.54550-4-liulongfang@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2024-11-13 14:58:47 -07:00
..
hisilicon hisi_acc_vfio_pci: register debugfs for hisilicon migration driver 2024-11-13 14:58:47 -07:00
mlx5 [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
nvgrace-gpu vfio/nvgrace-gpu: Add a new GH200 SKU to the devid table 2024-10-30 13:35:18 -06:00
pds [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
qat vfio/qat: fix overflow check in qat_vf_resume_write() 2024-10-30 13:38:38 -06:00
virtio vfio/pci: rename and export range_intersect_range 2024-02-22 12:20:20 -07:00
Kconfig vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices 2024-04-29 13:25:41 -06:00
Makefile vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices 2024-04-29 13:25:41 -06:00
trace.h vfio/pci: Cleanup license mess 2019-01-22 11:06:05 -07:00
vfio_pci_config.c vfio/pci: rename and export range_intersect_range 2024-02-22 12:20:20 -07:00
vfio_pci_core.c VFIO updates for v6.12 2024-09-24 12:07:47 -07:00
vfio_pci_igd.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00
vfio_pci_intrs.c vfio/pci: fix potential memory leak in vfio_intx_enable() 2024-04-22 16:52:08 -06:00
vfio_pci_priv.h vfio/pci: Mask INTx during runtime suspend 2022-09-01 15:29:11 -06:00
vfio_pci_rdwr.c vfio/pci: Support 8-byte PCI loads and stores 2024-06-21 12:47:01 -06:00
vfio_pci_zdev.c Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next 2022-09-08 10:44:34 -06:00
vfio_pci.c VFIO: Add the SPR_DSA and SPR_IAX devices to the denylist 2024-05-13 14:07:33 +00:00