Description of problem: [RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free) Version-Release number of selected component (if applicable): qemu-kvm-4.1.0-5.module+el8.1.0+4076+b5e41ebc.ppc64le 4.18.0-137.el8.ppc64le How reproducible: 5/5 Steps to Reproduce: 1.[root@ibm-p9wr-21 ~]# lspci |grep Inf 0003:01:00.0 Infiniband controller: Mellanox Technologies MT27800 Family [ConnectX-5] 0033:01:00.0 Infiniband controller: Mellanox Technologies MT27800 Family [ConnectX-5] [root@ibm-p9wr-21 ~]# modprobe vfio-pci [root@ibm-p9wr-21 ~]# lspci -n -s 0003:01:00.0 | awk '{ print $3 }' 15b3:1017 [root@ibm-p9wr-21 ~]# echo 7 > /sys/bus/pci/devices/0003\:01\:00.0/sriov_numvfs [root@ibm-p9wr-21 ~]# lspci -n -s 0003:01:00.1 | awk '{ print $3 }' 15b3:1018 [root@ibm-p9wr-21 ~]# echo 0003:01:00.2 > /sys/bus/pci/devices/0003\:01\:00.2/driver/unbind [root@ibm-p9wr-21 ~]# echo "15b3 1018" > /sys/bus/pci/drivers/vfio-pci/new_id [root@ibm-p9wr-21 ~]# echo "15b3 1018" > /sys/bus/pci/drivers/vfio-pci/remove_id [root@ibm-p9wr-21 ~]# echo 0003:01:00.3 > /sys/bus/pci/devices/0003\:01\:00.3/driver/unbind [root@ibm-p9wr-21 ~]# echo "15b3 1018" > /sys/bus/pci/drivers/vfio-pci/new_id [root@ibm-p9wr-21 ~]# echo "15b3 1018" > /sys/bus/pci/drivers/vfio-pci/remove_id 2.boot up the guest with vf like this: /usr/libexec/qemu-kvm \ -name 'avocado-vt-vm1' \ -sandbox off \ -machine pseries \ -device VGA \ -serial unix:/tmp/S0,server,nowait \ -device nec-usb-xhci,id=usb1,bus=pci.0,addr=0x3 \ -drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=/home/micai/rhel810-ppc64le-virtio-scsi.qcow2 \ -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \ -device scsi-hd,drive=drive_image1,bus=virtio_scsi_pci0.0,id=hd1,bootindex=1 \ -m 4096 \ -smp 8 \ -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \ -netdev tap,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0 \ -vnc :14 \ -rtc base=utc,clock=host \ -boot order=cdn,once=d,menu=off,strict=off \ -monitor stdio \ -device usb-kbd \ -device usb-mouse \ -device vfio-pci,host=0003:01:00.3,id=pf \ -enable-kvm 3. QEMU 4.1.0 monitor - type 'help' for more information (qemu) sys system_powerdown system_reset system_wakeup (qemu) system_reset (qemu) qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free Actual results: [RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free) Expected results: the first system_reset guest,no error print. Additional info: qemu12 and qemu4.0 did not hit this
Thanks for lending me the machine Minjia. A bisect fairly quickly found an upstream fix that makes perfect sense, but which I'd forgotten about: ea52074d3a1c "spapr/pci: Free MSIs during reset"
I'm building a draft fix at: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23431036
According to comment0 ,I have test it many times but did not encounter this problem, So change the robust state of the bug to verify host: [root@ibm-p9wr-22 micai]# rpm -qa|grep qemu qemu-kvm-4.1.0-9.module+el8.1.0+4210+23b2046a.ppc64le [root@ibm-p9wr-22 ~]# uname -r 4.18.0-141.el8.ppc64le guest: Red Hat Enterprise Linux 8.1 Beta (Ootpa) Kernel 4.18.0-141.el8.ppc64le on an ppc64le
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:3723