Thanks,
Feng Li

Gerd Hoffmann <kra...@redhat.com> 于2021年8月31日周二 下午8:59写道:
>
> On Tue, Aug 31, 2021 at 08:23:39PM +0800, Li Feng wrote:
> > Currently, virtio-scsi doesn't support any control or event message, this 
> > patch
> > adds the basic initialization.
> >
> > Some backends need this feature, like dpdk/spdk vhost-user backend.
> >
> > Reproduce:
> > 1. Start spdk vhost-user-scsi backend;
> > 2. Create a vm with a SCSI vhost-user-scsi disk and start the vm;
> > 3. Mount an iso to the vm without an OS;
> > 3. Stop the vhost-user-scsi backend;
> > 5. Vhost-user-scsi backend will crash before exiting when cleaning the 
> > resources.
>
> IMHO this must be fixed in vhost-user-scsi no matter what.  Host
> processes crashing in case the guest doesn't behave as expected
> is a security problem.
Yes, the backend should be fixed.
However, we may as well initialize these two vqs, because other virtio
frontend drivers have implemented these
as I know. It's good for compatibility.
>
> > The reason is that the seabios virtio-scsi only initializes the req vq,
> > then the spdk/dpdk treats it a not good session, it's hard to handle this 
> > tricky
> > issue from dpdk architecture.
>
> What is the exact problem here?  vhost-user-scsi trying to send a
> hotplug event (when adding the iso, probably as virtual cdrom) and
> seabios not listening?
No, hotplug is another question I should handle.
This crash is that some vring(controlq, eventq) aren't initialized
done from vhost-user aspect.
 And spdk/dpdk handles incoming events from theses queues, but the
vhost-user device isn't RUNNING
 status, becase some vqs are not ready, so the destruction is bad.

>
> > +    if (vp_find_vq(vp, 1, &vq) < 0 ) {
> > +        dprintf(1, "fail to find event vq for virtio-scsi %pP\n", pci);
> > +        goto fail;
> > +    }
>
> That alone doesn't allow receiving events (no recv buffers added).  Also
> note that seabios does not support hotplugging devices, so the only
> thing we could do with those events is to throw them away.
>
Yes, from the spec, I should put some recv buffers here, so events
could be written here.
Here just initialized it, then qemu vhost-user device will send the
VHOST_USER_KICK to drive the vhost-user backend.

BTW, do you accept a future patch that implements the virtio SCSI hotplug?

Thanks.

> take care,
>   Gerd
>
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org

Reply via email to