Skip to content

Failed to acpi hotplug on pcie root ports in case of q35+ovmf+machine type 6.1

Host environment

  • QEMU flavor: qemu-system-x86_64
  • QEMU version: v6.1.0-1861-gaf531756
  • OVMF version: 202108

Description of problem

Hotplug on multifunction bridges use ACPI hotplug instead of Native since machine type 6.1 In this case, Hotplug works well on q35 with bios fireware, But doesn't work on q35 with ovmf firmware. E.g: /usr/bin/qemu-system-x86_64
-machine pc-q35-6.1,accel=kvm,pflash0=......
-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1
-device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1
-device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2
......

(qemu) netdev_add bridge,br=br0,id=hostnet1 (qemu) device_add virtio-net-pci,netdev=hostnet1,id=net1,bus=pci.3

Error message in guest kernel: kernel: pci 0000:03:00.0: [1af4:1041] type 00 class 0x020000 kernel: pci 0000:03:00.0: reg 0x14: [mem 0x00000000-0x00000fff] kernel: pci 0000:03:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref] kernel: pci 0000:03:00.0: reg 0x30: [mem 0x00000000-0x0003ffff pref] kernel: pci 0000:03:00.0: BAR 6: no space for [mem size 0x00040000 pref] kernel: pci 0000:03:00.0: BAR 6: failed to assign [mem size 0x00040000 pref] kernel: pci 0000:03:00.0: BAR 4: no space for [mem size 0x00004000 64bit pref] kernel: pci 0000:03:00.0: BAR 4: failed to assign [mem size 0x00004000 64bit pref] kernel: pci 0000:03:00.0: BAR 1: no space for [mem size 0x00001000] kernel: pci 0000:03:00.0: BAR 1: failed to assign [mem size 0x00001000] kernel: virtio-pci 0000:03:00.0: virtio_pci: leaving for legacy driver

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information