kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Yicong Yang <yangyicong@hisilicon.com>
Cc: <cohuck@redhat.com>, <kvm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Zengtao (B)" <prime.zeng@hisilicon.com>,
	Linuxarm <linuxarm@huawei.com>
Subject: Re: [Question] Indefinitely block in the host when remove the PF driver
Date: Fri, 30 Apr 2021 08:29:40 -0600	[thread overview]
Message-ID: <20210430082940.4b0e0397@redhat.com> (raw)
In-Reply-To: <c9466e2c-385d-8298-d03c-80dcfc359f52@hisilicon.com>

On Fri, 30 Apr 2021 15:57:47 +0800
Yicong Yang <yangyicong@hisilicon.com> wrote:

> When I try to remove the PF driver in the host, the process will be blocked
> if the related VF of the device is added in the Qemu as an iEP.
> 
> here's what I got in the host:
> 
> [root@localhost 0000:75:00.0]# rmmod hisi_zip
> [99760.571352] vfio-pci 0000:75:00.1: Relaying device request to user (#0)
> [99862.992099] vfio-pci 0000:75:00.1: Relaying device request to user (#10)
> [...]
> 
> and in the Qemu:
> 
> estuary:/$ lspci -tv
> -[0000:00]-+-00.0  Device 1b36:0008
>            +-01.0  Device 1af4:1000
>            +-02.0  Device 1af4:1009
>            \-03.0  Device 19e5:a251 <----- the related VF device
> estuary:/$ qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging
> qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging
> qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging
> qemu-system-aarch64: warning: vfio 0000:75:00.1: Bus 'pcie.0' does not support hotplugging
> [...]
> 
> The rmmod process will be blocked until I kill the Qemu process. That's the only way if I
> want to end the rmmod.
> 
> So my question is: is such block reasonable? If the VF devcie is occupied or doesn't
> support hotplug in the Qemu, shouldn't we fail the rmmod and return something like -EBUSY
> rather than make the host blocked indefinitely?

Where would we return -EBUSY?  pci_driver.remove() returns void.
Without blocking, I think our only option would be to kill the user
process.
 
> Add the VF under a pcie root port will avoid this. Is it encouraged to always
> add the VF under a pcie root port rather than directly add it as an iEP?

Releasing a device via the vfio request interrupt is always a
cooperative process currently, the VM needs to be configured such that
the device is capable of being unplugged and the guest needs to respond
to the ejection request.  Thanks,

Alex


  reply	other threads:[~2021-04-30 14:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  7:57 [Question] Indefinitely block in the host when remove the PF driver Yicong Yang
2021-04-30 14:29 ` Alex Williamson [this message]
2021-05-11  3:44   ` Yicong Yang
2021-05-18 19:39     ` Alex Williamson

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=20210430082940.4b0e0397@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=yangyicong@hisilicon.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;
as well as URLs for NNTP newsgroup(s).