public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Longfang Liu <liulongfang@huawei.com>
Cc: <jgg@nvidia.com>, <shameerali.kolothum.thodi@huawei.com>,
	<jonathan.cameron@huawei.com>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@openeuler.org>
Subject: Re: [PATCH v6 4/5] hisi_acc_vfio_pci: bugfix the problem of uninstalling driver
Date: Fri, 21 Mar 2025 09:51:50 -0600	[thread overview]
Message-ID: <20250321095150.7fe81186.alex.williamson@redhat.com> (raw)
In-Reply-To: <20250318064548.59043-5-liulongfang@huawei.com>

On Tue, 18 Mar 2025 14:45:47 +0800
Longfang Liu <liulongfang@huawei.com> wrote:

> In a live migration scenario. If the number of VFs at the
> destination is greater than the source, the recovery operation
> will fail and qemu will not be able to complete the process and
> exit after shutting down the device FD.
> 
> This will cause the driver to be unable to be unloaded normally due
> to abnormal reference counting of the live migration driver caused
> by the abnormal closing operation of fd.

"Therefore, make sure the migration file descriptor references are
 always released when the device is closed."

The commit log identifies the problem, but it's generally also useful
to describe the resolution of the problem as well.  Thanks,

Alex

> Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
> Signed-off-by: Longfang Liu <liulongfang@huawei.com>
> Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> ---
>  drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> index d96446f499ed..cadc82419dca 100644
> --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> @@ -1508,6 +1508,7 @@ static void hisi_acc_vfio_pci_close_device(struct vfio_device *core_vdev)
>  	struct hisi_acc_vf_core_device *hisi_acc_vdev = hisi_acc_get_vf_dev(core_vdev);
>  	struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm;
>  
> +	hisi_acc_vf_disable_fds(hisi_acc_vdev);
>  	mutex_lock(&hisi_acc_vdev->open_mutex);
>  	hisi_acc_vdev->dev_opened = false;
>  	iounmap(vf_qm->io_base);


  reply	other threads:[~2025-03-21 15:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  6:45 [PATCH v6 0/5] bugfix some driver issues Longfang Liu
2025-03-18  6:45 ` [PATCH v6 1/5] hisi_acc_vfio_pci: fix XQE dma address error Longfang Liu
2025-03-21  9:09   ` liulongfang
2025-03-21 15:51   ` Alex Williamson
2025-03-28  8:04     ` liulongfang
2025-03-28 14:03       ` Alex Williamson
2025-03-18  6:45 ` [PATCH v6 2/5] hisi_acc_vfio_pci: add eq and aeq interruption restore Longfang Liu
2025-03-18  6:45 ` [PATCH v6 3/5] hisi_acc_vfio_pci: bugfix cache write-back issue Longfang Liu
2025-03-18  6:45 ` [PATCH v6 4/5] hisi_acc_vfio_pci: bugfix the problem of uninstalling driver Longfang Liu
2025-03-21 15:51   ` Alex Williamson [this message]
2025-03-28  8:06     ` liulongfang
2025-03-18  6:45 ` [PATCH v6 5/5] hisi_acc_vfio_pci: bugfix live migration function without VF device driver Longfang Liu
2025-03-21 15:52   ` Alex Williamson
2025-03-28  8:28     ` liulongfang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250321095150.7fe81186.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=liulongfang@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox