qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Managem


From: Klaus Jensen
Subject: Re: [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Management command
Date: Tue, 1 Mar 2022 14:07:08 +0100

On Feb 17 18:45, Lukasz Maniak wrote:
> From: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
> 
> With the new command one can:
>  - assign flexible resources (queues, interrupts) to primary and
>    secondary controllers,
>  - toggle the online/offline state of given controller.
> 

QEMU segfaults (or asserts depending on the wind blowing) if the SR-IOV
enabled device is hotplugged after being configured (i.e. follow the
docs for a simple setup and then do a `device_del <nvme-device>` in the
monitor. I suspect this is related to freeing the queues and something
getting double-freed.

The device can be removed just fine if SR-IOV is configured (as in,
parameters are set), but no resources are reserved, onlined etc.


Snip from the backtrace (assert):

qemu-system-x86_64: ../util/qemu-thread-posix.c:78: qemu_mutex_lock_impl: 
Assertion `mutex->initialized' failed.

Thread 4 "qemu-system-x86" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fcb8ffff640 (LWP 174907)]
0x00007fcb9a85534c in __pthread_kill_implementation () from /usr/lib64/libc.so.6
(gdb) bt
#0  0x00007fcb9a85534c in __pthread_kill_implementation () at 
/usr/lib64/libc.so.6
#1  0x00007fcb9a8084b8 in raise () at /usr/lib64/libc.so.6
#2  0x00007fcb9a7f2534 in abort () at /usr/lib64/libc.so.6
#3  0x00007fcb9a7f245c in _nl_load_domain.cold () at /usr/lib64/libc.so.6
#4  0x00007fcb9a801116 in  () at /usr/lib64/libc.so.6
#5  0x0000556c1fffc342 in qemu_mutex_lock_impl (mutex=<optimized out>, 
file=<optimized out>, line=<optimized out>) at ../util/qemu-thread-posix.c:78
#6  qemu_mutex_lock_impl (mutex=<optimized out>, file=<optimized out>, 
line=<optimized out>) at ../util/qemu-thread-posix.c:74
#7  0x0000556c2001af05 in timer_del (ts=ts@entry=0x7fc9780000a0) at 
../util/qemu-timer.c:432
#8  0x0000556c1fc28657 in timer_free (ts=0x7fc9780000a0) at 
/home/kbj/work/src/qemu/include/qemu/timer.h:633
#9  timer_free (ts=0x7fc9780000a0) at 
/home/kbj/work/src/qemu/include/qemu/timer.h:630
#10 nvme_free_sq (sq=0x7fc978000090, n=<optimized out>, n=<optimized out>) at 
../hw/nvme/ctrl.c:4129
#11 0x0000556c1fc2a369 in nvme_ctrl_reset (n=0x7fc978436e70, 
rst=NVME_RESET_FUNCTION) at ../hw/nvme/ctrl.c:6007
#12 0x0000556c1fc2a84c in nvme_virt_set_state (n=n@entry=0x556c22d486b0, 
cntlid=<optimized out>, online=online@entry=0x0) at ../hw/nvme/ctrl.c:5815
#13 0x0000556c1fc2a5c6 in nvme_ctrl_reset (n=0x556c22d486b0, 
rst=NVME_RESET_FUNCTION) at ../hw/nvme/ctrl.c:6026
#14 0x0000556c1fc2a9e3 in nvme_exit (pci_dev=0x556c22d486b0) at 
../hw/nvme/ctrl.c:7265
#15 0x0000556c1fc450e3 in pci_qdev_unrealize (dev=<optimized out>) at 
../hw/pci/pci.c:1200
... more here


Snip from the backtrace (segfault)

Thread 7 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f6c635fe640 (LWP 175552)]
0x0000555e275ab63a in nvme_free_sq (sq=0xfea03000, n=<optimized out>, 
n=<optimized out>) at ../hw/nvme/ctrl.c:4128
4128        n->sq[sq->sqid] = NULL;
(gdb) bt
#0  0x0000555e275ab63a in nvme_free_sq (sq=0xfea03000, n=<optimized out>, 
n=<optimized out>) at ../hw/nvme/ctrl.c:4128
#1  0x0000555e275ad369 in nvme_ctrl_reset (n=0x7f6e683793e0, 
rst=NVME_RESET_FUNCTION) at ../hw/nvme/ctrl.c:6007
#2  0x0000555e275ad84c in nvme_virt_set_state (n=n@entry=0x555e2a2626b0, 
cntlid=<optimized out>, online=online@entry=0x0) at ../hw/nvme/ctrl.c:5815
#3  0x0000555e275ad5c6 in nvme_ctrl_reset (n=0x555e2a2626b0, 
rst=NVME_RESET_FUNCTION) at ../hw/nvme/ctrl.c:6026
#4  0x0000555e275ad9e3 in nvme_exit (pci_dev=0x555e2a2626b0) at 
../hw/nvme/ctrl.c:7265
#5  0x0000555e275c80e3 in pci_qdev_unrealize (dev=<optimized out>) at 
../hw/pci/pci.c:1200
... more here

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]