qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Failed to hot-plug device to pxb bridge
@ 2024-05-30  8:29 Gao,Shiyuan via
       [not found] ` <20240530160919.01a3effc@imammedo.users.ipa.redhat.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Gao,Shiyuan via @ 2024-05-30  8:29 UTC (permalink / raw)
  To: imammedo@redhat.com, Daniel P. Berrangé; +Cc: qemu-devel@nongnu.org

Hi Igor, Daniel and all:

https://lore.kernel.org/all/20220422135101.65796823@redhat.com/t/#r831d589f243c24334a09995620b74408847a87a0

This message discuss hotplug device to pxb bridge. At the end, Igor suggested enable shpc on pxb bridge:
  pxb_dev_realize_common():
     qdev_prop_set_bit(bds, PCI_BRIDGE_DEV_PROP_SHPC, true);

Howerver, I tried it and the guest can't find the device on pxb bridge. Add some log, QEMU use hotplug handler shpc_device_plug_cb.

QEMU command line:
-device pxb,bus_nr=96,id=pci.1,numa_node=0,bus=pci.0,addr=0x3
-device pxb,bus_nr=128,id=pci.2,numa_node=1,bus=pci.0,addr=0x4
-device pci-bridge,chassis_nr=3,id=pci.3,bus=pci.0,addr=0x5
-device pci-bridge,chassis_nr=4,id=pci.4,bus=pci.0,addr=0x6 
-device pci-bridge,chassis_nr=5,id=pci.5,bus=pci.1,addr=0x1 
-device pci-bridge,chassis_nr=6,id=pci.6,bus=pci.2,addr=0x1

Hotplug command:
{"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/home/test/data1.img,format=qcow2,if=none,id=drive-virtio-disk1,cache=none"}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","scsi":"off","bus":"pci.5","addr":"0x1","drive":"drive-virtio-disk1","id":"virtio-disk1"}}

Some info in the guest:
[root@localhost ~]# lspci -tv
-+-[0000:80]---00.0-[81-82]----01.0-[82]--
 +-[0000:60]---00.0-[61-62]----01.0-[62]--
 \-[0000:00]-+-00.0  Intel Corporation 440FX - 82441FX PMC [Natoma]
             +-01.0  Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
             +-01.1  Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
             +-01.2  Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II]
             +-01.3  Intel Corporation 82371AB/EB/MB PIIX4 ACPI
             +-02.0  Cirrus Logic GD 5446
             +-03.0  Red Hat, Inc. QEMU PCI Expander bridge
             +-04.0  Red Hat, Inc. QEMU PCI Expander bridge
             +-05.0-[01]--
             +-06.0-[02]--
             +-07.0  Red Hat, Inc. Virtio network device
             +-08.0  Red Hat, Inc. Virtio block device
             \-09.0  Red Hat, Inc. Virtio memory balloon
[root@localhost boot]# grep -i 'shpc' config-3.10.0-1160.83.1.el7.x86_64
CONFIG_HOTPLUG_PCI_SHPC=y
[root@localhost boot]# uname -r
3.10.0-1160.83.1.el7.x86_64

Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Failed to hot-plug device to pxb bridge
       [not found] ` <20240530160919.01a3effc@imammedo.users.ipa.redhat.com>
@ 2024-06-21  2:50   ` Gao,Shiyuan via
  2024-06-24  3:08     ` Gao,Shiyuan via
  0 siblings, 1 reply; 4+ messages in thread
From: Gao,Shiyuan via @ 2024-06-21  2:50 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: mst@redhat.com, qemu-devel@nongnu.org, berrange@redhat.com

Sorry for not replying earlier, I have been busy with other things.

> > Hi Igor, Daniel and all:
> >
> >  https://lore.kernel.org/all/20220422135101.65796823@redhat.com/t/#r831d589f243c24334a09995620b74408847a87a0
> >
> > This message discuss hotplug device to pxb bridge. At the end, Igor suggested enable shpc on pxb bridge:
> >   pxb_dev_realize_common():
> >      qdev_prop_set_bit(bds, PCI_BRIDGE_DEV_PROP_SHPC, true);
>
>
> you can try check if hotplug gets to shpc_device_plug_cb() and what it does there
> if it gets to the end but you don't get any reaction from guest OS
> it might be a guest issue.

I checked the guest dmesg and found that failed load shpc driver.

  [    0.966668] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
  [    0.968238] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
  [    0.969160] shpchp 0000:00:05.0: Cannot get control of SHPC hotplug
  [    0.969876] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S30_)
  [    0.971454] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
  [    0.972376] shpchp 0000:00:06.0: Cannot get control of SHPC hotplug
  [    0.973119] shpchp 0000:80:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
  [    0.974674] shpchp 0000:80:00.0: Cannot get control of SHPC hotplug
  [    0.979422] shpchp 0000:81:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
  [    0.980948] shpchp 0000:81:01.0: Cannot get control of SHPC hotplug
  [    0.981685] shpchp 0000:60:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
  [    0.994623] shpchp 0000:60:00.0: Cannot get control of SHPC hotplug
  [    0.995349] shpchp 0000:61:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
  [    0.996891] shpchp 0000:61:01.0: Cannot get control of SHPC hotplug
  [    0.997626] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4

Read the shpc driver code, I found that before shpc_init it need check the shpc capability of bridge(shpc_capable) and
get hotplug control from firmware(acpi_get_hp_hw_control_from_firmware) in shpc_probe.

Howerver it return fail in acpi_get_hp_hw_control_from_firmware. I dump the acpid table, not found OSC and OSHP
method in dsdt.dsl.

In the QEMU build_dsdt, not found build osc method in i440fx.

Putting aside this pxb scenario, I suspect that after disable acpi-pci-hotplug-with-bridge-support,
hot-plug into the PCI bridge via SHPC can be successful in i440fx ?


> > Howerver, I tried it and the guest can't find the device on pxb bridge. Add some log, QEMU use hotplug handler shpc_device_plug_cb.
> >
> > QEMU command line:
> > -device pxb,bus_nr=96,id=pci.1,numa_node=0,bus=pci.0,addr=0x3
> > -device pxb,bus_nr=128,id=pci.2,numa_node=1,bus=pci.0,addr=0x4
> > -device pci-bridge,chassis_nr=3,id=pci.3,bus=pci.0,addr=0x5
> > -device pci-bridge,chassis_nr=4,id=pci.4,bus=pci.0,addr=0x6
> > -device pci-bridge,chassis_nr=5,id=pci.5,bus=pci.1,addr=0x1
> > -device pci-bridge,chassis_nr=6,id=pci.6,bus=pci.2,addr=0x1
> >
> > Hotplug command:
> > {"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/home/test/data1.img,format=qcow2,if=none,id=drive-virtio-disk1,cache=none"}}
> > {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","scsi":"off","bus":"pci.5","addr":"0x1","drive":"drive-virtio-disk1","id":"virtio-disk1"}}
> >
> > Some info in the guest:
> > [root@localhost ~]# lspci -tv
> > -+-[0000:80]---00.0-[81-82]----01.0-[82]--
> >  +-[0000:60]---00.0-[61-62]----01.0-[62]--
> >  \-[0000:00]-+-00.0  Intel Corporation 440FX - 82441FX PMC [Natoma]
> >              +-01.0  Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> >              +-01.1  Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> >              +-01.2  Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II]
> >              +-01.3  Intel Corporation 82371AB/EB/MB PIIX4 ACPI
> >              +-02.0  Cirrus Logic GD 5446
> >              +-03.0  Red Hat, Inc. QEMU PCI Expander bridge
> >              +-04.0  Red Hat, Inc. QEMU PCI Expander bridge
> >              +-05.0-[01]--
> >              +-06.0-[02]--
> >              +-07.0  Red Hat, Inc. Virtio network device
> >              +-08.0  Red Hat, Inc. Virtio block device
> >              \-09.0  Red Hat, Inc. Virtio memory balloon
> > [root@localhost boot]# grep -i 'shpc' config-3.10.0-1160.83.1.el7.x86_64
> > CONFIG_HOTPLUG_PCI_SHPC=y
> > [root@localhost boot]# uname -r
> > 3.10.0-1160.83.1.el7.x86_64
> >
> > Thanks.
> >
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Failed to hot-plug device to pxb bridge
  2024-06-21  2:50   ` Gao,Shiyuan via
@ 2024-06-24  3:08     ` Gao,Shiyuan via
  2024-06-24 10:13       ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Gao,Shiyuan via @ 2024-06-24  3:08 UTC (permalink / raw)
  To: Gao,Shiyuan, imammedo@redhat.com
  Cc: qemu-devel@nongnu.org, mst@redhat.com, berrange@redhat.com

> I checked the guest dmesg and found that failed load shpc driver.
>   [    0.966668] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
>   [    0.968238] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
>   [    0.969160] shpchp 0000:00:05.0: Cannot get control of SHPC hotplug
>   [    0.969876] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S30_)
>   [    0.971454] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
>   [    0.972376] shpchp 0000:00:06.0: Cannot get control of SHPC hotplug
>   [    0.973119] shpchp 0000:80:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
>   [    0.974674] shpchp 0000:80:00.0: Cannot get control of SHPC hotplug
>   [    0.979422] shpchp 0000:81:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
>   [    0.980948] shpchp 0000:81:01.0: Cannot get control of SHPC hotplug
>   [    0.981685] shpchp 0000:60:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
>   [    0.994623] shpchp 0000:60:00.0: Cannot get control of SHPC hotplug
>   [    0.995349] shpchp 0000:61:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
>   [    0.996891] shpchp 0000:61:01.0: Cannot get control of SHPC hotplug
>   [    0.997626] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
> Read the shpc driver code, I found that before shpc_init it need check the shpc capability of bridge(shpc_capable) and
> get hotplug control from firmware(acpi_get_hp_hw_control_from_firmware) in shpc_probe.
> Howerver it return fail in acpi_get_hp_hw_control_from_firmware. I dump the acpid table, not found OSC and OSHP
> method in dsdt.dsl.
> In the QEMU build_dsdt, not found build osc method in i440fx.
> Putting aside this pxb scenario, I suspect that after disable acpi-pci-hotplug-with-bridge-support,
> hot-plug into the PCI bridge via SHPC can be successful in i440fx ?

After adding oshp method in build_dsdt, the SHPC driver load sucess and hotplug device sucess. Maybe we need a patch
fix it ?




    

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Failed to hot-plug device to pxb bridge
  2024-06-24  3:08     ` Gao,Shiyuan via
@ 2024-06-24 10:13       ` Michael S. Tsirkin
  0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2024-06-24 10:13 UTC (permalink / raw)
  To: Gao,Shiyuan
  Cc: imammedo@redhat.com, qemu-devel@nongnu.org, berrange@redhat.com

On Mon, Jun 24, 2024 at 03:08:55AM +0000, Gao,Shiyuan wrote:
> > I checked the guest dmesg and found that failed load shpc driver.
> >   [    0.966668] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
> >   [    0.968238] shpchp 0000:00:05.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> >   [    0.969160] shpchp 0000:00:05.0: Cannot get control of SHPC hotplug
> >   [    0.969876] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S30_)
> >   [    0.971454] shpchp 0000:00:06.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> >   [    0.972376] shpchp 0000:00:06.0: Cannot get control of SHPC hotplug
> >   [    0.973119] shpchp 0000:80:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
> >   [    0.974674] shpchp 0000:80:00.0: Cannot get control of SHPC hotplug
> >   [    0.979422] shpchp 0000:81:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC80)
> >   [    0.980948] shpchp 0000:81:01.0: Cannot get control of SHPC hotplug
> >   [    0.981685] shpchp 0000:60:00.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
> >   [    0.994623] shpchp 0000:60:00.0: Cannot get control of SHPC hotplug
> >   [    0.995349] shpchp 0000:61:01.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PC60)
> >   [    0.996891] shpchp 0000:61:01.0: Cannot get control of SHPC hotplug
> >   [    0.997626] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
> > Read the shpc driver code, I found that before shpc_init it need check the shpc capability of bridge(shpc_capable) and
> > get hotplug control from firmware(acpi_get_hp_hw_control_from_firmware) in shpc_probe.
> > Howerver it return fail in acpi_get_hp_hw_control_from_firmware. I dump the acpid table, not found OSC and OSHP
> > method in dsdt.dsl.
> > In the QEMU build_dsdt, not found build osc method in i440fx.
> > Putting aside this pxb scenario, I suspect that after disable acpi-pci-hotplug-with-bridge-support,
> > hot-plug into the PCI bridge via SHPC can be successful in i440fx ?
> 
> After adding oshp method in build_dsdt, the SHPC driver load sucess and hotplug device sucess. Maybe we need a patch
> fix it ?
> 
> 
> 
> 

Sorry, can't really say what you are proposing.
Send a patch?





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-24 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  8:29 Failed to hot-plug device to pxb bridge Gao,Shiyuan via
     [not found] ` <20240530160919.01a3effc@imammedo.users.ipa.redhat.com>
2024-06-21  2:50   ` Gao,Shiyuan via
2024-06-24  3:08     ` Gao,Shiyuan via
2024-06-24 10:13       ` Michael S. Tsirkin

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