Bug 1750200 - [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)
Summary: [RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.1
Hardware: ppc64le
OS: Linux
high
high
Target Milestone: rc
: 8.1
Assignee: David Gibson
QA Contact: Minjia Cai
URL:
Whiteboard:
Depends On:
Blocks: 1624641
TreeView+ depends on / blocked
 
Reported: 2019-09-09 02:46 UTC by Minjia Cai
Modified: 2019-11-06 07:19 UTC (History)
12 users (show)

Fixed In Version: qemu-kvm-4.1.0-9.module+el8.1.0+4210+23b2046a
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-06 07:19:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 181401 0 None None None 2019-09-10 09:56:37 UTC
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:19:50 UTC

Description Minjia Cai 2019-09-09 02:46:23 UTC
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

Comment 3 David Gibson 2019-09-10 05:56:23 UTC
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"

Comment 4 David Gibson 2019-09-10 06:07:05 UTC
I'm building a draft fix at:

https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23431036

Comment 9 Minjia Cai 2019-09-11 02:39:21 UTC
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

Comment 11 errata-xmlrpc 2019-11-06 07:19:21 UTC
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


Note You need to log in before you can comment on or make changes to this bug.