From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Zhangbo (Oscar)" <oscar.zhangbo@huawei.com>
Cc: "qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"limingwang \(A\)" <limingwang@huawei.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Jiangyifei <jiangyifei@huawei.com>,
fangying <fangying1@huawei.com>,
"dengkai \(A\)" <dengkai1@huawei.com>
Subject: Re: [Qemu-devel] Discussion: redundant process during hotplug and missed process during unplug
Date: Fri, 19 Jul 2019 06:46:04 -0400 [thread overview]
Message-ID: <20190719064229-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <0259E1C966E8C54AA93AA2B1240828E672DE0920@DGGEML529-MBS.china.huawei.com>
On Fri, Jul 19, 2019 at 02:35:14AM +0000, Zhangbo (Oscar) wrote:
> Hi All:
> I have 2 questions about (un)hotplug on pcie-root-port.
> First Question (hotplug failure because of redundant PCI_EXP_LNKSTA_DLLLA bit set):
> during VM boot, qemu sets PCI_EXP_LNKSTA_DLLLA according to this process:
> pcie_cap_init() -> pcie_cap_v1_fill(),
> even if there's no pcie device added to the VM.
> I noticed that during hotplug, qemu also sets PCI_EXP_LNKSTA_DLLLA in pcie_cap_slot_hotplug_cb().
> It means that the bit PCI_EXP_LNKSTA_DLLLA is set TWICE.
> why set this bit during initializing pcie-root-port? It seems unnecessary.
Makes sense.
> The bad side of this is it causes HOTPLUG FAILURE if we boot the VM and hotplug a pcie device at the same time:
> In VM kernel,according to this bit set, it senses a PDC event, the process is:
> pciehp_probe -> pcie_init -> pcie_init_slot -> pciehp_queue_pushbutton_work.
> If the 2 PDC events get too close, the VM kernel will wrongly unplug the device.
> Suggestion to the 1st problem:
> Can I remove the PCI_EXP_LNKSTA_DLLLA bit set process during pcie_cap_init().
>
> Second Question (time cost too much during pcie device unplug):
> qemu only send ABP event to VM kernel during unpluging pcie devices, VM kernel receives the
> ABP event then sleep 5s to expect a PDC event, which causes unpluging devices takes too long.
> Suggestion to the 2nd problem:
> Can I send ABP and *PDC* events to kernet when unplug devices.
I think we should not only set PDC but also try clearing presence bit,
even though the device is actually still there and mapped into guest
memory.
Maybe we should also not send the ABP event at all.
In both cases it's necessary to test with a non-linux guest
(e.g. a couple of versions of windows) to be sure we are not breaking
anything.
--
MST
next prev parent reply other threads:[~2019-07-19 10:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-19 2:35 [Qemu-devel] Discussion: redundant process during hotplug and missed process during unplug Zhangbo (Oscar)
2019-07-19 10:46 ` Michael S. Tsirkin [this message]
2019-07-20 7:24 ` fangying
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=20190719064229-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dengkai1@huawei.com \
--cc=fangying1@huawei.com \
--cc=jiangyifei@huawei.com \
--cc=limingwang@huawei.com \
--cc=oscar.zhangbo@huawei.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.