Skip to content
Commit 6a37a01a authored by Stefano Garzarella's avatar Stefano Garzarella Committed by Greg Kroah-Hartman
Browse files

vdpa_sim: fix vringh initialization in vdpasim_queue_ready()

[ Upstream commit 794ec498 ]

When we initialize vringh, we should pass the features and the
number of elements in the virtqueue negotiated with the driver,
otherwise operations with vringh may fail.

This was discovered in a case where the driver sets a number of
elements in the virtqueue different from the value returned by
.get_vq_num_max().

In vdpasim_vq_reset() is safe to initialize the vringh with
default values, since the virtqueue will not be used until
vdpasim_queue_ready() is called again.

Fixes: 2c53d0f6

 ("vdpasim: vDPA device simulator")
Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Message-Id: <20221110141335.62171-1-sgarzare@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarEugenio Pérez <eperezma@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e3462410
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment