qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] booting uefi guests from virtio-scsi is broken
@ 2018-01-12 12:34 Gerd Hoffmann
  2018-01-12 12:58 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2018-01-12 12:34 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini, László Érsek

  Hi,

$subject says all.  bisect blames:

commit f68d98b21fa74155dc7c1fd212474379ac3c7531
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Mon Nov 27 13:27:41 2017 +0100

    scsi: provide general-purpose functions to manage sense data
    
    Extract the common parts of scsi_sense_buf_to_errno, scsi_convert_sense
    and scsi_target_send_command's REQUEST SENSE handling into two new
    functions scsi_parse_sense_buf and scsi_build_sense_buf.
    
    Fix a bug in scsi_target_send_command along the way; the length was
    written in buf[10] rather than buf[7].
    
    Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Fixes: b07fbce634 ("scsi-bus: correct responses for INQUIRY and REQUEST SENSE")
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

gdb:

Program received signal SIGSEGV, Segmentation fault.
x000055b2a3ba9e32 in scsi_convert_sense (in_buf=0x0, in_len=0, buf=0x55b2a63fa000 "", len=4096, 
    fixed=true) at /home/kraxel/projects/qemu/scsi/utils.c:325
325         fixed_in = (in_buf[0] & 2) == 0;

(gdb) bt
#0  0x000055b2a3ba9e32 in scsi_convert_sense (in_buf=0x0, in_len=0, buf=0x55b2a63fa000 "", len=4096, fixed=true) at /home/kraxel/projects/qemu/scsi/utils.c:325
#1  0x000055b2a39e5350 in scsi_disk_emulate_command (req=0x55b2a66c45e0, buf=0x55b2a66c4618 "\003")
    at /home/kraxel/projects/qemu/hw/scsi/scsi-disk.c:2007
#2  0x000055b2a39ec5d0 in scsi_req_enqueue (req=0x55b2a66c45e0)
    at /home/kraxel/projects/qemu/hw/scsi/scsi-bus.c:832
#3  0x000055b2a377a0f6 in virtio_scsi_handle_cmd_req_submit (s=0x55b2a6c78fb0, req=0x55b2a67c1c00)
    at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi.c:579
#4  0x000055b2a377a337 in virtio_scsi_handle_cmd_vq (s=0x55b2a6c78fb0, vq=0x7f0f36c7a110)
    at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi.c:619
#5  0x000055b2a377b686 in virtio_scsi_data_plane_handle_cmd (vdev=0x55b2a6c78fb0, vq=0x7f0f36c7a110) at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi-dataplane.c:60
#6  0x000055b2a379cfe8 in virtio_queue_notify_aio_vq (vq=0x7f0f36c7a110)
    at /home/kraxel/projects/qemu/hw/virtio/virtio.c:1515
#7  0x000055b2a379f124 in virtio_queue_host_notifier_aio_read (n=0x7f0f36c7a178)
    at /home/kraxel/projects/qemu/hw/virtio/virtio.c:2388
#8  0x000055b2a3c33f9b in aio_dispatch_handlers (ctx=0x55b2a584fce0)
    at /home/kraxel/projects/qemu/util/aio-posix.c:406
#9  0x000055b2a3c3412e in aio_dispatch (ctx=0x55b2a584fce0)
    at /home/kraxel/projects/qemu/util/aio-posix.c:437
#10 0x000055b2a3c2fc76 in aio_ctx_dispatch (source=0x55b2a584fce0, callback=0x0, user_data=0x0)
    at /home/kraxel/projects/qemu/util/async.c:261
#11 0x00007f0f56ef34c9 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#12 0x000055b2a3c32a86 in glib_pollfds_poll () at /home/kraxel/projects/qemu/util/main-loop.c:214
#13 0x000055b2a3c32b77 in os_host_main_loop_wait (timeout=191617699)
    at /home/kraxel/projects/qemu/util/main-loop.c:261
#14 0x000055b2a3c32c33 in main_loop_wait (nonblocking=0)
    at /home/kraxel/projects/qemu/util/main-loop.c:515
#15 0x000055b2a3860c9c in main_loop () at /home/kraxel/projects/qemu/vl.c:1950
#16 0x000055b2a3868991 in main (argc=92, argv=0x7fff4b2f2e38, envp=0x7fff4b2f3120)
    at /home/kraxel/projects/qemu/vl.c:4780

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] booting uefi guests from virtio-scsi is broken
  2018-01-12 12:34 [Qemu-devel] booting uefi guests from virtio-scsi is broken Gerd Hoffmann
@ 2018-01-12 12:58 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2018-01-12 12:58 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel, László Érsek

On 12/01/2018 13:34, Gerd Hoffmann wrote:
>   Hi,
> 
> $subject says all.  bisect blames:
> 
> commit f68d98b21fa74155dc7c1fd212474379ac3c7531
> Author: Paolo Bonzini <pbonzini@redhat.com>
> Date:   Mon Nov 27 13:27:41 2017 +0100
> 
>     scsi: provide general-purpose functions to manage sense data
>     
>     Extract the common parts of scsi_sense_buf_to_errno, scsi_convert_sense
>     and scsi_target_send_command's REQUEST SENSE handling into two new
>     functions scsi_parse_sense_buf and scsi_build_sense_buf.
>     
>     Fix a bug in scsi_target_send_command along the way; the length was
>     written in buf[10] rather than buf[7].
>     
>     Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>     Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>     Fixes: b07fbce634 ("scsi-bus: correct responses for INQUIRY and REQUEST SENSE")
>     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> gdb:
> 
> Program received signal SIGSEGV, Segmentation fault.
> x000055b2a3ba9e32 in scsi_convert_sense (in_buf=0x0, in_len=0, buf=0x55b2a63fa000 "", len=4096, 
>     fixed=true) at /home/kraxel/projects/qemu/scsi/utils.c:325
> 325         fixed_in = (in_buf[0] & 2) == 0;
> 
> (gdb) bt
> #0  0x000055b2a3ba9e32 in scsi_convert_sense (in_buf=0x0, in_len=0, buf=0x55b2a63fa000 "", len=4096, fixed=true) at /home/kraxel/projects/qemu/scsi/utils.c:325
> #1  0x000055b2a39e5350 in scsi_disk_emulate_command (req=0x55b2a66c45e0, buf=0x55b2a66c4618 "\003")
>     at /home/kraxel/projects/qemu/hw/scsi/scsi-disk.c:2007
> #2  0x000055b2a39ec5d0 in scsi_req_enqueue (req=0x55b2a66c45e0)
>     at /home/kraxel/projects/qemu/hw/scsi/scsi-bus.c:832
> #3  0x000055b2a377a0f6 in virtio_scsi_handle_cmd_req_submit (s=0x55b2a6c78fb0, req=0x55b2a67c1c00)
>     at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi.c:579
> #4  0x000055b2a377a337 in virtio_scsi_handle_cmd_vq (s=0x55b2a6c78fb0, vq=0x7f0f36c7a110)
>     at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi.c:619
> #5  0x000055b2a377b686 in virtio_scsi_data_plane_handle_cmd (vdev=0x55b2a6c78fb0, vq=0x7f0f36c7a110) at /home/kraxel/projects/qemu/hw/scsi/virtio-scsi-dataplane.c:60
> #6  0x000055b2a379cfe8 in virtio_queue_notify_aio_vq (vq=0x7f0f36c7a110)
>     at /home/kraxel/projects/qemu/hw/virtio/virtio.c:1515
> #7  0x000055b2a379f124 in virtio_queue_host_notifier_aio_read (n=0x7f0f36c7a178)
>     at /home/kraxel/projects/qemu/hw/virtio/virtio.c:2388
> #8  0x000055b2a3c33f9b in aio_dispatch_handlers (ctx=0x55b2a584fce0)
>     at /home/kraxel/projects/qemu/util/aio-posix.c:406
> #9  0x000055b2a3c3412e in aio_dispatch (ctx=0x55b2a584fce0)
>     at /home/kraxel/projects/qemu/util/aio-posix.c:437
> #10 0x000055b2a3c2fc76 in aio_ctx_dispatch (source=0x55b2a584fce0, callback=0x0, user_data=0x0)
>     at /home/kraxel/projects/qemu/util/async.c:261
> #11 0x00007f0f56ef34c9 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
> #12 0x000055b2a3c32a86 in glib_pollfds_poll () at /home/kraxel/projects/qemu/util/main-loop.c:214
> #13 0x000055b2a3c32b77 in os_host_main_loop_wait (timeout=191617699)
>     at /home/kraxel/projects/qemu/util/main-loop.c:261
> #14 0x000055b2a3c32c33 in main_loop_wait (nonblocking=0)
>     at /home/kraxel/projects/qemu/util/main-loop.c:515
> #15 0x000055b2a3860c9c in main_loop () at /home/kraxel/projects/qemu/vl.c:1950
> #16 0x000055b2a3868991 in main (argc=92, argv=0x7fff4b2f2e38, envp=0x7fff4b2f3120)
>     at /home/kraxel/projects/qemu/vl.c:4780
> 
> cheers,
>   Gerd
> 

Sent pull request today.  Thanks anyway for the warning!

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-12 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 12:34 [Qemu-devel] booting uefi guests from virtio-scsi is broken Gerd Hoffmann
2018-01-12 12:58 ` Paolo Bonzini

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).