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]
Date:   Wed, 12 Jan 2022 09:52:23 -0500
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Jason Wang <jasowang@...hat.com>
Cc:     李东升 <lidongsheng@...udpu.com>,
        virtualization <virtualization@...ts.linux-foundation.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] virtio_vdpa: Support surprise removal of virtio vdpa
 device

On Wed, Jan 12, 2022 at 03:52:52PM +0800, Jason Wang wrote:
> On Wed, Jan 12, 2022 at 2:30 PM Michael S. Tsirkin <mst@...hat.com> wrote:
> >
> > On Wed, Jan 12, 2022 at 10:23:07AM +0800, Jason Wang wrote:
> > > On Tue, Jan 11, 2022 at 7:52 PM Michael S. Tsirkin <mst@...hat.com> wrote:
> > > >
> > > > On Tue, Jan 11, 2022 at 11:36:42AM +0800, 李东升 wrote:
> > > > > When virtio vdpa device removed, the abnormal damage of the device cannot be
> > > > > perceived normally, which will cause problems similar to:
> > > > >
> > > > > 43bb40c5b926
> > > >
> > > >
> > > > Should include the subject of the patch too.
> > > >
> > > > > Hence, add the ability to abort the command on surprise removal
> > > > >
> > > > > Signed-off-by: dongsheng li <lidongsheng@...udpu.com>
> > > >
> > > > When removing gracefully,
> > > > I am not sure we should break device unconditionally like this
> > > > before giving drivers a chance to clean up.
> > > > Should we just do it for surprise removal?
> > >
> > > That requires a new method to query whether it's a surprise removal.
> > >
> > > Thanks
> >
> > We can check pci_device_is_present like virtio does.
> 
> Though the PCI device is the main user, we are vdpa transport that is
> unaware of the type of its parent.
> 
> So it looks to me we need a new method and PCI parent and do call this
> function when needed.
> 
> Thanks

Sure.

> >
> > > >
> > > > > ---
> > > > >  drivers/virtio/virtio_vdpa.c | 1 +
> > > > >  1 file changed, 1 insertion(+)
> > > > >
> > > > > diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> > > > > index 4a9ddb44b2a7..fd930409d190 100644
> > > > > --- a/drivers/virtio/virtio_vdpa.c
> > > > > +++ b/drivers/virtio/virtio_vdpa.c
> > > > > @@ -374,6 +374,7 @@ static void virtio_vdpa_remove(struct vdpa_device *vdpa)
> > > > >  {
> > > > >   struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa);
> > > > >
> > > > > + virtio_break_device(vd_dev->vdev);
> > > > >   unregister_virtio_device(&vd_dev->vdev);
> > > > >  }
> > > > >
> > > > > --
> > > > > 2.17.1
> > > >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ