Commit 58754e77 authored by Longfang Liu's avatar Longfang Liu Committed by Zheng Zengkai
Browse files

vfio/pci: provide customized live migration VFIO driver framework

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I473Q4?from=project-issue



----------------------------------------------------------------------

vfio_pci_vendor_driver_ops includes these parts:
(1) .probe() and .remove() interface to be called by vfio_pci_probe()
and vfio_pci_remove().
(2) pointer to struct vfio_device_ops. It will be registered as ops of vfio
device if .probe() succeeds.
(3) vendor modules call macro module_vfio_pci_register_vendor_handler to
generate module_init and module_exit.
(4) export functions vfio_pci_vendor_data(), vfio_pci_irq_type(),
vfio_pci_num_regions(), vfio_pci_pdev(), and functions in vfio_pci_ops,
so they are able to be called from outside modules and make them a kind of
inherited by vfio_device_ops provided by vendor modules
(5) allows a simpler VFIO_DEVICE_GET_INFO ioctl in vendor driver,
let vfio_pci know number of vendor regions and vendor irqs
(6) allows vendor driver to read/write to bars directly which is useful
in security checking condition.
(7) allows vendor driver triggers this VFIO_IRQ_TYPE_REMAP_BAR_REGION
when it wants to notify userspace to remap PCI BARs.

Signed-off-by: default avatarLongfang Liu <liulongfang@huawei.com>
Reviewed-by: default avatarHao Fang <fanghao11@huawei.com>
Reviewed-by: default avatarMingqiang Ling <lingmingqiang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 716406d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment