Michael S. Tsirkin
2022-Jan-11 16:01 UTC
[PATCH 1/4] vdpa: Protect vdpa reset with cf_mutex
On Tue, Jan 11, 2022 at 09:22:17AM +0200, Eli Cohen wrote:> Call reset using the wrapper function vdpa_reset() to make sure the > operation is serialized with cf_mutex. > > Signed-off-by: Eli Cohen <elic at nvidia.com>The motivation is vague here, this does not really explain. Which operations are we trying to serialize? Multiple reset requests from userspace? Is anything broken right now without this patch?> --- > drivers/vhost/vdpa.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 6e7edaf2472b..fe0bbea4dab6 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -155,7 +155,6 @@ static long vhost_vdpa_get_status(struct vhost_vdpa *v, u8 __user *statusp) > static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp) > { > struct vdpa_device *vdpa = v->vdpa; > - const struct vdpa_config_ops *ops = vdpa->config; > u8 status, status_old; > int ret, nvqs = v->nvqs; > u16 i; > @@ -177,7 +176,7 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp) > vhost_vdpa_unsetup_vq_irq(v, i); > > if (status == 0) { > - ret = ops->reset(vdpa); > + ret = vdpa_reset(vdpa); > if (ret) > return ret; > } else > -- > 2.34.1