qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Discussion: redundant process during hotplug and missed pro


From: Zhangbo (Oscar)
Subject: [Qemu-devel] Discussion: redundant process during hotplug and missed process during unplug
Date: Fri, 19 Jul 2019 02:35:14 +0000

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.
    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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]