[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-16 Thread Stephen Hemminger
On Fri, 16 Oct 2015 19:11:35 +0200 Thomas Monjalon wrote: > To sum it up, > We want to remove the need of the out-of-tree module igb_uio. > 3 possible implementations were discussed so far: > - new UIO driver > - extend uio_pci_generic > - VFIO without IOMMU There is recent progress on VFIO

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Vlad Zolotarov
On 10/06/15 18:00, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 05:49:21PM +0300, Vlad Zolotarov wrote: >>> and read/write the config space. >>> This means that a single userspace bug is enough to corrupt kernel >>> memory. >> Could u, pls., provide and example of this simple bug? Because

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Avi Kivity
On 10/06/2015 05:07 PM, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 03:15:57PM +0300, Avi Kivity wrote: >> btw, (2) doesn't really add any insecurity. The user could already poke at >> the msix tables (as well as perform DMA); they just couldn't get a useful >> interrupt out of them. >

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Tue, Oct 06, 2015 at 05:49:21PM +0300, Vlad Zolotarov wrote: > >and read/write the config space. > >This means that a single userspace bug is enough to corrupt kernel > >memory. > > Could u, pls., provide and example of this simple bug? Because it's > absolutely not obvious... Stick a value

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Vlad Zolotarov
On 10/06/15 16:58, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 11:23:11AM +0300, Vlad Zolotarov wrote: >> Michael, how this or any other related patch is related to the problem u r >> describing? >> The above ability is there for years and if memory serves me >> well it was u who wrote

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Tue, Oct 06, 2015 at 03:15:57PM +0300, Avi Kivity wrote: > btw, (2) doesn't really add any insecurity. The user could already poke at > the msix tables (as well as perform DMA); they just couldn't get a useful > interrupt out of them. Poking at msix tables won't cause memory corruption unless

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Tue, Oct 06, 2015 at 11:23:11AM +0300, Vlad Zolotarov wrote: > Michael, how this or any other related patch is related to the problem u r > describing? > The above ability is there for years and if memory serves me > well it was u who wrote uio_pci_generic with this "security flaw". ;) I

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Tue, Oct 06, 2015 at 08:33:56AM +0100, Stephen Hemminger wrote: > Other than implementation objections, so far the two main arguments > against this reduce to: > 1. If you allow UIO ioctl then it opens an API hook for all the crap out > of tree UIO drivers to do what they want. > 2. If

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Avi Kivity
On 10/06/2015 10:33 AM, Stephen Hemminger wrote: > Other than implementation objections, so far the two main arguments > against this reduce to: >1. If you allow UIO ioctl then it opens an API hook for all the crap out > of tree UIO drivers to do what they want. >2. If you allow UIO

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Vlad Zolotarov
On 10/06/15 01:49, Michael S. Tsirkin wrote: > On Tue, Oct 06, 2015 at 01:09:55AM +0300, Vladislav Zolotarov wrote: >> How about instead of trying to invent the wheel just go and attack the >> problem >> directly just like i've proposed already a few times in the last days: >> instead >> of

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Stephen Hemminger
Other than implementation objections, so far the two main arguments against this reduce to: 1. If you allow UIO ioctl then it opens an API hook for all the crap out of tree UIO drivers to do what they want. 2. If you allow UIO MSI-X then you are expanding the usage of userspace

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Tue, Oct 06, 2015 at 01:09:55AM +0300, Vladislav Zolotarov wrote: > How about instead of trying to invent the wheel just go and attack the problem > directly just like i've proposed already a few times in the last days: instead > of limiting the UIO limit the users that are allowed to use UIO

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Vladislav Zolotarov
On Oct 6, 2015 12:55 AM, "Michael S. Tsirkin" wrote: > > On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > > Just forwarding events is not enough to make a valid driver. > > What is missing is a way to access the device in a safe way. > > Thinking about it some more, maybe

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-06 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > Just forwarding events is not enough to make a valid driver. > What is missing is a way to access the device in a safe way. Thinking about it some more, maybe some devices don't do DMA, and merely signal events with MSI/MSI-X.

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 10:26:19AM -0700, Stephen Hemminger wrote: > On Thu, 1 Oct 2015 19:31:08 +0300 > "Michael S. Tsirkin" wrote: > > > On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > > > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > > > This

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Alexander Duyck
On 10/01/2015 05:04 PM, Stephen Hemminger wrote: > On Thu, 1 Oct 2015 16:40:10 -0700 > Alexander Duyck wrote: > >> Do you really need to map IORESOURCE bars? Most drivers I can think of >> don't use IO BARs anymore. Maybe we could look at just dropping the >> code and adding it back later if we

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > This driver allows using PCI device with Message Signalled Interrupt > > from userspace. The API is similar to the igb_uio driver used by the DPDK. > > Via

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 01:37:12PM +0300, Michael S. Tsirkin wrote: > On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > > This driver allows using PCI device with Message Signalled Interrupt > > > from

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 07:50:37AM -0700, Stephen Hemminger wrote: > On Thu, 1 Oct 2015 11:33:06 +0300 > "Michael S. Tsirkin" wrote: > > > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > > This driver allows using PCI device with Message Signalled Interrupt > > > from

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Alexander Duyck
On 10/01/2015 05:01 PM, Stephen Hemminger wrote: > On Thu, 1 Oct 2015 16:40:10 -0700 > Alexander Duyck wrote: > >> I agree with some other reviewers. Why call pci_enable_msix in open? >> It seems like it would make much more sense to do this on probe, and >> then disable MSI-X on free. I can

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Stephen Hemminger
On Thu, 1 Oct 2015 16:40:10 -0700 Alexander Duyck wrote: > Do you really need to map IORESOURCE bars? Most drivers I can think of > don't use IO BARs anymore. Maybe we could look at just dropping the > code and adding it back later if we have a use case that absolutely > needs it. Mapping

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Stephen Hemminger
On Thu, 1 Oct 2015 16:40:10 -0700 Alexander Duyck wrote: > I agree with some other reviewers. Why call pci_enable_msix in open? > It seems like it would make much more sense to do this on probe, and > then disable MSI-X on free. I can only assume you are trying to do it > to save on

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Alexander Duyck
On 09/30/2015 03:28 PM, Stephen Hemminger wrote: > This driver allows using PCI device with Message Signalled Interrupt > from userspace. The API is similar to the igb_uio driver used by the DPDK. > Via ioctl it provides a mechanism to map MSI-X interrupts into event > file descriptors similar to

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > This driver allows using PCI device with Message Signalled Interrupt > > from userspace. The API is similar to the igb_uio driver used by the DPDK. > > Via

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Michael S. Tsirkin
On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > This driver allows using PCI device with Message Signalled Interrupt > from userspace. The API is similar to the igb_uio driver used by the DPDK. > Via ioctl it provides a mechanism to map MSI-X interrupts into event > file

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Stephen Hemminger
On Thu, 1 Oct 2015 19:31:08 +0300 "Michael S. Tsirkin" wrote: > On Thu, Oct 01, 2015 at 11:33:06AM +0300, Michael S. Tsirkin wrote: > > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > > This driver allows using PCI device with Message Signalled Interrupt > > > from

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-10-01 Thread Stephen Hemminger
On Thu, 1 Oct 2015 11:33:06 +0300 "Michael S. Tsirkin" wrote: > On Wed, Sep 30, 2015 at 03:28:58PM -0700, Stephen Hemminger wrote: > > This driver allows using PCI device with Message Signalled Interrupt > > from userspace. The API is similar to the igb_uio driver used by the DPDK. > > Via ioctl

[dpdk-dev] [PATCH 2/2] uio: new driver to support PCI MSI-X

2015-09-30 Thread Stephen Hemminger
This driver allows using PCI device with Message Signalled Interrupt from userspace. The API is similar to the igb_uio driver used by the DPDK. Via ioctl it provides a mechanism to map MSI-X interrupts into event file descriptors similar to VFIO. VFIO is a better choice if IOMMU is available, but