RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 918035 - core dump when setting 'intrs' (option of usb controller xhci) value is not power of 2, qemu should give friendly tip
Summary: core dump when setting 'intrs' (option of usb controller xhci) value is not ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-05 11:13 UTC by FuXiangChun
Modified: 2014-06-18 03:23 UTC (History)
8 users (show)

Fixed In Version: qemu-kvm-1.5.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:54:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description FuXiangChun 2013-03-05 11:13:15 UTC
Description of problem:
Boot xhci controller with intrs option, qemu will core dump when setting intrs=3,5,6,7,9,10,11....(now power of 2)
e.g: -device nec-usb-xhci,intrs=12

I go through source code,it seem work as design. If so, just hope qemu give a friendly tip, rather than core dump.  

key code(hw/msi.c):
assert(!(nr_vectors & (nr_vectors - 1)));   /* power of 2 */

Notes: since xhci is new usb controller in rhel7. and the upper tool libvirt maybe still cann't support it. so I am not sure this issue is a bug.

Version-Release number of selected component (if applicable):
# uname -r
3.8.0-0.37.el7.x86_64
#rpm -qa|grep qemu
qemu-kvm-1.3.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot guest with -device nec-usb-xhci,intrs=12
2.
3.
  
Actual results:
(gdb) bt
#0  0x00007ffff2afaba5 in raise () from /lib64/libc.so.6
#1  0x00007ffff2afc358 in abort () from /lib64/libc.so.6
#2  0x00007ffff2af3972 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff2af3a22 in __assert_fail () from /lib64/libc.so.6
#4  0x00005555556955eb in msi_init (dev=dev@entry=0x7fffe4eed010, offset=offset@entry=112 'p', nr_vectors=12, msi64bit=msi64bit@entry=true, 
    msi_per_vector_mask=msi_per_vector_mask@entry=false) at hw/msi.c:174
#5  0x00005555556db66b in usb_xhci_initfn (dev=0x7fffe4eed010) at hw/usb/hcd-xhci.c:3129
#6  0x000055555569c02a in pci_qdev_init (qdev=0x7fffe4eed010) at hw/pci.c:1631
#7  0x00005555556aed1f in qdev_init (dev=dev@entry=0x7fffe4eed010) at hw/qdev.c:155
#8  0x00005555556a9d29 in qdev_device_add (opts=0x5555564e4010) at hw/qdev-monitor.c:481
#9  0x000055555576de39 in device_init_func (opts=<optimized out>, opaque=<optimized out>) at vl.c:2052
#10 0x000055555572ae63 in qemu_opts_foreach (list=<optimized out>, func=func@entry=0x55555576de20 <device_init_func>, opaque=opaque@entry=0x0, 
    abort_on_failure=abort_on_failure@entry=1) at qemu-option.c:1106
#11 0x00005555555d21e9 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:3885

Expected results:
qemu can give a friendly error message

Additional info:

Comment 1 FuXiangChun 2013-03-05 11:22:01 UTC
Maybe upstream management prevent setting this option, but from qemu point of view, It shouldn't core dump, so I set this bug as low low

Comment 3 Gerd Hoffmann 2013-03-20 15:01:00 UTC
fix planned for qemu 1.5.

Comment 4 Gerd Hoffmann 2013-05-14 15:21:39 UTC
upstream commit c94a7c6979cafa7a71f32b35e0ff71ed00c61a89

Comment 5 Miroslav Rezanina 2013-05-23 12:02:18 UTC
Build in qemu-kvm-1.5.0-1.el7

Comment 6 Sibiao Luo 2013-07-08 07:14:47 UTC
Reproduce this issue on qemu-kvm-1.4.0-4.el7.x86_64.
host info:
3.10.0-0.rc7.64.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
guest info:
3.10.0-0.rc7.64.el7.x86_64

step:
e.g:# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm...-device nec-usb-xhci,id=xhci,bus=pci.0,addr=0x8,intrs=12
qemu-kvm: hw/pci/msi.c:174: msi_init: Assertion `!(nr_vectors & (nr_vectors - 1))' failed.
Aborted (core dumped)
(gdb) bt
#0  0x00007f8d4ba05a19 in raise () from /lib64/libc.so.6
#1  0x00007f8d4ba07128 in abort () from /lib64/libc.so.6
#2  0x00007f8d4b9fe986 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007f8d4b9fea32 in __assert_fail () from /lib64/libc.so.6
#4  0x00007f8d4ffd2656 in msi_init (dev=dev@entry=0x7f8d4052d010, offset=offset@entry=112 'p', nr_vectors=12, 
    msi64bit=msi64bit@entry=true, msi_per_vector_mask=msi_per_vector_mask@entry=false) at hw/pci/msi.c:174
#5  0x00007f8d500097bb in usb_xhci_initfn (dev=0x7f8d4052d010) at hw/usb/hcd-xhci.c:3160
#6  0x00007f8d4ffd67e4 in pci_qdev_init (qdev=0x7f8d4052d010) at hw/pci/pci.c:1640
#7  0x00007f8d4ffe4b6e in device_realize (dev=0x7f8d4052d010, err=0x7fffb698f0e0) at hw/qdev.c:175
#8  0x00007f8d4ffe6147 in device_set_realized (obj=0x7f8d4052d010, value=<optimized out>, err=0x7fffb698f1e0)
    at hw/qdev.c:673
#9  0x00007f8d5005143e in property_set_bool (obj=0x7f8d4052d010, v=<optimized out>, opaque=0x7f8d52c050b0, 
    name=<optimized out>, errp=0x7fffb698f1e0) at qom/object.c:1222
#10 0x00007f8d50053b27 in object_property_set_qobject (obj=0x7f8d4052d010, value=<optimized out>, 
    name=0x7f8d501ce300 "realized", errp=0x7fffb698f1e0) at qom/qom-qobject.c:24
#11 0x00007f8d50052ac0 in object_property_set_bool (obj=obj@entry=0x7f8d4052d010, value=value@entry=true, 
    name=name@entry=0x7f8d501ce300 "realized", errp=errp@entry=0x7fffb698f1e0) at qom/object.c:765
#12 0x00007f8d4ffe520a in qdev_init (dev=dev@entry=0x7f8d4052d010) at hw/qdev.c:161
#13 0x00007f8d4ffe10c5 in qdev_device_add (opts=0x7f8d529291f0) at hw/qdev-monitor.c:494
#14 0x00007f8d500834a9 in device_init_func (opts=<optimized out>, opaque=<optimized out>) at vl.c:2283
#15 0x00007f8d501b340b in qemu_opts_foreach (list=<optimized out>, func=func@entry=0x7f8d50083490 <device_init_func>, 
    opaque=opaque@entry=0x0, abort_on_failure=abort_on_failure@entry=1) at util/qemu-option.c:1128
#16 0x00007f8d4ff318e5 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4214
(gdb) q

Verify this issue on qemu-kvm-1.5.1-2.el7.x86_64, it can boot up successfully without any qemu core dump setting intrs=3,5,6,7,9,10,11,12....
host info:
3.10.0-0.rc7.64.el7.x86_64
qemu-kvm-1.5.1-2.el7.x86_64
guest info:
3.10.0-0.rc7.64.el7.x86_64
e.g:# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm...-device nec-usb-xhci,id=xhci,bus=pci.0,addr=0x8,intrs=12

Base on above, this issue has been fixed correctly. Set it to verified status, please correct me if any mistake.

Best Regards,
sluo

Comment 7 Ludek Smid 2014-06-13 09:54:12 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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