From: Klaus Jensen <its@irrelevant.dk>
To: Lukasz Maniak <lukasz.maniak@linux.intel.com>
Cc: "Fam Zheng" <fam@euphon.net>, "Kevin Wolf" <kwolf@redhat.com>,
qemu-block@nongnu.org,
"Łukasz Gieryk" <lukasz.gieryk@linux.intel.com>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Hanna Reitz" <hreitz@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Keith Busch" <kbusch@kernel.org>
Subject: Re: [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Management command
Date: Tue, 1 Mar 2022 14:07:08 +0100 [thread overview]
Message-ID: <Yh4afDUJ9Yc0a74Z@apples> (raw)
In-Reply-To: <20220217174504.1051716-14-lukasz.maniak@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 3696 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-03-01 13:12 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 17:44 [PATCH v5 00/15] hw/nvme: SR-IOV with Virtualization Enhancements Lukasz Maniak
2022-02-17 17:44 ` [PATCH v5 01/15] pcie: Add support for Single Root I/O Virtualization (SR/IOV) Lukasz Maniak
2022-02-18 8:24 ` Michael S. Tsirkin
2022-02-17 17:44 ` [PATCH v5 02/15] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt Lukasz Maniak
2022-02-18 8:24 ` Michael S. Tsirkin
2022-02-17 17:44 ` [PATCH v5 03/15] pcie: Add a helper to the SR/IOV API Lukasz Maniak
2022-02-18 8:25 ` Michael S. Tsirkin
2022-02-17 17:44 ` [PATCH v5 04/15] pcie: Add 1.2 version token for the Power Management Capability Lukasz Maniak
2022-02-18 8:25 ` Michael S. Tsirkin
2022-02-17 17:44 ` [PATCH v5 05/15] hw/nvme: Add support for SR-IOV Lukasz Maniak
2022-02-18 7:06 ` Klaus Jensen
2022-02-17 17:44 ` [PATCH v5 06/15] hw/nvme: Add support for Primary Controller Capabilities Lukasz Maniak
2022-02-17 17:44 ` [PATCH v5 07/15] hw/nvme: Add support for Secondary Controller List Lukasz Maniak
2022-02-17 17:44 ` [PATCH v5 08/15] hw/nvme: Implement the Function Level Reset Lukasz Maniak
2022-02-17 17:44 ` [PATCH v5 09/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime Lukasz Maniak
2022-03-01 12:22 ` Klaus Jensen
2022-02-17 17:44 ` [PATCH v5 10/15] hw/nvme: Remove reg_size variable and update BAR0 size calculation Lukasz Maniak
2022-02-17 17:45 ` [PATCH v5 11/15] hw/nvme: Calculate BAR attributes in a function Lukasz Maniak
2022-02-17 17:45 ` [PATCH v5 12/15] hw/nvme: Initialize capability structures for primary/secondary controllers Lukasz Maniak
2022-02-18 14:37 ` Lukasz Maniak
2022-02-17 17:45 ` [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Management command Lukasz Maniak
2022-03-01 13:07 ` Klaus Jensen [this message]
2022-03-09 12:41 ` Łukasz Gieryk
2022-03-11 12:20 ` Lukasz Maniak
2022-02-17 17:45 ` [PATCH v5 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements Lukasz Maniak
2022-03-01 12:23 ` Klaus Jensen
2022-03-21 12:36 ` Lukasz Maniak
2022-03-22 6:15 ` Klaus Jensen
2022-02-17 17:45 ` [PATCH v5 15/15] hw/nvme: Update the initalization place for the AER queue Lukasz Maniak
2022-02-18 6:49 ` Klaus Jensen
2022-02-18 8:23 ` [PATCH v5 00/15] hw/nvme: SR-IOV with Virtualization Enhancements Michael S. Tsirkin
2022-02-18 14:33 ` Lukasz Maniak
2022-02-18 8:26 ` Michael S. Tsirkin
2022-02-18 8:51 ` Klaus Jensen
2022-02-18 9:33 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yh4afDUJ9Yc0a74Z@apples \
--to=its@irrelevant.dk \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=lukasz.gieryk@linux.intel.com \
--cc=lukasz.maniak@linux.intel.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).