lkml.org 
[lkml]   [2015]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] uio_pci_generic: add MSI/MSI-X support
On Thu, Oct 08, 2015 at 12:45:08PM +0300, Gleb Natapov wrote:
> On Thu, Oct 08, 2015 at 12:38:28PM +0300, Michael S. Tsirkin wrote:
> > On Thu, Oct 08, 2015 at 10:59:10AM +0300, Gleb Natapov wrote:
> > > I do not remember this been an issue when uio_generic was accepted
> > > into the kernel. The reason was because it meant to be accessible by root
> > > only.
> >
> > No - because it does not need bus mastering. So it can be used safely
> > with some devices.
> >
> It still can be used safely with same devices.

This patch does not add any functionality that can be used safely.
And for no good reason except it's a hassle.

> Admittedly I did not look
> close, but I am sure the patch does not enable bus mastering if MSI
> interrupt is not requested. If not, well that can be fixed. But more
> importantly it can be used unsafely in its current state. Not only can,
> it is widely used so.
>
> > [mst@robin linux]$ git grep pci_set_master|wc -l 533
> > [mst@robin linux]$ git grep pci_enable|wc -l 1597
> >
> > Looks like about 2/3 devices don't need to be bus masters.
> >
> > It's up to admin not to bind it to devices, and that is unfortunate,
> > but manually binding an incorrect driver to a device is generally
> > a hard problem to solve.
> >
> > > > There's also drivers/vfio/virqfd.c which deals
> > > > with sending interrupts over eventfds correctly.
> > > >
> > > As opposite to this patch that deals with them incorrectly? In what way?
> >
> > cleanup on fd close is not handled.
> >
> Have you commented about this on the patch and it was not fixed?

No - I only noticed this when I poked at VFIO to try and explain
why it's not a good idea to duplicate its code. I'm sure there
are more issues that we'll just have to re-discover the hard way
if we do try.

> --
> Gleb.


\
 
 \ /
  Last update: 2015-10-08 14:21    [W:1.853 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site