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: NLongfang Liu <liulongfang@huawei.com> Reviewed-by: NHao Fang <fanghao11@huawei.com> Reviewed-by: NMingqiang Ling <lingmingqiang@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录