lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211116132921.GA15534@L-PF27918B-1352.localdomain>
Date:   Tue, 16 Nov 2021 21:29:21 +0800
From:   Wu Zongyong <wuzongyong@...ux.alibaba.com>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     jasowang@...hat.com, virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, wei.yang1@...ux.alibaba.com
Subject: Re: [PATCH] vhost-vdpa: clean irqs before reseting vdpa device

On Mon, Nov 15, 2021 at 05:56:17AM -0500, Michael S. Tsirkin wrote:
> On Mon, Nov 15, 2021 at 11:16:42AM +0800, Wu Zongyong wrote:
> > Vdpa devices should be reset after unseting irqs of virtqueues, or we
> > will get errors when killing qemu process:
> > 
> > >> pi_update_irte: failed to update PI IRTE
> > >> irq bypass consumer (token 0000000065102a43) unregistration fails: -22
> > 
> > Signed-off-by: Wu Zongyong <wuzongyong@...ux.alibaba.com>
> 
> 
> A Fixes flag might be appropriate here.  2cf1ba9a4d15c ?

Yes.

> 
> Also, remind me of commit 97f854be203883b61d24f230445bd533bbdf770c
> vhost_vdpa: unset vq irq before freeing irq - what's the difference
> in scenarios?

The issue fixed by the two patches is the same actually.
The commit you mentioned above takes effect when users unset the status
bit VIRTIO_CONFIG_S_DRIVER_OK. And this patch takes effect when the file
descriptor of vhost vdpa device is closed without unseting the status
bit VIRTIO_CONFIG_S_DRIVER_OK, for example, we send SIGKILL to qemu
process.
> 
> 
> > ---
> >  drivers/vhost/vdpa.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> > index 01c59ce7e250..29cced1cd277 100644
> > --- a/drivers/vhost/vdpa.c
> > +++ b/drivers/vhost/vdpa.c
> > @@ -1014,12 +1014,12 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> >  
> >  	mutex_lock(&d->mutex);
> >  	filep->private_data = NULL;
> > +	vhost_vdpa_clean_irq(v);
> >  	vhost_vdpa_reset(v);
> >  	vhost_dev_stop(&v->vdev);
> >  	vhost_vdpa_iotlb_free(v);
> >  	vhost_vdpa_free_domain(v);
> >  	vhost_vdpa_config_put(v);
> > -	vhost_vdpa_clean_irq(v);
> >  	vhost_dev_cleanup(&v->vdev);
> >  	kfree(v->vdev.vqs);
> >  	mutex_unlock(&d->mutex);
> > -- 
> > 2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ