diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2023-05-01 19:04:09 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-05-19 10:30:46 -0400 |
commit | 6f8be29ec17d44496b9ed67599bceaaba72d1864 (patch) | |
tree | 7c0660315efb06a8914e7cc29a2680ded119a28c /.gitlab-ci.d | |
parent | 5b52692f9d258d0e2637234832dc00042de03a4d (diff) | |
download | qemu-6f8be29ec17d44496b9ed67599bceaaba72d1864.zip qemu-6f8be29ec17d44496b9ed67599bceaaba72d1864.tar.gz qemu-6f8be29ec17d44496b9ed67599bceaaba72d1864.tar.bz2 |
vhost-user: send SET_STATUS 0 after GET_VRING_BASE
Setting the VIRTIO Device Status Field to 0 resets the device. The
device's state is lost, including the vring configuration.
vhost-user.c currently sends SET_STATUS 0 before GET_VRING_BASE. This
risks confusion about the lifetime of the vhost-user state (e.g. vring
last_avail_idx) across VIRTIO device reset.
Eugenio Pérez <eperezma@redhat.com> adjusted the order for vhost-vdpa.c
in commit c3716f260bff ("vdpa: move vhost reset after get vring base")
and in that commit description suggested doing the same for vhost-user
in the future.
Go ahead and adjust vhost-user.c now. I ran various online code searches
to identify vhost-user backends implementing SET_STATUS. It seems only
DPDK implements SET_STATUS and Yajun Wu <yajunw@nvidia.com> has
confirmed that it is safe to make this change.
Fixes: commit 923b8921d210763359e96246a58658ac0db6c645 ("vhost-user: Support vhost_dev_start")
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Cindy Lu <lulu@redhat.com>
Cc: Yajun Wu <yajunw@nvidia.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230501230409.274178-1-stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Yajun Wu <yajunw@nvidia.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to '.gitlab-ci.d')
0 files changed, 0 insertions, 0 deletions