[Top][All Lists]

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

[Qemu-commits] [qemu/qemu] 9c5aad: virtio-scsi: fixed virtio_scsi_ctx_ch

From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 9c5aad: virtio-scsi: fixed virtio_scsi_ctx_check failed wh...
Date: Thu, 25 Jul 2019 04:08:42 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9c5aad84da1c37429d06c193f23a8df6445ed29e
  Author: Zhengui li <address@hidden>
  Date:   2019-07-24 (Wed, 24 Jul 2019)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  virtio-scsi: fixed virtio_scsi_ctx_check failed when detaching scsi disk

commit a6f230c move blockbackend back to main AioContext on unplug. It set the 
AioContext of
SCSIDevice to the main AioContex, but s->ctx is still the iothread 
AioContex(if the scsi controller
is configure with iothread). So if there are having in-flight requests during 
unplug, a failing assertion
happend. The bt is below:
(gdb) bt
#0  0x0000ffff86aacbd0 in raise () from /lib64/libc.so.6
#1  0x0000ffff86aadf7c in abort () from /lib64/libc.so.6
#2  0x0000ffff86aa6124 in __assert_fail_base () from /lib64/libc.so.6
#3  0x0000ffff86aa61a4 in __assert_fail () from /lib64/libc.so.6
#4  0x0000000000529118 in virtio_scsi_ctx_check (d=<optimized out>, 
s=<optimized out>, s=<optimized out>) at 
#5  0x0000000000529ec4 in virtio_scsi_handle_cmd_req_prepare (s=0x2779ec00, 
req=0xffff740397d0) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:559
#6  0x000000000052a228 in virtio_scsi_handle_cmd_vq (s=0x2779ec00, 
vq=0xffff7c6d7110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:603
#7  0x000000000052afa8 in virtio_scsi_data_plane_handle_cmd (vdev=<optimized 
out>, vq=0xffff7c6d7110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi-dataplane.c:59
#8  0x000000000054d94c in virtio_queue_host_notifier_aio_poll 
(opaque=<optimized out>) at /home/qemu-4.0.0/hw/virtio/virtio.c:2452

assert(blk_get_aio_context(d->conf.blk) == s->ctx) failed.

To avoid assertion failed,  moving the "if" after qdev_simple_device_unplug_cb.

In addition, to avoid another qemu crash below, add aio_disable_external before
qdev_simple_device_unplug_cb, which disable the further processing of external 
when doing qdev_simple_device_unplug_cb.
(gdb) bt
#0  scsi_req_unref (req=0xffff6802c6f0) at hw/scsi/scsi-bus.c:1283
#1  0x00000000005294a4 in virtio_scsi_handle_cmd_req_submit (req=<optimized 
    s=<optimized out>) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:589
#2  0x000000000052a2a8 in virtio_scsi_handle_cmd_vq (s=s@entry=0x9c90e90,
    vq=vq@entry=0xffff7c05f110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi.c:625
#3  0x000000000052afd8 in virtio_scsi_data_plane_handle_cmd (vdev=<optimized 
    vq=0xffff7c05f110) at /home/qemu-4.0.0/hw/scsi/virtio-scsi-dataplane.c:60
#4  0x000000000054d97c in virtio_queue_host_notifier_aio_poll 
(opaque=<optimized out>)
    at /home/qemu-4.0.0/hw/virtio/virtio.c:2447
#5  0x00000000009b204c in run_poll_handlers_once (ctx=ctx@entry=0x6efea40,
    timeout=timeout@entry=0xffff7d7f7308) at util/aio-posix.c:521
#6  0x00000000009b2b64 in run_poll_handlers (ctx=ctx@entry=0x6efea40,
    max_ns=max_ns@entry=4000, timeout=timeout@entry=0xffff7d7f7308) at 
#7  0x00000000009b2ca0 in try_poll_mode (ctx=ctx@entry=0x6efea40, 
    timeout@entry=0xffff7d7f7348) at util/aio-posix.c:594
#8  0x00000000009b31b8 in aio_poll (ctx=0x6efea40, blocking=blocking@entry=true)
    at util/aio-posix.c:636
#9  0x00000000006973cc in iothread_run (opaque=0x6ebd800) at iothread.c:75
#10 0x00000000009b592c in qemu_thread_start (args=0x6efef60) at 
#11 0x0000ffff8057f8bc in start_thread () from /lib64/libpthread.so.0
#12 0x0000ffff804e5f8c in thread_start () from /lib64/libc.so.6
(gdb) p bus
$1 = (SCSIBus *) 0x0

Signed-off-by: Zhengui li <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>

  Commit: bec7156a45aa6712395a770646f7078b1fc82acd
  Author: Jan Kiszka <address@hidden>
  Date:   2019-07-24 (Wed, 24 Jul 2019)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  i386/kvm: Do not sync nested state during runtime

Writing the nested state e.g. after a vmport access can invalidate
important parts of the kernel-internal state, and it is not needed as
well. So leave this out from KVM_PUT_RUNTIME_STATE.

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>

  Commit: 6baabe5cf8d42ce6bc542fb3ec0bfc10c0ee6c5e
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-07-24 (Wed, 24 Jul 2019)

  Changed paths:
    M docs/devel/kconfig.rst

  Log Message:
  docs: correct kconfig option

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>

  Commit: 7ea53245335b4f60b56a3323232baa39d9bb1ebb
  Author: Peter Maydell <address@hidden>
  Date:   2019-07-25 (Thu, 25 Jul 2019)

  Changed paths:
    M docs/devel/kconfig.rst
    M hw/scsi/virtio-scsi.c
    M target/i386/kvm.c

  Log Message:
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

Two more bugfix patches + 1 doc fix.

# gpg: Signature made Wed 24 Jul 2019 10:22:06 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Paolo Bonzini <address@hidden>" [full]
# gpg:                 aka "Paolo Bonzini <address@hidden>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  docs: correct kconfig option
  i386/kvm: Do not sync nested state during runtime
  virtio-scsi: fixed virtio_scsi_ctx_check failed when detaching scsi disk

Signed-off-by: Peter Maydell <address@hidden>

Compare: https://github.com/qemu/qemu/compare/bf8b024372bf...7ea53245335b

reply via email to

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