Unverified Commit da4c6158 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11952 migration: fix reference counting exception issue

Merge Pull Request from: @xiao_jiang_shui 
 
 In a live migration scenario, if the number of VFs at the
 destination is greater than that at the source, the recovery
 operation will fail and qemu will not complete the process
 of closing the device FD after exiting.
 Causes the device reference count to be abnormal, causing
 the driver to be unable to be uninstalled.

issue: https://gitee.com/openeuler/kernel/issues/IAUHWX 
 
Link:https://gitee.com/openeuler/kernel/pulls/11952

 

Reviewed-by: default avatarYang Shen <shenyang39@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 431dd11d 6976e22a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1679,6 +1679,7 @@ static void hisi_acc_vfio_pci_close_device(struct vfio_device *core_vdev)
	if (core_vdev->mig_ops)
		vf_debugfs_exit(hisi_acc_vdev);

	hisi_acc_vf_disable_fds(hisi_acc_vdev);
	iounmap(vf_qm->io_base);
	vfio_pci_core_close_device(core_vdev);
}
@@ -1699,6 +1700,7 @@ static int hisi_acc_vfio_pci_migrn_init_dev(struct vfio_device *core_vdev)
	hisi_acc_vdev->vf_id = pci_iov_vf_id(pdev) + 1;
	hisi_acc_vdev->pf_qm = pf_qm;
	hisi_acc_vdev->vf_dev = pdev;
	hisi_acc_vdev->vf_qm_state = QM_NOT_READY;
	mutex_init(&hisi_acc_vdev->state_mutex);

	core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_PRE_COPY;