[PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also implements an API for mapping/unmapping pages for guest PCI drivers and

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
Hi Alex, I posted other pair of patches. While debugging and testing my stuff I implemented some rough hack to support IOMMU mappings without passing those hypercalls to the QEMU, this is why I moved pieces of code around - want to support both QEMU-VFIO and kernel optimized H_PUT_TCE

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alex Williamson
On Wed, 2012-12-12 at 17:14 +1100, Alexey Kardashevskiy wrote: On 08/12/12 04:38, Alex Williamson wrote: +static int __init tce_iommu_init(void) +{ + struct pci_dev *pdev = NULL; + struct iommu_table *tbl; + struct iommu_group *grp; + + /* Allocate and initialize IOMMU groups */

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alex Williamson
On Wed, 2012-12-12 at 23:34 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
On 13/12/12 10:30, Alex Williamson wrote: On Wed, 2012-12-12 at 23:34 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Benjamin Herrenschmidt
On Wed, 2012-12-12 at 07:34 -0700, Alex Williamson wrote: But what would I put there?... IOMMU ID is more than enough at the moment and struct iommu_table does not have anything what would have made sense to show in the sysfs... I believe David mentioned that PEs had user visible names.

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Benjamin Herrenschmidt
On Wed, 2012-12-12 at 16:30 -0700, Alex Williamson wrote: Locked page accounting in this version is very, very broken. How do powerpc folks feel about seemingly generic kernel iommu interfaces messing with the current task mm? Besides that, more problems below... Not good at all :-) I

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Benjamin Herrenschmidt
On Wed, 2012-12-12 at 16:30 -0700, Alex Williamson wrote: Locked page accounting in this version is very, very broken. How do powerpc folks feel about seemingly generic kernel iommu interfaces messing with the current task mm? Besides that, more problems below... After a second look

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alex Williamson
On Thu, 2012-12-13 at 13:57 +1100, Benjamin Herrenschmidt wrote: On Wed, 2012-12-12 at 16:30 -0700, Alex Williamson wrote: Locked page accounting in this version is very, very broken. How do powerpc folks feel about seemingly generic kernel iommu interfaces messing with the current task

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-12 Thread Alexey Kardashevskiy
On 13/12/12 13:29, Benjamin Herrenschmidt wrote: On Wed, 2012-12-12 at 07:34 -0700, Alex Williamson wrote: But what would I put there?... IOMMU ID is more than enough at the moment and struct iommu_table does not have anything what would have made sense to show in the sysfs... I believe David

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-11 Thread Alexey Kardashevskiy
On 08/12/12 04:38, Alex Williamson wrote: +static int __init tce_iommu_init(void) +{ + struct pci_dev *pdev = NULL; + struct iommu_table *tbl; + struct iommu_group *grp; + + /* Allocate and initialize IOMMU groups */ + for_each_pci_dev(pdev) { + tbl =

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-12-07 Thread Alex Williamson
On Fri, 2012-12-07 at 18:35 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also

[PATCH] vfio powerpc: enabled on powernv platform

2012-12-06 Thread Alexey Kardashevskiy
This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also implements an API for mapping/unmapping pages for guest PCI drivers and

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-11-30 Thread Alex Williamson
On Fri, 2012-11-30 at 17:14 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-11-30 Thread Alexey Kardashevskiy
On 01/12/12 03:48, Alex Williamson wrote: On Fri, 2012-11-30 at 17:14 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO

[PATCH] vfio powerpc: enabled on powernv platform

2012-11-29 Thread Alexey Kardashevskiy
This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also implements an API for mapping/unmapping pages for guest PCI drivers and

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-11-29 Thread Alexey Kardashevskiy
On 29/11/12 15:20, Alex Williamson wrote: + /* Put tces to the table */ + for (i = 0; (i pages) !ret; ++i, tce += IOMMU_PAGE_SIZE) { + ret = put_tce(tbl, entry + i, tce, direction); + /* +* As IOMMU page size is always 4K, the system

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-11-28 Thread Alex Williamson
On Wed, 2012-11-28 at 18:18 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also

[PATCH] vfio powerpc: enabled on powernv platform

2012-11-28 Thread Alexey Kardashevskiy
This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also implements an API for mapping/unmapping pages for guest PCI drivers and

Re: [PATCH] vfio powerpc: enabled on powernv platform

2012-11-28 Thread Alex Williamson
On Thu, 2012-11-29 at 14:53 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also

[PATCH] vfio powerpc: enabled on powernv platform

2012-11-27 Thread Alexey Kardashevskiy
This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO driver (PCI pass through). It also implements an API for mapping/unmapping pages for guest PCI drivers and