Re: [PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread David Gibson
On Tue, May 07, 2013 at 04:27:49PM +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 04:02 PM, David Gibson wrote: > > On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: > >> On 05/07/2013 03:29 PM, David Gibson wrote: > >>> On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Karda

Re: [PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 04:02 PM, David Gibson wrote: > On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: >> On 05/07/2013 03:29 PM, David Gibson wrote: >>> On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: This allows the host kernel to handle H_PUT_TCE, H_PUT_TC

Re: [PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread David Gibson
On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 03:29 PM, David Gibson wrote: > > On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: > >> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > >> and H_STUFF_TCE requests withou

Re: [PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 03:29 PM, David Gibson wrote: > On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: >> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT >> and H_STUFF_TCE requests without passing them to QEMU, which should >> save time on switching to QEMU and bac

Re: [PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread David Gibson
On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: > This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > and H_STUFF_TCE requests without passing them to QEMU, which should > save time on switching to QEMU and back. > > Both real and virtual modes are supported

Re: [PATCH 2/6] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-06 Thread David Gibson
On Mon, May 06, 2013 at 05:25:53PM +1000, Alexey Kardashevskiy wrote: > This adds real mode handlers for the H_PUT_TCE_INDIRECT and > H_STUFF_TCE hypercalls for QEMU emulated devices such as virtio > devices or emulated PCI. These calls allow adding multiple entries > (up to 512) into the TCE tabl

Re: [PATCH 3/3] powerpc/powernv: Don't configure IO window on PHB3

2013-05-06 Thread Gavin Shan
On Tue, May 07, 2013 at 07:34:30AM +1000, Benjamin Herrenschmidt wrote: >On Mon, 2013-05-06 at 21:44 +0800, Gavin Shan wrote: >> We needn't configure IO windows for the corresponding PEs on PHB3 >> since that doesn't support IO. > >Here too, no need for such a flag, just check that >pci_controller-

Re: [PATCH 2/3] powerpc/powernv: Disable IO space for PCI buses

2013-05-06 Thread Gavin Shan
On Tue, May 07, 2013 at 07:33:02AM +1000, Benjamin Herrenschmidt wrote: >On Mon, 2013-05-06 at 21:44 +0800, Gavin Shan wrote: >> The patch intends to set the special flag (PCI_BUS_FLAGS_NO_IO) for >> root buses so PCI core will skip assignment for IO stuff. Besides, >> we also clear the IO resource

[PATCH] powerpc: Make CONFIG_RTAS_PROC depend on CONFIG_PROC_FS

2013-05-06 Thread Michael Ellerman
We are getting build errors with CONFIG_PROC_FS=n: arch/powerpc/kernel/rtas_flash.c In function 'rtas_flash_init': 745:33: error: unused variable 'f' [-Werror=unused-variable] But rtas_flash.c should not be built when CONFIG_PROC_FS=n, beacause all it does is provide a /proc interface to the

Re: [PATCH] powerpc: fix numa distance for form0 device tree

2013-05-06 Thread Michael Ellerman
On Mon, May 06, 2013 at 09:06:15PM -0700, Greg KH wrote: > On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote: > > From: Vaidyanathan Srinivasan > > > > Commit 7122b7bc1757682049780179d7c216dd1c83 upstream. > > > > The following commit breaks numa distance setup for old powerpc

Re: [PATCH] powerpc: fix numa distance for form0 device tree

2013-05-06 Thread Greg KH
On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote: > From: Vaidyanathan Srinivasan > > Commit 7122b7bc1757682049780179d7c216dd1c83 upstream. > > The following commit breaks numa distance setup for old powerpc > systems that use form0 encoding in device tree. > > commit 41eab6

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 22:05 -0500, Scott Wood wrote: > On 05/06/2013 07:03:14 PM, Benjamin Herrenschmidt wrote: > > On Mon, 2013-05-06 at 18:53 -0500, Scott Wood wrote: > > > > > > > Ie. The last stage of entry will hard enable, so they should be > > > > soft-enabled too... if not, latency trackers

[PATCH] powerpc: fix numa distance for form0 device tree

2013-05-06 Thread Michael Ellerman
From: Vaidyanathan Srinivasan Commit 7122b7bc1757682049780179d7c216dd1c83 upstream. The following commit breaks numa distance setup for old powerpc systems that use form0 encoding in device tree. commit 41eab6f88f24124df89e38067b3766b7bef06ddb powerpc/numa: Use form 1 affinity to setup node

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 11:42 AM, Alex Williamson wrote: > On Tue, 2013-05-07 at 10:49 +1000, Alexey Kardashevskiy wrote: >> On 05/07/2013 07:07 AM, Alex Williamson wrote: >>> On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: From: Alexey Kardashevskiy The IOMMU API implements groups c

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Scott Wood
On 05/06/2013 07:03:14 PM, Benjamin Herrenschmidt wrote: On Mon, 2013-05-06 at 18:53 -0500, Scott Wood wrote: > > > Ie. The last stage of entry will hard enable, so they should be > > soft-enabled too... if not, latency trackers will consider the whole > > guest periods as "interrupt disabled"

Re: [RFC][KVM][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts

2013-05-06 Thread Scott Wood
On 05/06/2013 09:43:37 PM, tiejun.chen wrote: On 05/07/2013 10:06 AM, Scott Wood wrote: On 05/06/2013 08:56:25 PM, tiejun.chen wrote: On 05/07/2013 07:50 AM, Scott Wood wrote: On 05/05/2013 10:13:17 PM, tiejun.chen wrote: On 05/06/2013 11:10 AM, Tiejun Chen wrote: For the external interrupt,

Re: [RFC][KVM][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts

2013-05-06 Thread tiejun.chen
On 05/07/2013 10:06 AM, Scott Wood wrote: On 05/06/2013 08:56:25 PM, tiejun.chen wrote: On 05/07/2013 07:50 AM, Scott Wood wrote: On 05/05/2013 10:13:17 PM, tiejun.chen wrote: On 05/06/2013 11:10 AM, Tiejun Chen wrote: For the external interrupt, the decrementer exception and the doorbell exc

[PATCH] powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again

2013-05-06 Thread Li Zhong
Saw this warning again, and this time from the ret_from_fork path. It seems we could clear the back chain earlier in copy_thread(), which could cover both path, and also fix potential lockdep usage in schedule_tail(), or exception occurred before we clear the back chain. Signed-off-by: Li Zhong

Re: [RFC][KVM][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts

2013-05-06 Thread Scott Wood
On 05/06/2013 08:56:25 PM, tiejun.chen wrote: On 05/07/2013 07:50 AM, Scott Wood wrote: On 05/05/2013 10:13:17 PM, tiejun.chen wrote: On 05/06/2013 11:10 AM, Tiejun Chen wrote: For the external interrupt, the decrementer exception and the doorbell excpetion, we also need to soft-disable inter

Re: [RFC][KVM][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts

2013-05-06 Thread tiejun.chen
On 05/07/2013 07:50 AM, Scott Wood wrote: On 05/05/2013 10:13:17 PM, tiejun.chen wrote: On 05/06/2013 11:10 AM, Tiejun Chen wrote: For the external interrupt, the decrementer exception and the doorbell excpetion, we also need to soft-disable interrupts while doing as host interrupt handlers sin

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alex Williamson
On Tue, 2013-05-07 at 10:49 +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 07:07 AM, Alex Williamson wrote: > > On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: > >> From: Alexey Kardashevskiy > >> > >> The IOMMU API implements groups creating/deletion, device binding > >> and IOMMU ma

Invalid perf_branch_entry.to entries question

2013-05-06 Thread Michael Neuling
Peter & Stephane, We are plumbing the POWER8 Branch History Rolling Buffer (BHRB) into struct perf_branch_entry. Sometimes on POWER8 we may not be able to fill out the "to" address. We initially thought of just making this 0, but it's feasible that this could be a valid address to branch to. T

Re: [v1][KVM][PATCH 1/1] kvm:ppc: enable doorbell exception with E500MC

2013-05-06 Thread tiejun.chen
On 05/06/2013 10:58 PM, Alexander Graf wrote: On 05/06/2013 04:53 AM, Tiejun Chen wrote: Actually E500MC also support doorbell exception, and CONFIG_PPC_E500MC can cover BOOK3E/BOOK3E_64 as well. Signed-off-by: Tiejun Chen --- arch/powerpc/kvm/booke.c |2 +- 1 file changed, 1 insertion(+

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alexey Kardashevskiy
On 05/07/2013 07:07 AM, Alex Williamson wrote: > On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: >> From: Alexey Kardashevskiy >> >> The IOMMU API implements groups creating/deletion, device binding >> and IOMMU map/unmap operations. >> >> The PowerPC implementation uses most of the API e

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 18:53 -0500, Scott Wood wrote: > > > Ie. The last stage of entry will hard enable, so they should be > > soft-enabled too... if not, latency trackers will consider the whole > > guest periods as "interrupt disabled"... > > OK... I guess we already have that problem on 32-bit

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Scott Wood
On 05/05/2013 04:03:08 PM, Benjamin Herrenschmidt wrote: On Fri, 2013-05-03 at 18:45 -0500, Scott Wood wrote: > kvmppc_lazy_ee_enable() was causing interrupts to be soft-enabled > (albeit hard-disabled) in kvmppc_restart_interrupt(). This led to > warnings, and possibly breakage if the interrupt

Re: [RFC][KVM][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts

2013-05-06 Thread Scott Wood
On 05/05/2013 10:13:17 PM, tiejun.chen wrote: On 05/06/2013 11:10 AM, Tiejun Chen wrote: For the external interrupt, the decrementer exception and the doorbell excpetion, we also need to soft-disable interrupts while doing as host interrupt handlers since the DO_KVM hook is always performed

Re: [PATCH v2 1/4] powerpc/cputable: reserve bits in HWCAP2 for new features

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 14:07 -0500, Ryan Arnold wrote: > Notice that I changed DSCR to DSC. The 'R' wasn't descriptive. The "R" is the name of the register for which we are exposing the availability to userspace... it's also the name of the sysfs entry so I'd rather keep it for consistency. Cheer

Re: [PATCH] arch/powerpc: advertise ISA2.07, HTM, DSCR, EBB and ISEL bits in HWCAP2

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 09:38 -0500, Ryan Arnold wrote: > My understanding was that these bits being 'on' is an indication of > what features the hardware supports (or what the kernel emulates) and > a not an indication of whether that facility is currently enabled or > not. If the hardware supports

Re: [PATCH 3/3] powerpc/powernv: Don't configure IO window on PHB3

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 21:44 +0800, Gavin Shan wrote: > We needn't configure IO windows for the corresponding PEs on PHB3 > since that doesn't support IO. Here too, no need for such a flag, just check that pci_controller->io_resource.flags is 0. BTW. Please work on top of the patch I sent already

Re: [PATCH 2/3] powerpc/powernv: Disable IO space for PCI buses

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 21:44 +0800, Gavin Shan wrote: > The patch intends to set the special flag (PCI_BUS_FLAGS_NO_IO) for > root buses so PCI core will skip assignment for IO stuff. Besides, > we also clear the IO resources on all PCI devices for PHB3. Why the new hook ? Can't this be detected si

Re: [PATCH] powerpc, perf: Fix processing conditions for invalid BHRB entries

2013-05-06 Thread Michael Neuling
Anshuman Khandual wrote: > On 05/06/2013 04:41 PM, Michael Neuling wrote: > > Anshuman Khandual wrote: > > > >> Fixing some conditions during BHRB entry processing. > > > > I think we can simplify this a lot more... something like the below. > > > > I feel that the conditional handling of th

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alex Williamson
On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: > From: Alexey Kardashevskiy > > The IOMMU API implements groups creating/deletion, device binding > and IOMMU map/unmap operations. > > The PowerPC implementation uses most of the API except map/unmap > operations, which are implemented o

[PATCH] powerpc: Fix build errors STRICT_MM_TYPECHECKS

2013-05-06 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pte-hash64-64k.h | 2 +- arch/powerpc/kernel/pci-common.c | 5 ++--- arch/powerpc/mm/init_64.c | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/incl

Re: [PATCH v2 1/4] powerpc/cputable: reserve bits in HWCAP2 for new features

2013-05-06 Thread Ryan Arnold
Hi Nish, Nishanth Aravamudan wrote on 05/03/2013 07:47:56 PM: > +/* in AT_HWCAP2 */ > +#define PPC_FEATURE2_ARCH_2_07 0x8000 > +#define PPC_FEATURE2_HTM 0x4000 > +#define PPC_FEATURE2_DSCR 0x2000 > +#define PPC_FEATURE2_EBB 0x1000 > +#define PPC_FEATURE2_ISEL

Re: [PATCH] arch/powerpc: advertise ISA2.07, HTM, DSCR, EBB and ISEL bits in HWCAP2

2013-05-06 Thread Ryan Arnold
Nishanth Aravamudan wrote on 05/03/2013 06:40:19 PM: > Nishanth Aravamudan > 05/03/2013 06:40 PM > > To > > Benjamin Herrenschmidt > > cc > > Michael Neuling , Michael R Meissner/ > Cambridge/IBM@IBMUS, Steve Munroe/Rochester/IBM@IBMUS, Peter > Bergner/Rochester/IBM@IBMUS, Ryan Arnold/Rocheste

Re: [PATCH] powerpc/pci: Support per-aperture memory offset

2013-05-06 Thread Bjorn Helgaas
On Sun, May 5, 2013 at 11:50 PM, Benjamin Herrenschmidt wrote: > The PCI core supports an offset per aperture nowadays but our arch > code still has a single offset per host bridge representing the > difference betwen CPU memory addresses and PCI MMIO addresses. > > This is a problem as new machin

Re: [v1][KVM][PATCH 1/1] kvm:ppc: enable doorbell exception with E500MC

2013-05-06 Thread Alexander Graf
On 05/06/2013 04:53 AM, Tiejun Chen wrote: Actually E500MC also support doorbell exception, and CONFIG_PPC_E500MC can cover BOOK3E/BOOK3E_64 as well. Signed-off-by: Tiejun Chen --- arch/powerpc/kvm/booke.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm

Re: [PATCH] powerpc, perf: Fix processing conditions for invalid BHRB entries

2013-05-06 Thread Anshuman Khandual
On 05/06/2013 04:41 PM, Michael Neuling wrote: > Anshuman Khandual wrote: > >> Fixing some conditions during BHRB entry processing. > > I think we can simplify this a lot more... something like the below. > I feel that the conditional handling of the invalid BHRB entries should be present whic

Re: [PATCHv5 0/2] Speed Cap fixes for ppc64

2013-05-06 Thread Jerome Glisse
n Mon, May 6, 2013 at 10:32 AM, Alex Deucher wrote: > On Fri, May 3, 2013 at 7:01 PM, Benjamin Herrenschmidt > wrote: >> On Fri, 2013-05-03 at 19:43 -0300, Kleber Sacilotto de Souza wrote: >> >>> This patch series does: >>> 1. max_bus_speed is used to set the device to gen2 speeds >>> 2. on p

Re: [PATCHv5 0/2] Speed Cap fixes for ppc64

2013-05-06 Thread Alex Deucher
On Fri, May 3, 2013 at 7:01 PM, Benjamin Herrenschmidt wrote: > On Fri, 2013-05-03 at 19:43 -0300, Kleber Sacilotto de Souza wrote: > >> This patch series does: >> 1. max_bus_speed is used to set the device to gen2 speeds >> 2. on power there's no longer a conflict between the pseries call and

[PATCH 2/3] powerpc/powernv: Disable IO space for PCI buses

2013-05-06 Thread Gavin Shan
The patch intends to set the special flag (PCI_BUS_FLAGS_NO_IO) for root buses so PCI core will skip assignment for IO stuff. Besides, we also clear the IO resources on all PCI devices for PHB3. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/machdep.h|3 ++ arch/powerpc/kerne

[PATCH 3/3] powerpc/powernv: Don't configure IO window on PHB3

2013-05-06 Thread Gavin Shan
We needn't configure IO windows for the corresponding PEs on PHB3 since that doesn't support IO. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/p

[PATCH 1/3] PCI: PCI_BUS_FLAGS_NO_IO flag for PCI bus

2013-05-06 Thread Gavin Shan
There has some PCI hosts (e.g. PHB3) that don't support IO. So the patch intends to introduce the flag to indicate the special case. In turn, we won't do IO resource assignment and enable that. Signed-off-by: Gavin Shan --- drivers/pci/pci.c |3 +++ drivers/pci/setup-bus.c | 25 +

Re: [PATCH] powerpc, perf: Clear out branch entries to avoid any previous stale values

2013-05-06 Thread Michael Ellerman
On Mon, 2013-05-06 at 13:34 +0530, Anshuman Khandual wrote: > The 'to' field inside branch entries might contain stale values from previous > PMU interrupt instances which had indirect branches. So clear all the values > before reading a fresh set of BHRB entries after a PMU interrupt. > > Signed-

[PATCH] powerpc: Fix single step emulation of 32bit overflowed branches

2013-05-06 Thread Michael Neuling
Check truncate_if_32bit() on final write to nip. Signed-off-by: Michael Neuling diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index e15c521..99c7fc1 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -580,7 +580,7 @@ int __kprobes emulate_step(struct pt_re

Re: [PATCH] powerpc, perf: Fix processing conditions for invalid BHRB entries

2013-05-06 Thread Michael Neuling
Anshuman Khandual wrote: > Fixing some conditions during BHRB entry processing. I think we can simplify this a lot more... something like the below. Also, this marks the "to" address as all 1s, which is better poison value since it's possible to branch to/from 0x0. diff --git a/arch/powerpc/pe

Re: [PATCH] irqdomain: Allow quiet failure mode

2013-05-06 Thread Grant Likely
On Mon, May 6, 2013 at 7:41 AM, Benjamin Herrenschmidt wrote: > Some interrupt controllers refuse to map interrupts marked as > "protected" by firwmare. Since we try to map everyting in the > device-tree on some platforms, we end up with a lot of nasty > WARN's in the boot log for what is a normal

[PATCH] powerpc, perf: Clear out branch entries to avoid any previous stale values

2013-05-06 Thread Anshuman Khandual
The 'to' field inside branch entries might contain stale values from previous PMU interrupt instances which had indirect branches. So clear all the values before reading a fresh set of BHRB entries after a PMU interrupt. Signed-off-by: Anshuman Khandual --- arch/powerpc/perf/core-book3s.c | 2 ++

[PATCH] powerpc, perf: Clear out branch entries to avoid any previous stale values

2013-05-06 Thread Anshuman Khandual
The 'to' field inside branch entries might contain stale values from previous PMU interrupt instances which had indirect branches. So clear all the values before reading a fresh set of BHRB entries after a PMU interrupt. Signed-off-by: Anshuman Khandual --- arch/powerpc/perf/core-book3s.c | 2 ++

[PATCH] powerpc, perf: Fix processing conditions for invalid BHRB entries

2013-05-06 Thread Anshuman Khandual
Fixing some conditions during BHRB entry processing. Signed-off-by: Anshuman Khandual --- arch/powerpc/perf/core-book3s.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 09db68d..1de2756 100644 --

Re: [PATCH 8/8] powerpc/topology: Fix spurr attribute permission

2013-05-06 Thread Benjamin Herrenschmidt
On Mon, 2013-05-06 at 16:50 +1000, Benjamin Herrenschmidt wrote: > We are registering the attribute with permission 0600 but it > doesn't have a store callback, which causes WARN_ON's during > boot. Fix the permission. Ignore the 8/8 in the subject, that's just me not cleaning things up properly :

[PATCH 6/6] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
This adds special support for huge pages (16MB). The reference counting cannot be easily done for such pages in real mode (when MMU is off) so we added a list of huge pages. It is populated in virtual mode and get_page is called just once per a huge page. Real mode handlers check if the requested

[PATCH 5/6] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT and H_STUFF_TCE requests without passing them to QEMU, which should save time on switching to QEMU and back. Both real and virtual modes are supported - whenever the kernel fails to handle TCE request, it passes it to the virtual

[PATCH 4/6] iommu: Add a function to find an iommu group by id

2013-05-06 Thread Alexey Kardashevskiy
As IOMMU groups are exposed to the user space by their numbers, the user space can use them in various kernel APIs so the kernel might need an API to find a group by its ID. As an example, QEMU VFIO on PPC64 platform needs it to associate a logical bus number (LIOBN) with a specific IOMMU group in

[PATCH 3/6] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-05-06 Thread Alexey Kardashevskiy
The current VFIO-on-POWER implementation supports only user mode driven mapping, i.e. QEMU is sending requests to map/unmap pages. However this approach is really slow, so we want to move that to KVM. Since H_PUT_TCE can be extremely performance sensitive (especially with network adapters where eac

[PATCH 2/6] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-06 Thread Alexey Kardashevskiy
This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as virtio devices or emulated PCI. These calls allow adding multiple entries (up to 512) into the TCE table in one call which saves time on transition to/from real mode. This adds a g

[PATCH 1/6] KVM: PPC: Make lookup_linux_pte public

2013-05-06 Thread Alexey Kardashevskiy
The lookup_linux_pte() function returns a linux PTE which is needed in the process of converting KVM guest physical address into host real address in real mode. This conversion will be used by upcoming support of H_PUT_TCE_INDIRECT, as the TCE list address comes from the guest and is a guest physi

[PATCH 0/6] KVM: PPC: IOMMU in-kernel handling

2013-05-06 Thread Alexey Kardashevskiy
This series is supposed to accelerate IOMMU operations in real and virtual mode in the host kernel for the KVM guest. The first user is VFIO however this series does not contain any VFIO related code as the connection between VFIO and the new handlers is to be made in QEMU via ioctl to the KVM fd.

[PATCH 5/5] powerpc/vfio: Enable on pSeries platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy The enables VFIO on the pSeries platform, enabling user space programs to access PCI devices directly. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/iommu.c |4 drivers/iommu/Kconfig

[PATCH 4/5] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-06 Thread aik
From: Alexey Kardashevskiy VFIO implements platform independent stuff such as a PCI driver, BAR access (via read/write on a file descriptor or direct mapping when possible) and IRQ signaling. The platform dependent part includes IOMMU initialization and handling. This implements an IOMMU driver

[PATCH 3/5] powerpc/vfio: Enable on POWERNV platform

2013-05-06 Thread aik
From: Alexey Kardashevskiy This 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 the VFIO driver, which is used for PCI pass through. It also implements an API for mappi

[PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread aik
From: Alexey Kardashevskiy The IOMMU API implements groups creating/deletion, device binding and IOMMU map/unmap operations. The PowerPC implementation uses most of the API except map/unmap operations, which are implemented on POWER using hypercalls. However, in order to link a kernel with the

[PATCH 1/5] iommu: Move initialization earlier

2013-05-06 Thread aik
From: Alexey Kardashevskiy The iommu_init() call initializes IOMMU internal structures and data required for the API to function such as iommu_group_alloc(). It is registered as a subsys_initcall. One of the IOMMU users is a PCI subsystem on POWER which discovers new IOMMU tables during the PCI

[PATCH 0/5] VFIO PPC64: add VFIO support on POWERPC64

2013-05-06 Thread aik
From: Alexey Kardashevskiy The series adds support for VFIO on POWERPC in user space (such as QEMU). The in-kernel real mode IOMMU support is added by another series posted separately. As the first and main aim of this series is the POWERNV platform support, the "Enable on POWERNV platform" patc