summary refs log tree commit diff stats
path: root/hw/timer/xilinx_timer.c
diff options
context:
space:
mode:
authorSergio Lopez <slp@redhat.com>2019-09-16 13:24:12 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2019-10-08 14:28:25 +0100
commit9b92fbcf45ed6ed1daceba8480b0d9e8a327b5ce (patch)
treeb1789ad658e461960ad9b8774985a759e236a935 /hw/timer/xilinx_timer.c
parentd38d6de2a1fe209c849e8392f99e214d0a2db319 (diff)
downloadfocaccia-qemu-9b92fbcf45ed6ed1daceba8480b0d9e8a327b5ce.tar.gz
focaccia-qemu-9b92fbcf45ed6ed1daceba8480b0d9e8a327b5ce.zip
virtio-blk: schedule virtio_notify_config to run on main context
virtio_notify_config() needs to acquire the global mutex, which isn't
allowed from an iothread, and may lead to a deadlock like this:

 - main thead
  * Has acquired: qemu_global_mutex.
  * Is trying the acquire: iothread AioContext lock via
    AIO_WAIT_WHILE (after aio_poll).

 - iothread
  * Has acquired: AioContext lock.
  * Is trying to acquire: qemu_global_mutex (via
    virtio_notify_config->prepare_mmio_access).

If virtio_blk_resize() is called from an iothread, schedule
virtio_notify_config() to be run in the main context BH.

[Removed unnecessary newline as suggested by Kevin Wolf
<kwolf@redhat.com>.
--Stefan]

Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20190916112411.21636-1-slp@redhat.com
Message-Id: <20190916112411.21636-1-slp@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/timer/xilinx_timer.c')
0 files changed, 0 insertions, 0 deletions