summary refs log tree commit diff stats
path: root/hw/arm/stm32f405_soc.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2019-12-18 11:30:12 +0000
committerGerd Hoffmann <kraxel@redhat.com>2020-01-13 14:05:46 +0100
commit394642a8d3742c885e397d5bb5ee0ec40743cdc6 (patch)
treeec6b5ea99341cffe2fc1fdd72cb9cacbd36dab94 /hw/arm/stm32f405_soc.c
parent32187f3d902afdfa9f4d861d9612739d3391fdc3 (diff)
downloadfocaccia-qemu-394642a8d3742c885e397d5bb5ee0ec40743cdc6.tar.gz
focaccia-qemu-394642a8d3742c885e397d5bb5ee0ec40743cdc6.zip
usbredir: Prevent recursion in usbredir_write
I've got a case where usbredir_write manages to call back into itself
via spice; this patch causes the recursion to fail (0 bytes) the write;
this seems to avoid the deadlock I was previously seeing.

I can't say I fully understand the interaction of usbredir and spice;
but there are a few similar guards in spice and usbredir
to catch other cases especially onces also related to spice_server_char_device_wakeup

This case seems to be triggered by repeated migration+repeated
reconnection of the viewer; but my debugging suggests the migration
finished before this hits.

The backtrace of the hang looks like:
  reds_handle_ticket
  reds_handle_other_links
  reds_channel_do_link
  red_channel_connect
  spicevmc_connect
  usbredir_create_parser
  usbredirparser_do_write
  usbredir_write
  qemu_chr_fe_write
  qemu_chr_write
  qemu_chr_write_buffer
  spice_chr_write
  spice_server_char_device_wakeup
  red_char_device_wakeup
  red_char_device_write_to_device
  vmc_write
  usbredirparser_do_write
  usbredir_write
  qemu_chr_fe_write
  qemu_chr_write
  qemu_chr_write_buffer
  qemu_mutex_lock_impl

and we fail as we lang through qemu_chr_write_buffer's lock
twice.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1752320

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20191218113012.13331-1-dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/arm/stm32f405_soc.c')
0 files changed, 0 insertions, 0 deletions