RE: [PATCH 1/2] vfio/xe: Reorganize the init to decouple migration from reset

From: Tian, Kevin

Date: Thu Apr 09 2026 - 05:28:37 EST


> From: Winiarski, Michal <michal.winiarski@xxxxxxxxx>
> Sent: Thursday, April 9, 2026 12:04 AM
>
> xe_vfio_pci_migration_ops = {
> static void xe_vfio_pci_migration_init(struct xe_vfio_pci_core_device
> *xe_vdev)
> {
> struct vfio_device *core_vdev = &xe_vdev->core_device.vdev;
> - struct pci_dev *pdev = to_pci_dev(core_vdev->dev);
> - struct xe_device *xe = xe_sriov_vfio_get_pf(pdev);
>
> - if (!xe)
> - return;
> - if (!xe_sriov_vfio_migration_supported(xe))
> + if (!xe_sriov_vfio_migration_supported(xe_vdev->xe))
> return;
>
> mutex_init(&xe_vdev->state_mutex);
> spin_lock_init(&xe_vdev->reset_lock);
>

those two belongs to xe_vfio_pci_vf_init() as a non-migratable
vf still requires them, e.g. in xe_vfio_pci_reset_done()?