Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-08 Thread Stefan Hajnoczi
On Fri, Aug 05, 2022 at 11:41:27AM +0200, Paolo Bonzini wrote: > On 8/5/22 09:04, Michael S. Tsirkin wrote: > > > > > > Buglink:https://bugzilla.redhat.com/show_bug.cgi?id=2099541 > > > Reported-by: Qing Wang > > > Signed-off-by: Stefan Hajnoczi > > A scsi thing that tree seems more appropriate. >

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-05 Thread Stefan Hajnoczi
On Fri, Aug 5, 2022, 05:59 Paolo Bonzini wrote: > On 8/3/22 18:28, Stefan Hajnoczi wrote: > > diff --git a/hw/scsi/virtio-scsi-dataplane.c > b/hw/scsi/virtio-scsi-dataplane.c > > index 8bb6e6acfc..a575c3f0cd 100644 > > --- a/hw/scsi/virtio-scsi-dataplane.c > > +++ b/hw/scsi/virtio-scsi-dataplane.

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-05 Thread Paolo Bonzini
On 8/5/22 09:04, Michael S. Tsirkin wrote: Buglink:https://bugzilla.redhat.com/show_bug.cgi?id=2099541 Reported-by: Qing Wang Signed-off-by: Stefan Hajnoczi A scsi thing that tree seems more appropriate. Reviewed-by: Michael S. Tsirkin Since the same thing has to be done in virtio-blk, an

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-05 Thread Paolo Bonzini
On 8/3/22 18:28, Stefan Hajnoczi wrote: diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 8bb6e6acfc..a575c3f0cd 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -66,6 +66,21 @@ static int virtio_scsi_set_host_notifier(VirtIO

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-05 Thread Emanuele Giuseppe Esposito
Am 03/08/2022 um 18:28 schrieb Stefan Hajnoczi: > As soon as virtio_scsi_data_plane_start() attaches host notifiers the > IOThread may start virtqueue processing. There is a race between > IOThread virtqueue processing and virtio_scsi_data_plane_start() because > it only assigns s->dataplane_sta

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-05 Thread Michael S. Tsirkin
On Wed, Aug 03, 2022 at 12:28:24PM -0400, Stefan Hajnoczi wrote: > As soon as virtio_scsi_data_plane_start() attaches host notifiers the > IOThread may start virtqueue processing. There is a race between > IOThread virtqueue processing and virtio_scsi_data_plane_start() because > it only assigns s-

Re: [PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-04 Thread Stefano Garzarella
On Wed, Aug 03, 2022 at 12:28:24PM -0400, Stefan Hajnoczi wrote: As soon as virtio_scsi_data_plane_start() attaches host notifiers the IOThread may start virtqueue processing. There is a race between IOThread virtqueue processing and virtio_scsi_data_plane_start() because it only assigns s->datap

[PATCH] virtio-scsi: fix race in virtio_scsi_dataplane_start()

2022-08-03 Thread Stefan Hajnoczi
As soon as virtio_scsi_data_plane_start() attaches host notifiers the IOThread may start virtqueue processing. There is a race between IOThread virtqueue processing and virtio_scsi_data_plane_start() because it only assigns s->dataplane_started after attaching host notifiers. When a virtqueue hand