Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-05 Thread Alex Williamson
Hi Tom. A few MSI issues below. Thanks, Alex On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: diff -uprN linux-2.6.34/drivers/vfio/vfio_pci_config.c vfio-linux-2.6.34/drivers/vfio/vfio_pci_config.c --- linux-2.6.34/drivers/vfio/vfio_pci_config.c 1969-12-31 16:00:00.0

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-01 Thread Alex Williamson
On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a single unsigned 64 bit integer as an argument. +This call also has the side effect of enabling PCI bus mastership. Hi Tom, This

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a single unsigned 64 bit integer as an argument. +This call also

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-01 Thread Alex Williamson
On Thu, 2010-07-01 at 18:31 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 09:48:41AM -0600, Alex Williamson wrote: On Thu, 2010-07-01 at 18:31 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-07-01 Thread Tom Lyon
On Thursday 01 July 2010 08:48:41 am Alex Williamson wrote: On Thu, 2010-07-01 at 18:31 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Michael S. Tsirkin
On Wed, Jun 30, 2010 at 12:14:12AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X, and PCIe devices. Hi

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Alex Williamson
On Wed, 2010-06-30 at 16:36 +0300, Michael S. Tsirkin wrote: On Wed, Jun 30, 2010 at 12:14:12AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Tom Lyon
Thanks, Alex! Am incorporating... On Tuesday 29 June 2010 11:14:12 pm Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X,

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Michael S. Tsirkin
On Wed, Jun 30, 2010 at 03:17:55PM -0700, Tom Lyon wrote: Thanks, Alex! Am incorporating... I get it there's no chance you'll drop the virtualization from the driver then? -- MST -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Tom Lyon
On Wednesday 30 June 2010 03:32:56 pm Michael S. Tsirkin wrote: On Wed, Jun 30, 2010 at 03:17:55PM -0700, Tom Lyon wrote: Thanks, Alex! Am incorporating... I get it there's no chance you'll drop the virtualization from the driver then? I think it'll get a whole lot simpler by depending

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Alex Williamson
On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +int vfio_dma_unmap_dm(struct vfio_listener *listener, struct vfio_dma_map *dmp) +{ + unsigned long start, npage; + struct dma_map_page *mlp; + struct list_head *pos, *pos2; + int ret; + + start = dmp-vaddr

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Tom Lyon
On Wednesday 30 June 2010 09:16:23 pm Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +int vfio_dma_unmap_dm(struct vfio_listener *listener, struct vfio_dma_map *dmp) +{ + unsigned long start, npage; + struct dma_map_page *mlp; + struct list_head *pos,

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-30 Thread Alex Williamson
On Wed, 2010-06-30 at 21:30 -0700, Tom Lyon wrote: On Wednesday 30 June 2010 09:16:23 pm Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +int vfio_dma_unmap_dm(struct vfio_listener *listener, struct vfio_dma_map *dmp) +{ + unsigned long start, npage; +

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-24 Thread Joerg Roedel
On Thu, Jun 17, 2010 at 02:14:00PM -0700, Tom Lyon wrote: On Sunday 13 June 2010 03:23:39 am Michael S. Tsirkin wrote: OK, after more investigation, I realize you are right. We definitely need the IOMMU protection for interrupts, and if we have it, a lot of the code for config space

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-24 Thread Michael S. Tsirkin
On Thu, Jun 24, 2010 at 02:22:19PM +0200, Joerg Roedel wrote: On Thu, Jun 17, 2010 at 02:14:00PM -0700, Tom Lyon wrote: On Sunday 13 June 2010 03:23:39 am Michael S. Tsirkin wrote: OK, after more investigation, I realize you are right. We definitely need the IOMMU protection for

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-17 Thread Tom Lyon
On Sunday 13 June 2010 03:23:39 am Michael S. Tsirkin wrote: On Fri, Jun 11, 2010 at 03:15:53PM -0700, Tom Lyon wrote: [ bunch of stuff about MSI-X checking and IOMMUs and config registers...] OK, here's the thing. The IOMMU API today does not do squat about dealing with interrupts.

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-17 Thread Michael S. Tsirkin
On Thu, Jun 17, 2010 at 02:14:00PM -0700, Tom Lyon wrote: On Sunday 13 June 2010 03:23:39 am Michael S. Tsirkin wrote: On Fri, Jun 11, 2010 at 03:15:53PM -0700, Tom Lyon wrote: [ bunch of stuff about MSI-X checking and IOMMUs and config registers...] OK, here's the thing. The IOMMU

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-13 Thread Michael S. Tsirkin
On Fri, Jun 11, 2010 at 03:15:53PM -0700, Tom Lyon wrote: [ bunch of stuff about MSI-X checking and IOMMUs and config registers...] OK, here's the thing. The IOMMU API today does not do squat about dealing with interrupts. Interrupts are special because the APIC addresses are not each in

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-11 Thread Tom Lyon
The inline comments are getting pretty hard to wade through, so I'm deleting some of the lesser stuff - but I am incorporating into the code. On Tuesday 08 June 2010 10:45:57 pm Michael S. Tsirkin wrote: On Tue, Jun 08, 2010 at 04:54:43PM -0700, Tom Lyon wrote: On Tuesday 08 June 2010

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-10 Thread Konrad Rzeszutek Wilk
+EXPORT_SYMBOL(uiommu_fdget); EXPORT_SYMBOL_GPL .. snip +EXPORT_SYMBOL(uiommu_put); ditto. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-10 Thread Tom Lyon
On Thursday 10 June 2010 10:27:36 am Konrad Rzeszutek Wilk wrote: +EXPORT_SYMBOL(uiommu_fdget); EXPORT_SYMBOL_GPL .. snip +EXPORT_SYMBOL(uiommu_put); ditto. Is there a definitive explanation somewhere of when to use each? -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-10 Thread Greg KH
On Thu, Jun 10, 2010 at 06:58:37PM -0700, Tom Lyon wrote: On Thursday 10 June 2010 10:27:36 am Konrad Rzeszutek Wilk wrote: +EXPORT_SYMBOL(uiommu_fdget); EXPORT_SYMBOL_GPL .. snip +EXPORT_SYMBOL(uiommu_put); ditto. Is there a definitive explanation somewhere of when to use

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-09 Thread Avi Kivity
On 06/09/2010 12:21 AM, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X, and PCIe devices. Signed-off-by: Tom Lyonp...@cisco.com --- This version now requires an IOMMU domain

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-09 Thread Arnd Bergmann
On Tuesday 08 June 2010, Randy Dunlap wrote: Documentation/ioctl/ioctl-number.txt |1 Documentation/vfio.txt | 177 +++ MAINTAINERS |7 drivers/Kconfig |2 drivers/Makefile |1

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-09 Thread Greg KH
On Wed, Jun 09, 2010 at 02:04:53PM +0300, Avi Kivity wrote: On 06/09/2010 12:21 AM, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X, and PCIe devices. Signed-off-by: Tom

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-09 Thread Michael S. Tsirkin
On Tue, Jun 08, 2010 at 02:21:52PM -0700, Tom Lyon wrote: + case VFIO_DOMAIN_UNSET: + vfio_domain_unset(vdev); + ret = 0; + break; + What if I do: SET mmap UNSET Now I have access to device which is not behind an iommu. Simplest solution is to remove

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-08 Thread Randy Dunlap
On Tue, 08 Jun 2010 14:21:52 -0700 Tom Lyon wrote: one missing piece (again): Documentation/ioctl/ioctl-number.txt |1 Documentation/vfio.txt | 177 +++ MAINTAINERS |7 drivers/Kconfig |2 drivers/Makefile

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-08 Thread Randy Dunlap
On Tue, 08 Jun 2010 14:21:52 -0700 Tom Lyon wrote: diff -uprN linux-2.6.34/Documentation/vfio.txt vfio-linux-2.6.34/Documentation/vfio.txt --- linux-2.6.34/Documentation/vfio.txt 1969-12-31 16:00:00.0 -0800 +++ vfio-linux-2.6.34/Documentation/vfio.txt 2010-06-07

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-08 Thread Michael S. Tsirkin
On Tue, Jun 08, 2010 at 02:21:52PM -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X, and PCIe devices. Signed-off-by: Tom Lyon p...@cisco.com Some general comments: -

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-08 Thread Tom Lyon
On Tuesday 08 June 2010 03:38:44 pm Michael S. Tsirkin wrote: On Tue, Jun 08, 2010 at 02:21:52PM -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device drivers for any well-behaved PCI, PCI-X, and PCIe devices.

Re: [PATCH V2] VFIO driver: Non-privileged user level PCI drivers

2010-06-08 Thread Michael S. Tsirkin
On Tue, Jun 08, 2010 at 04:54:43PM -0700, Tom Lyon wrote: On Tuesday 08 June 2010 03:38:44 pm Michael S. Tsirkin wrote: On Tue, Jun 08, 2010 at 02:21:52PM -0700, Tom Lyon wrote: The VFIO driver is used to allow privileged AND non-privileged processes to implement user-level device