Re: [PATCH kernel] vfio/spapr_tce: Set window when adding additional groups to container

2017-02-07 Thread Alex Williamson
mmit 6f01cc692a16 ("vfio/spapr: Add a helper to create default DMA window") did not just simplify the code but also removed the set_window() calls in the case of attaching groups to a container which already has tables so it broke VFIO PCI hotplug. This reverts set_window() b

Re: [PATCH] vfio: Fix build break when SPAPR_TCE_IOMMU=n

2017-02-02 Thread Alex Williamson
On Thu, 02 Feb 2017 20:50:48 +1100 Michael Ellerman wrote: > Michael Ellerman writes: > > > Currently the kconfig logic for VFIO_IOMMU_SPAPR_TCE and VFIO_SPAPR_EEH > > is broken when SPAPR_TCE_IOMMU=n. Leading to: > > > > warning: (VFIO) selects

Re: [PATCH kernel] vfio/spapr: Fix missing mutex unlock when creating a window

2017-02-01 Thread Alex Williamson
On Wed, 1 Feb 2017 14:26:16 +1100 Alexey Kardashevskiy wrote: > d9c728949ddc: "vfio/spapr: Postpone default window creation" added > an additional exit to the VFIO_IOMMU_SPAPR_TCE_CREATE case and made it > possible to return from tce_iommu_ioctl() without unlocking >

Re: [PATCH kernel 9/9] KVM: PPC: Add in-kernel acceleration for VFIO

2016-12-19 Thread Alex Williamson
On Wed, 14 Dec 2016 14:53:13 +1100 Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > On 10/12/16 02:35, Alex Williamson wrote: > > On Fri, 9 Dec 2016 18:53:43 +1100 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > >> On 09/12/16 04:55, Alex Willia

Re: [PATCH kernel v2 10/11] vfio: Check for unregistered notifiers when group is actually released

2016-12-19 Thread Alex Williamson
On Mon, 19 Dec 2016 18:41:05 +0800 Jike Song wrote: > On 12/18/2016 09:28 AM, Alexey Kardashevskiy wrote: > > This moves a check for unregistered notifiers from fops release > > callback to the place where the group will actually be released. > > > > Signed-off-by: Alexey

Re: [PATCH kernel 9/9] KVM: PPC: Add in-kernel acceleration for VFIO

2016-12-09 Thread Alex Williamson
On Fri, 9 Dec 2016 18:53:43 +1100 Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > On 09/12/16 04:55, Alex Williamson wrote: > > On Thu, 8 Dec 2016 19:19:56 +1100 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > >> This allows the host kern

Re: [PATCH kernel 9/9] KVM: PPC: Add in-kernel acceleration for VFIO

2016-12-08 Thread Alex Williamson
On Thu, 8 Dec 2016 19:19:56 +1100 Alexey Kardashevskiy wrote: > This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > and H_STUFF_TCE requests targeted an IOMMU TCE table used for VFIO > without passing them to user space which saves time on switching > to user

Re: [PATCH kernel v7 6/7] vfio/spapr: Reference mm in tce_container

2016-12-01 Thread Alex Williamson
v6: > * updated the commit log about not referencing task > > v5: > * postpone referencing of mm > > v4: > * added check for container->mm!=current->mm in tce_iommu_ioctl() > for all ioctls and removed other redundand checks > --- > drivers/vfio/vfio_iommu_spapr_tc

Re: [PATCH kernel v7 7/7] powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown

2016-12-01 Thread Alex Williamson
oved tce_iommu_prereg_free() call out of list_for_each_entry() > > v2: > * updated commit log > --- > arch/powerpc/mm/mmu_context_book3s64.c | 4 +-- > arch/powerpc/mm/mmu_context_iommu.c | 11 -- > drivers/vfio/vfio_iommu_spapr_tce.c| 61 >

Re: [PATCH kernel v7 2/7] powerpc/iommu: Stop using @current in mm_iommu_xxx

2016-12-01 Thread Alex Williamson
_context.h | 16 ++-- > arch/powerpc/mm/mmu_context_iommu.c| 46 > +- > drivers/vfio/vfio_iommu_spapr_tce.c | 14 --- > 3 files changed, 36 insertions(+), 40 deletions(-) Acked-by: Alex Williamson <alex.william...@redhat.com> > diff --

Re: [PATCH kernel v7 3/7] vfio/spapr: Postpone allocation of userspace version of TCE table

2016-12-01 Thread Alex Williamson
is adds a new return code to the DMA mapping path but > this seems to be a minor change. > --- > drivers/vfio/vfio_iommu_spapr_tce.c | 20 +++- > 1 file changed, 7 insertions(+), 13 deletions(-) Acked-by: Alex Williamson <alex.william...@redhat.com> > diff --git a/

Re: [PATCH kernel v7 4/7] vfio/spapr: Add a helper to create default DMA window

2016-12-01 Thread Alex Williamson
d Gibson <da...@gibson.dropbear.id.au> > --- > Changes: > v6: > * new to the patchset > --- > drivers/vfio/vfio_iommu_spapr_tce.c | 87 > ++------- > 1 file changed, 42 insertions(+), 45 deletions(-) Acked-by: Alex Williamson <alex.

Re: [PATCH kernel v7 5/7] vfio/spapr: Postpone default window creation

2016-12-01 Thread Alex Williamson
tion is removal > of not yet created default window. > --- > drivers/vfio/vfio_iommu_spapr_tce.c | 40 > +++-- > 1 file changed, 25 insertions(+), 15 deletions(-) Acked-by: Alex Williamson <alex.william...@redhat.com> > diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c >

Re: [PATCH kernel v5 5/6] vfio/spapr: Reference mm in tce_container

2016-11-17 Thread Alex Williamson
On Thu, 17 Nov 2016 18:39:41 +1100 Alexey Kardashevskiy wrote: > On 11/11/16 23:32, Alexey Kardashevskiy wrote: > > In some situations the userspace memory context may live longer than > > the userspace process itself so if we need to do proper memory context > > cleanup, we

Re: [PATCH kernel v4 0/4] powerpc/spapr/vfio: Put pages on VFIO container shutdown

2016-11-08 Thread Alex Williamson
On Tue, 08 Nov 2016 18:54:28 +1100 Michael Ellerman wrote: > Alexey Kardashevskiy writes: > > These patches are to fix a bug when pages stay pinned hours > > after QEMU which requested pinning exited. > > > > Please comment. Thanks. > > > > Alexey

Re: [PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-11-08 Thread Alex Williamson
On Mon, 24 Oct 2016 17:53:09 +1100 Alexey Kardashevskiy wrote: > In some situations the userspace memory context may live longer than > the userspace process itself so if we need to do proper memory context > cleanup, we better have tce_container take a reference to mm_struct and

Re: [PATCH] vfio: Fix build break when SPAPR_TCE_IOMMU=n

2016-11-07 Thread Alex Williamson
On Tue, 08 Nov 2016 10:49:35 +1100 Michael Ellerman <m...@ellerman.id.au> wrote: > Alex Williamson <alex.william...@redhat.com> writes: > > On Mon, 07 Nov 2016 19:34:42 +1100 > > Michael Ellerman <m...@ellerman.id.au> wrote: > >> Paolo Bonzini <p

Re: [PATCH] vfio: Fix build break when SPAPR_TCE_IOMMU=n

2016-11-07 Thread Alex Williamson
On Mon, 07 Nov 2016 19:34:42 +1100 Michael Ellerman wrote: > Paolo Bonzini writes: > > On 04/11/2016 06:48, Michael Ellerman wrote: > >> diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig > >> index da6e2ce77495..6b51a4ebed8a 100644 > >> ---

Re: [PATCH kernel 14/15] vfio/spapr_tce: Export container API for external users

2016-08-15 Thread Alex Williamson
On Mon, 15 Aug 2016 13:59:47 +1000 Paul Mackerras <pau...@ozlabs.org> wrote: > On Tue, Aug 09, 2016 at 06:16:30AM -0600, Alex Williamson wrote: > > On Tue, 9 Aug 2016 15:19:39 +1000 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > > >

Re: [PATCH kernel 14/15] vfio/spapr_tce: Export container API for external users

2016-08-12 Thread Alex Williamson
On Fri, 12 Aug 2016 15:46:01 +1000 David Gibson <da...@gibson.dropbear.id.au> wrote: > On Wed, Aug 10, 2016 at 10:46:30AM -0600, Alex Williamson wrote: > > On Wed, 10 Aug 2016 15:37:17 +1000 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > > >

Re: [PATCH kernel 14/15] vfio/spapr_tce: Export container API for external users

2016-08-10 Thread Alex Williamson
On Wed, 10 Aug 2016 15:37:17 +1000 Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > On 09/08/16 22:16, Alex Williamson wrote: > > On Tue, 9 Aug 2016 15:19:39 +1000 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > >> On 09/08/16 02:43, Alex Willia

Re: [PATCH kernel 14/15] vfio/spapr_tce: Export container API for external users

2016-08-09 Thread Alex Williamson
On Tue, 9 Aug 2016 15:19:39 +1000 Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > On 09/08/16 02:43, Alex Williamson wrote: > > On Wed, 3 Aug 2016 18:40:55 +1000 > > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > > > >> This exports helpers

Re: [PATCH kernel 14/15] vfio/spapr_tce: Export container API for external users

2016-08-08 Thread Alex Williamson
On Wed, 3 Aug 2016 18:40:55 +1000 Alexey Kardashevskiy wrote: > This exports helpers which are needed to keep a VFIO container in > memory while there are external users such as KVM. > > Signed-off-by: Alexey Kardashevskiy > --- > drivers/vfio/vfio.c

Re: [RFC 12/18] limits: track RLIMIT_MEMLOCK actual max

2016-06-13 Thread Alex Williamson
On Mon, 13 Jun 2016 22:44:19 +0300 Topi Miettinen wrote: > Track maximum size of locked memory, presented in /proc/self/limits. > > Signed-off-by: Topi Miettinen > --- > arch/ia64/kernel/perfmon.c | 1 + >

Re: [RESEND PATCH v2 0/6] vfio-pci: Add support for mmapping MSI-X table

2016-06-02 Thread Alex Williamson
AFAICT, you posted this *3* days ago, has something changed here or is this just expedited nagging for review? This also depends on a non-upstream series and crosses multiple functional areas, all of which make it difficult for maintainers to actually do anything with this series. Thanks, Alex

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-13 Thread Alex Williamson
On Fri, 13 May 2016 06:50:25 + "Tian, Kevin" <kevin.t...@intel.com> wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Friday, May 13, 2016 1:33 PM > > > > > > > > As argued previously in this thread, there's

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-12 Thread Alex Williamson
On Fri, 13 May 2016 02:33:18 + "Tian, Kevin" <kevin.t...@intel.com> wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Friday, May 13, 2016 1:48 AM > > > > On Thu, 12 May 2016 04:53:19 + > > "Tian, Kevin"

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-12 Thread Alex Williamson
On Thu, 12 May 2016 04:53:19 + "Tian, Kevin" <kevin.t...@intel.com> wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, May 12, 2016 10:21 AM > > > > On Thu, 12 May 2016 01:19:44 + > > "Tian, Kevin

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-11 Thread Alex Williamson
On Thu, 12 May 2016 01:19:44 + "Tian, Kevin" <kevin.t...@intel.com> wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Wednesday, May 11, 2016 11:54 PM > > > > On Wed, 11 May 2016 06:29:06 + > > "Tian, Kevin

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-11 Thread Alex Williamson
On Wed, 11 May 2016 06:29:06 + "Tian, Kevin" <kevin.t...@intel.com> wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Thursday, May 05, 2016 11:05 PM > > > > On Thu, 5 May 2016 12:15:46 + > > "Tian, Kevin

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-06 Thread Alex Williamson
On Fri, 6 May 2016 16:35:38 +1000 Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > On 05/06/2016 01:05 AM, Alex Williamson wrote: > > On Thu, 5 May 2016 12:15:46 + > > "Tian, Kevin" <kevin.t...@intel.com> wrote: > > > >>> From: Y

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-05 Thread Alex Williamson
On Thu, 5 May 2016 12:15:46 + "Tian, Kevin" wrote: > > From: Yongji Xie [mailto:xyj...@linux.vnet.ibm.com] > > Sent: Thursday, May 05, 2016 7:43 PM > > > > Hi David and Kevin, > > > > On 2016/5/5 17:54, David Laight wrote: > > > > > From: Tian, Kevin > > >> Sent:

Re: [PATCH kernel v4 02/11] vfio/spapr: Relax the IOMMU compatibility check

2016-04-29 Thread Alex Williamson
= > + table_group->ops->create_table) { > pr_warn("tce_vfio: Group %d is incompatible with group > %d\n", > iommu_group_id(iommu_group

Re: [PATCH kernel v4 01/11] vfio_pci: Test for extended capabilities if config space > 256 bytes

2016-04-29 Thread Alex Williamson
On Fri, 29 Apr 2016 18:55:14 +1000 Alexey Kardashevskiy wrote: > PCI-Express spec says that reading 4 bytes at offset 100h should return > zero if there is no extended capability so VFIO reads this dword to > know if there are extended capabilities. > > However it is not always

Re: [PATCH kernel] vfio_iommu_spapr_tce: Remove unneeded iommu_group_get_iommudata

2016-04-28 Thread Alex Williamson
On Fri, 8 Apr 2016 14:54:41 +1000 Alexey Kardashevskiy wrote: > This removes iommu_group_get_iommudata() as the result is never used. > As this is a minor cleanup, no change in behavior is expected. > > Signed-off-by: Alexey Kardashevskiy > --- >

Re: [RFC v6 00/10] vfio-pci: Allow to mmap sub-page MMIO BARs and MSI-X table

2016-04-26 Thread Alex Williamson
On Mon, 25 Apr 2016 18:05:53 +0800 Yongji Xie wrote: > Hi Alex, > > Any comment? TBH, I shuffled this to the bottom of the review pile because you're depending on a patch series for ARM MSI mapping that's still very much in flux. You've really got 3 or 4 separate

Re: [RFC v5 7/7] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-04-06 Thread Alex Williamson
On Tue, 5 Apr 2016 21:46:44 +0800 Yongji Xie wrote: > This patch enables mmapping MSI-X tables if > hardware supports interrupt remapping which > can ensure that a given pci device can only > shoot the MSIs assigned for it. > > Signed-off-by: Yongji Xie

Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support multiple devices

2016-03-20 Thread Alex Williamson
On Thu, 17 Mar 2016 19:28:34 +0800 Yongji Xie <xyj...@linux.vnet.ibm.com> wrote: > On 2016/3/17 0:30, Alex Williamson wrote: > > On Mon, 7 Mar 2016 15:48:35 +0800 > > Yongji Xie <xyj...@linux.vnet.ibm.com> wrote: > > > >> When vfio passthrough a PCI

Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add IOMMU_CAP_INTR_REMAP for IODA host bridge

2016-03-19 Thread Alex Williamson
On Thu, 17 Mar 2016 19:38:29 +0800 Yongji Xie <xyj...@linux.vnet.ibm.com> wrote: > On 2016/3/17 0:32, Alex Williamson wrote: > > On Mon, 7 Mar 2016 15:48:38 +0800 > > Yongji Xie <xyj...@linux.vnet.ibm.com> wrote: > > > >> This patch adds IO

Re: [RFC PATCH v4 5/7] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive

2016-03-19 Thread Alex Williamson
On Mon, 7 Mar 2016 15:48:36 +0800 Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap > sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio > page may be shared with other BARs. > > But we should allow to mmap these sub-page MMIO BARs if

Re: [RFC PATCH v4 4/7] PCI: Modify resource_alignment to support multiple devices

2016-03-19 Thread Alex Williamson
On Mon, 7 Mar 2016 15:48:35 +0800 Yongji Xie wrote: > When vfio passthrough a PCI device of which MMIO BARs > are smaller than PAGE_SIZE, guest will not handle the > mmio accesses to the BARs which leads to mmio emulations > in host. > > This is because vfio will not

Re: [RFC PATCH v4 7/7] powerpc/powernv/pci-ioda: Add IOMMU_CAP_INTR_REMAP for IODA host bridge

2016-03-18 Thread Alex Williamson
On Mon, 7 Mar 2016 15:48:38 +0800 Yongji Xie wrote: > This patch adds IOMMU_CAP_INTR_REMAP for IODA host bridge so that > we can mmap MSI-X table in vfio driver. > > Signed-off-by: Yongji Xie > --- >

Re: [RFC PATCH v4 3/7] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set

2016-03-18 Thread Alex Williamson
On Mon, 7 Mar 2016 15:48:34 +0800 Yongji Xie wrote: > The resource_alignment will releases memory resources > allocated by firmware so that kernel can reassign new > resources later on. But this will cause the problem > that no resources can be allocated by kernel if

Re: [RFC PATCH v4 6/7] vfio-pci: Allow to mmap MSI-X table if IOMMU_CAP_INTR_REMAP was set

2016-03-18 Thread Alex Williamson
[cc+ Eric, Will] On Mon, 7 Mar 2016 15:48:37 +0800 Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap MSI-X > table in case that user get to touch this directly. > > But we should allow to mmap these MSI-X tables if IOMMU > supports interrupt

Re: [RFC PATCH v3 1/5] PCI: Add support for enforcing all MMIO BARs to be page aligned

2016-01-29 Thread Alex Williamson
On Fri, 2016-01-29 at 18:37 +0800, Yongji Xie wrote: > On 2016/1/29 6:46, Alex Williamson wrote: > > On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote: > > > When vfio passthrough a PCI device of which MMIO BARs > > > are smaller than PAGE_SIZE, guest will not han

Re: [RFC PATCH v3 3/5] PCI: Add host bridge attribute to indicate filtering of MSIs is supported

2016-01-29 Thread Alex Williamson
- Original Message - > On 2016/1/29 6:46, Alex Williamson wrote: > > On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote: > >> MSI-X tables are not allowed to be mmapped in vfio-pci > >> driver in case that user get to touch this directly. > >> Thi

Re: [RFC PATCH v3 1/5] PCI: Add support for enforcing all MMIO BARs to be page aligned

2016-01-28 Thread Alex Williamson
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote: > When vfio passthrough a PCI device of which MMIO BARs > are smaller than PAGE_SIZE, guest will not handle the > mmio accesses to the BARs which leads to mmio emulations > in host. >  > This is because vfio will not allow to passthrough one >

Re: [RFC PATCH v3 3/5] PCI: Add host bridge attribute to indicate filtering of MSIs is supported

2016-01-28 Thread Alex Williamson
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote: > MSI-X tables are not allowed to be mmapped in vfio-pci > driver in case that user get to touch this directly. > This will cause some performance issues when when PCI > adapters have critical registers in the same page as > the MSI-X table. > 

Re: [RFC PATCH v3 5/5] vfio-pci: Allow to mmap MSI-X table if host bridge supports filtering of MSIs

2016-01-28 Thread Alex Williamson
On Fri, 2016-01-15 at 15:06 +0800, Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap MSI-X > table in case that user get to touch this directly. >  > But we should allow to mmap these MSI-X tables if the PCI > host bridge supports filtering of MSIs. >  > Signed-off-by: Yongji

Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected

2016-01-22 Thread Alex Williamson
On Fri, 2016-01-22 at 17:34 +1100, Alexey Kardashevskiy wrote: > Recent change 03a76b60 "vfio: Include No-IOMMU mode" disabled VFIO > on systems which do not implement iommu_ops for the PCI bus even > though > there is an VFIO IOMMU driver for it such as SPAPR TCE driver for > PPC64/powernv

Re: [RFC PATCH v2 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2016-01-04 Thread Alex Williamson
On Thu, 2015-12-31 at 16:50 +0800, Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap MSI-X > table in case that user get to touch this directly. > > However, EEH mechanism can ensure that a given pci device > can only shoot the MSIs assigned for its PE. So we think > it's safe

Re: [RFC PATCH v2 1/3] PCI: Add support for enforcing all MMIO BARs to be page aligned

2016-01-04 Thread Alex Williamson
On Thu, 2015-12-31 at 16:50 +0800, Yongji Xie wrote: > When vfio passthrough a PCI device of which MMIO BARs > are smaller than PAGE_SIZE, guest will not handle the > mmio accesses to the BARs which leads to mmio emulations > in host. > > This is because vfio will not allow to passthrough one >

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 18:37 +0800, yongji xie wrote: > > On 2015/12/17 4:14, Alex Williamson wrote: > > On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > > > Current vfio-pci implementation disallows to mmap MSI-X table in > > > case that user get to touch this

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 10:08 +, David Laight wrote: > > The MSI-X table is paravirtualized on vfio in general and interrupt > > remapping theoretically protects against errant interrupts, so why > > is > > this PPC64 specific? We have the same safeguards on x86 if we want > > to > > decide

Re: [RFC PATCH 2/3] vfio-pci: Allow to mmap sub-page MMIO BARs if all MMIO BARs are page aligned

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 18:26 +0800, yongji xie wrote: > > On 2015/12/17 4:04, Alex Williamson wrote: > > On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > > > Current vfio-pci implementation disallows to mmap > > > sub-page(size < PAGE_SIZE) MMIO BARs be

Re: [RFC PATCH 2/3] vfio-pci: Allow to mmap sub-page MMIO BARs if all MMIO BARs are page aligned

2015-12-16 Thread Alex Williamson
On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap > sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio page > may be shared with other BARs. > > But we should allow to mmap these sub-page MMIO BARs if all MMIO BARs > are page

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-16 Thread Alex Williamson
On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > Current vfio-pci implementation disallows to mmap MSI-X table in > case that user get to touch this directly. > > However, EEH mechanism could ensure that a given pci device > can only shoot the MSIs assigned for its PE and guest kernel also

Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-21 Thread Alex Williamson
On Mon, 2015-09-21 at 22:11 +1000, Gavin Shan wrote: > On Mon, Sep 21, 2015 at 11:42:28AM +1000, David Gibson wrote: > >On Sat, Sep 19, 2015 at 04:22:47PM +1000, David Gibson wrote: > >> On Fri, Sep 18, 2015 at 09:47:32AM -0600, Alex Williamson wrote: > >> > On

Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-18 Thread Alex Williamson
On Fri, 2015-09-18 at 16:24 +1000, Gavin Shan wrote: > This allows to accept IOMMU group (PE) ID from the parameter from userland > when handling EEH operation so that the operation only affects the target > IOMMU group (PE). If the IOMMU group (PE) ID in the parameter from userland > is invalid,

Re: [PATCH kernel v10 28/34] vfio: powerpc/spapr: powerpc/powernv/ioda: Define and implement DMA windows API

2015-05-13 Thread Alex Williamson
deletions(-) For vfio: Acked-by: Alex Williamson alex.william...@redhat.com diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index a902159..2c41115 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h @@ -70,6 +70,7 @@ struct

Re: [PATCH kernel v10 16/34] powerpc/spapr: vfio: Replace iommu_table with iommu_table_group

2015-05-13 Thread Alex Williamson
/platforms/powernv/pci.h| 3 +- arch/powerpc/platforms/pseries/iommu.c | 107 +++- drivers/vfio/vfio_iommu_spapr_tce.c | 23 +++--- For vfio: Acked-by: Alex Williamson alex.william...@redhat.com 8 files changed, 152 insertions(+), 90 deletions

Re: [PATCH kernel v10 33/34] vfio: powerpc/spapr: Register memory and define IOMMU v2

2015-05-13 Thread Alex Williamson
of the powernv code (such as VFIO). Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru [aw: for the vfio related changes] Acked-by: Alex Williamson alex.william...@redhat.com --- Alex, should I remove your acked-by in the cases like this and get another one? Generally if it's more than a trivial

Re: [PATCH kernel v10 05/34] powerpc/iommu: Always release iommu_table in iommu_free_table()

2015-05-13 Thread Alex Williamson
On Thu, 2015-05-14 at 12:34 +1000, Alexey Kardashevskiy wrote: On 05/14/2015 09:27 AM, Gavin Shan wrote: On Wed, May 13, 2015 at 02:51:36PM +0200, Thomas Huth wrote: On Wed, 13 May 2015 16:30:16 +1000 Alexey Kardashevskiy a...@ozlabs.ru wrote: On 05/13/2015 03:33 PM, Gavin Shan wrote:

Re: [PATCH kernel v9 02/32] Revert powerpc/powernv: Allocate struct pnv_ioda_pe iommu_table dynamically

2015-04-27 Thread Alex Williamson
On Sat, 2015-04-25 at 22:14 +1000, Alexey Kardashevskiy wrote: This reverts commit 9e8d4a19ab66ec9e132d405357b9108a4f26efd3 as tce32_table has exactly the same life time as the whole PE. scripts/checkpatch.pl would like your commit reference to appear as: commit 9e8d4a19ab66 (powerpc/powernv:

Re: [PATCH kernel v9 16/32] powerpc/powernv/ioda: Move TCE kill register address to PE

2015-04-27 Thread Alex Williamson
On Sat, 2015-04-25 at 22:14 +1000, Alexey Kardashevskiy wrote: At the moment the DMA setup code looks for the ibm,opal-tce-kill property which contains the TCE kill register address. Writes to this register invalidates TCE cache on IODA/IODA2 hub. This moves the register address from

Re: [PATCH kernel v9 30/32] vfio: powerpc/spapr: Use 32bit DMA window properties from table_group

2015-04-27 Thread Alex Williamson
in the series - to make the next patch simpler --- drivers/vfio/vfio_iommu_spapr_tce.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) Acked-by: Alex Williamson alex.william...@redhat.com diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio

Re: [PATCH kernel v8 15/31] powerpc/iommu: Fix IOMMU ownership control functions

2015-04-10 Thread Alex Williamson
On Fri, 2015-04-10 at 16:30 +1000, Alexey Kardashevskiy wrote: This adds missing locks in iommu_take_ownership()/ iommu_release_ownership(). This marks all pages busy in iommu_table::it_map in order to catch errors if there is an attempt to use this table while ownership over it is taken.

Re: [PATCH kernel v8 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-10 Thread Alex Williamson
On Fri, 2015-04-10 at 16:31 +1000, Alexey Kardashevskiy wrote: In order to support memory pre-registration, we need a way to track the use of every registered memory region and only allow unregistration if a region is not in use anymore. So we need a way to tell from what region the just

Re: [PATCH kernel v8 00/31] powerpc/iommu/vfio: Enable Dynamic DMA windows

2015-04-10 Thread Alex Williamson
issues that need to be addressed in arch code, I've noted them in comments for patches 15 26. I think I've run out of issues for the vfio changes, so for the vfio related changes in patches 1-8,12-14,17,25,29-31: Acked-by: Alex Williamson alex.william...@redhat.com

Re: [PATCH kernel v7 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-08 Thread Alex Williamson
On Wed, 2015-04-08 at 13:22 +1000, Alexey Kardashevskiy wrote: On 04/03/2015 07:50 AM, Alex Williamson wrote: Should have sent this with the other comments, but found it hiding on my desktop... On Sat, 2015-03-28 at 01:55 +1100, Alexey Kardashevskiy wrote: In order to support memory

Re: [PATCH kernel v7 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-08 Thread Alex Williamson
On Thu, 2015-04-09 at 13:21 +1000, Alexey Kardashevskiy wrote: On 04/09/2015 01:43 AM, Alex Williamson wrote: On Wed, 2015-04-08 at 13:22 +1000, Alexey Kardashevskiy wrote: On 04/03/2015 07:50 AM, Alex Williamson wrote: Should have sent this with the other comments, but found it hiding

Re: [PATCH kernel v7 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-02 Thread Alex Williamson
Should have sent this with the other comments, but found it hiding on my desktop... On Sat, 2015-03-28 at 01:55 +1100, Alexey Kardashevskiy wrote: In order to support memory pre-registration, we need a way to track the use of every registered memory region and only allow unregistration if a

Re: [PATCH kernel v7 04/31] vfio: powerpc/spapr: Use it_page_size

2015-04-01 Thread Alex Williamson
On Thu, 2015-04-02 at 14:40 +1100, Alexey Kardashevskiy wrote: On 04/02/2015 01:50 PM, Alex Williamson wrote: On Thu, 2015-04-02 at 13:30 +1100, Alexey Kardashevskiy wrote: On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote

Re: [PATCH kernel v7 04/31] vfio: powerpc/spapr: Use it_page_size

2015-04-01 Thread Alex Williamson
On Thu, 2015-04-02 at 13:30 +1100, Alexey Kardashevskiy wrote: On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: This makes use of the it_page_size from the iommu_table struct as page size can differ. This replaces missing

Re: [PATCH kernel v7 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-01 Thread Alex Williamson
On Thu, 2015-04-02 at 13:33 +1100, Alexey Kardashevskiy wrote: On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds

Re: [PATCH kernel v7 28/31] powerpc/mmu: Add userspace-to-physical addresses translation cache

2015-04-01 Thread Alex Williamson
On Sat, 2015-03-28 at 01:55 +1100, Alexey Kardashevskiy wrote: We are adding support for DMA memory pre-registration to be used in conjunction with VFIO. The idea is that the userspace which is going to run a guest may want to pre-register a user space memory region so it all gets pinned once

Re: [PATCH kernel v7 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-01 Thread Alex Williamson
On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table is supported. Signed-off-by: Alexey

Re: [PATCH kernel v7 04/31] vfio: powerpc/spapr: Use it_page_size

2015-04-01 Thread Alex Williamson
On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: This makes use of the it_page_size from the iommu_table struct as page size can differ. This replaces missing IOMMU_PAGE_SHIFT macro in commented debug code as recently introduced IOMMU_PAGE_XXX macros do not include

Re: [PATCH v5 3/3] drivers/vfio: Support EEH error injection

2015-03-31 Thread Alex Williamson
Acked-by: Alex Williamson alex.william...@redhat.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH kernel v7 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-03-31 Thread Alex Williamson
On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table is supported. Signed-off-by: Alexey

Re: [PATCH v4 4/4] drivers/vfio: Remove duplicated PE states

2015-03-25 Thread Alex Williamson
On Thu, 2015-03-26 at 10:20 +1100, Gavin Shan wrote: The set of constants for PE states defined in uapi/linux/vfio.h is duplicated to uapi/asm/eeh.h. The patch removes the set from the former. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- include/uapi/linux/vfio.h | 5 - 1

Re: [PATCH v4 4/4] drivers/vfio: Remove duplicated PE states

2015-03-25 Thread Alex Williamson
On Thu, 2015-03-26 at 11:59 +1100, Gavin Shan wrote: On Wed, Mar 25, 2015 at 06:46:28PM -0600, Alex Williamson wrote: On Thu, 2015-03-26 at 10:20 +1100, Gavin Shan wrote: The set of constants for PE states defined in uapi/linux/vfio.h is duplicated to uapi/asm/eeh.h. The patch removes

Re: [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state()

2015-03-23 Thread Alex Williamson
On Mon, 2015-03-23 at 15:40 +1100, Gavin Shan wrote: On Sun, Mar 22, 2015 at 10:06:01PM -0600, Alex Williamson wrote: On Mon, 2015-03-23 at 14:56 +1100, Gavin Shan wrote: On Sun, Mar 22, 2015 at 09:34:33PM -0600, Alex Williamson wrote: On Mon, 2015-03-23 at 14:02 +1100, Gavin Shan wrote

Re: [PATCH v3 2/2] drivers/vfio: Support EEH error injection

2015-03-23 Thread Alex Williamson
. Thanks, Alex - I would like keep the code between EEH/VFIO independent to each other enough. Thanks, Gavin By the way, Alex Williamson, could you please ACK this if you don't find obvious errors in the patch. I really want this to be merged to 4.1. Thanks

Re: [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state()

2015-03-23 Thread Alex Williamson
On Mon, 2015-03-23 at 17:07 -0300, casca...@linux.vnet.ibm.com wrote: On Mon, Mar 23, 2015 at 06:40:34AM -0600, Alex Williamson wrote: On Mon, 2015-03-23 at 15:40 +1100, Gavin Shan wrote: On Sun, Mar 22, 2015 at 10:06:01PM -0600, Alex Williamson wrote: On Mon, 2015-03-23 at 14:56 +1100

Re: [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state()

2015-03-22 Thread Alex Williamson
On Mon, 2015-03-23 at 14:02 +1100, Gavin Shan wrote: The patch adds one more parameter (probe) to pci_set_pcie_reset_state(), which allows to check if one particular PCI device can be resetted by the function. The function will be reused to support PCI device specific methods maintained in

Re: [PATCH v3 1/2] PCI: One more parameter to pci_set_pcie_reset_state()

2015-03-22 Thread Alex Williamson
On Mon, 2015-03-23 at 14:56 +1100, Gavin Shan wrote: On Sun, Mar 22, 2015 at 09:34:33PM -0600, Alex Williamson wrote: On Mon, 2015-03-23 at 14:02 +1100, Gavin Shan wrote: The patch adds one more parameter (probe) to pci_set_pcie_reset_state(), which allows to check if one particular PCI

Re: [PATCH kernel v6 29/29] vfio: powerpc/spapr: Support Dynamic DMA windows

2015-03-16 Thread Alex Williamson
On Tue, 2015-03-17 at 12:02 +1100, Alexey Kardashevskiy wrote: On 03/17/2015 06:38 AM, Alex Williamson wrote: On Fri, 2015-03-13 at 19:07 +1100, Alexey Kardashevskiy wrote: This adds create/remove window ioctls to create and remove DMA windows. sPAPR defines a Dynamic DMA windows capability

Re: [PATCH 2/2] drivers/vfio: Support EEH error injection

2015-03-13 Thread Alex Williamson
On Thu, 2015-03-12 at 15:21 +1100, David Gibson wrote: On Thu, Mar 12, 2015 at 02:16:42PM +1100, Gavin Shan wrote: On Thu, Mar 12, 2015 at 11:57:21AM +1100, David Gibson wrote: On Wed, Mar 11, 2015 at 05:34:11PM +1100, Gavin Shan wrote: The patch adds one more EEH sub-command

Re: [PATCH 1/2] powerpc/eeh: Introduce eeh_pe_inject_err()

2015-03-13 Thread Alex Williamson
On Wed, 2015-03-11 at 17:34 +1100, Gavin Shan wrote: The patch defines PCI error types and functions in eeh.h and exports function eeh_pe_inject_err(), which will be called by VFIO driver to inject the specified PCI error to the indicated PE for testing purpose. Signed-off-by: Gavin Shan

Re: [PATCH v5 29/29] vfio: powerpc/spapr: Support Dynamic DMA windows

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: This adds create/remove window ioctls to create and remove DMA windows. sPAPR defines a Dynamic DMA windows capability which allows para-virtualized guests to create additional DMA windows on a PCI bus. The existing linux kernels

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its physical address to the table. Otherwise the hardware gets unwanted access to physical memory between the end of

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Wed, 2015-03-11 at 09:57 +1100, Alexey Kardashevskiy wrote: On 03/11/2015 06:56 AM, Alex Williamson wrote: On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Wed, 2015-03-11 at 10:14 +1100, Benjamin Herrenschmidt wrote: On Tue, 2015-03-10 at 17:03 -0600, Alex Williamson wrote: return (PAGE_SHIFT + compound_order(compound_head(page) = page_shift); This won't be bool though. Yes, it will. Don't you have your parenthesis

Re: [PATCH v5 07/29] vfio: powerpc/spapr: Moving pinning/unpinning to helpers

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: This is a pretty mechanical patch to make next patches simpler. New tce_iommu_unuse_page() helper does put_page() now but it might skip that after the memory registering patch applied. As we are here, this removes unnecessary

Re: [PATCH v5 26/29] vfio: powerpc/spapr: Define v2 IOMMU

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: The existing IOMMU code takes/releases ownership over the existing IOMMU tables created by the platform code, i.e. the tables remain in memory all the time. Also, the existing IOMMU requires VFIO_IOMMU_ENABLE call to start working

Re: [PATCH v5 27/29] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework ownership

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: Before the IOMMU user would take control over the IOMMU table belonging to a specific IOMMU group. This approach did not allow sharing tables between IOMMU groups attached to the same container. This introduces a new IOMMU

Re: [PATCH v3 02/24] vfio: powerpc/iommu: Check that TCE page size is equal to it_page_size

2015-02-02 Thread Alex Williamson
On Thu, 2015-01-29 at 20:21 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its physical address to the table. Otherwise the hardware gets unwanted access to physical memory between the end of

Re: [PATCH v3 14/24] vfio: powerpc/spapr: Register memory

2015-02-02 Thread Alex Williamson
On Thu, 2015-01-29 at 20:21 +1100, Alexey Kardashevskiy wrote: The existing implementation accounts the whole DMA window in the locked_vm counter which is going to be even worse with multiple containers and huge DMA windows. This introduces 2 ioctls to register/unregister DMA memory which

Re: [PATCH v3 05/24] vfio: powerpc/spapr: Move locked_vm accounting to helpers

2015-02-02 Thread Alex Williamson
On Thu, 2015-01-29 at 20:21 +1100, Alexey Kardashevskiy wrote: There moves locked pages accounting to helpers. Later they will be reused for Dynamic DMA windows (DDW). While we are here, update the comment explaining why RLIMIT_MEMLOCK might be required to be bigger than the guest RAM. This

<    1   2   3   4   >