Re: [PATCH 1/2] powerpc: use smp_rmb when looking at deposisted pgtable to store hash index

2013-05-20 Thread Benjamin Herrenschmidt
On Mon, 2013-05-20 at 09:57 +0530, Aneesh Kumar K.V wrote: Michael Neuling mi...@neuling.org writes: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We need to use smb_rmb when looking at hpte slot array. Otherwise we

Re: [PATCH 1/2] powerpc: use smp_rmb when looking at deposisted pgtable to store hash index

2013-05-20 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Mon, 2013-05-20 at 09:57 +0530, Aneesh Kumar K.V wrote: Michael Neuling mi...@neuling.org writes: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We need to use

[PATCH] powerpc/tm: Abort transactions on emulation and alignment faults

2013-05-20 Thread Michael Neuling
If we are emulating an instruction inside an active user transaction that touches memory, the kernel can't emulate it as it operates in transactional suspend context. We need to abort these transactions and send them back to userspace for the hardware to rollback. We can service these if the

Re: [PATCH v2 2/4] powerpc/cputable: advertise DSCR support on P7/P7+

2013-05-20 Thread Will Schmidt
On Fri, 2013-05-03 at 17:48 -0700, Nishanth Aravamudan wrote: Signed-off-by: Nishanth Aravamudan n...@us.ibm.com diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index ae9f433..a792157 100644 --- a/arch/powerpc/kernel/cputable.c +++

Build failure with 3.9.3 (Regression 3.9.2-3.9.3)

2013-05-20 Thread Adam Lackorzynski
Hi, 3.9.3 introduced the following build failure: CC arch/powerpc/kernel/rtas.o arch/powerpc/kernel/rtas.c: In function ‘rtas_cpu_state_change_mask’: arch/powerpc/kernel/rtas.c:843:4: error: implicit declaration of function ‘cpu_down’ [-Werror=implicit-function-declaration] cc1: all

Re: [PATCH v2] can: flexcan: remove HAVE_CAN_FLEXCAN Kconfig symbol

2013-05-20 Thread Marc Kleine-Budde
On 05/17/2013 11:09 AM, Shawn Guo wrote: On Fri, May 17, 2013 at 10:59:17AM +0200, Marc Kleine-Budde wrote: This patch removes the Kconfig symbol HAVE_CAN_FLEXCAN from arch/{arm,powerpc} and allowing compilation unconditionally on all arm and powerpc platforms. This brings a bigger compile

[PATCH] powerpc/platforms/83xx/mcu_mpc8349emitx: Use module_i2c_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe peterhu...@gmx.de --- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 13 + 1 file changed, 1 insertion(+), 12

[PATCH 1/2] powerpc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread Bjorn Helgaas
Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the generic version of this code, pci_setup_device(), uses PCI_UNKNOWN. Signed-off-by: Bjorn Helgaas bhelg...@google.com ---

[PATCH 2/2] sparc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread Bjorn Helgaas
Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the generic version of this code, pci_setup_device(), uses PCI_UNKNOWN. Signed-off-by: Bjorn Helgaas bhelg...@google.com --- arch/sparc/kernel/pci.c |

Re: [PATCH 1/2] powerpc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread Bjorn Helgaas
On Mon, May 20, 2013 at 5:19 PM, Bjorn Helgaas bhelg...@google.com wrote: Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the generic version of this code, pci_setup_device(), uses PCI_UNKNOWN.

Re: [PATCH v2 2/4] powerpc/cputable: advertise DSCR support on P7/P7+

2013-05-20 Thread Michael Neuling
Will Schmidt will_schm...@vnet.ibm.com wrote: On Fri, 2013-05-03 at 17:48 -0700, Nishanth Aravamudan wrote: Signed-off-by: Nishanth Aravamudan n...@us.ibm.com diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index ae9f433..a792157 100644 ---

Re: [PATCH 1/2] powerpc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread Benjamin Herrenschmidt
On Mon, 2013-05-20 at 17:19 -0600, Bjorn Helgaas wrote: Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the generic version of this code, pci_setup_device(), uses PCI_UNKNOWN. Signed-off-by:

Re: [PATCH 1/2] powerpc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread Bjorn Helgaas
On Mon, May 20, 2013 at 5:42 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Mon, 2013-05-20 at 17:19 -0600, Bjorn Helgaas wrote: Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the

[PATCH v2] powerpc/tm: Abort transactions on emulation and alignment faults

2013-05-20 Thread Michael Neuling
If we are emulating an instruction inside an active user transaction that touches memory, the kernel can't emulate it as it operates in transactional suspend context. We need to abort these transactions and send them back to userspace for the hardware to rollback. We can service these if the

Re: [PATCH 2/2] sparc/PCI: Use PCI_UNKNOWN for unknown power state

2013-05-20 Thread David Miller
From: Bjorn Helgaas bhelg...@google.com Date: Mon, 20 May 2013 17:19:16 -0600 Previously we initialized dev-current_state to 4 (PCI_D3cold), but I think we wanted PCI_UNKNOWN (5) here based on the comment and the fact that the generic version of this code, pci_setup_device(), uses PCI_UNKNOWN.

RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx

2013-05-20 Thread Jia Hongtao-B38951
Hi Ben and Kumar, I'm really appreciate if you could help me to review this patches for these patches were pending nearly a month. Thanks. -Hongtao -Original Message- From: Jia Hongtao-B38951 Sent: Monday, May 13, 2013 2:20 PM To: 'Benjamin Herrenschmidt' Cc:

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

2013-05-20 Thread Alexey Kardashevskiy
This accelerates IOMMU operations in real and virtual mode in the host kernel for the KVM guest. The first patch with multitce support is useful for emulated devices as is. The other patches are designed for VFIO although this series does not contain any VFIO related code as the connection

[PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-20 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

[PATCH 2/4] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-05-20 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

[PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-20 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/4] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-05-20 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

[PATCH] powerpc: Fix TLB cleanup at boot on POWER8

2013-05-20 Thread Benjamin Herrenschmidt
The TLB has 512 congruence classes (2048 entries 4 way set associative) while P7 had 128 Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/kernel/cpu_setup_power.S |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH] powerpc/pci: Fix bogus message at boot about empty memory resources

2013-05-20 Thread Benjamin Herrenschmidt
The message is only meant to be displayed if resource 0 is empty, but was displayed if any is. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/kernel/pci-common.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH] powerpc/powernv: Fix condition for when to invalidate the TCE cache

2013-05-20 Thread Benjamin Herrenschmidt
We use two flags, one to indicate an invalidation is needed after creating a new entry and one to indicate an invalidation is needed after removing an entry. However we were testing the wrong flag in the remove case. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org ---

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

2013-05-20 Thread 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 patch goes first and introduces an

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

2013-05-20 Thread 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 mapping/unmapping pages for guest

[PATCH 2/3] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-20 Thread 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 for VFIO which does

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

2013-05-20 Thread Alexey Kardashevskiy
The enables VFIO on the pSeries platform, enabling user space programs to access PCI devices directly. Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru Cc: David Gibson da...@gibson.dropbear.id.au Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/platforms/pseries/iommu.c |4

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

2013-05-20 Thread Alexey Kardashevskiy
Oops, wrong subject (cut-n-paste) :) There are 3 patches, not 5. On 05/21/2013 01:33 PM, Alexey Kardashevskiy wrote: 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

[PATCH] powerpc/powernv: Add an option to wipe PCI bridges on shutdown

2013-05-20 Thread Benjamin Herrenschmidt
Older kernels such as 3.6 used by Fedora 18 have a problem with the way more recent kernels configure the PCI bridge windows due to my crappy old resource allocation code (we now use the generic code which is way better). In order to be able to safely kexec into those earlier kernels (which we

Re: [PATCH 3/3] perf, x86, lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL

2013-05-20 Thread Michael Neuling
Peter Zijlstra pet...@infradead.org wrote: On Thu, May 16, 2013 at 05:36:11PM +0200, Stephane Eranian wrote: On Thu, May 16, 2013 at 1:16 PM, Peter Zijlstra pet...@infradead.org wrote: On Thu, May 16, 2013 at 08:15:17PM +1000, Michael Neuling wrote: Peter, BTW PowerPC also has

[PATCH] PowerPC: kernel: need return the related error code when failure occurs.

2013-05-20 Thread Chen Gang
When error occurs, need return the related error code to let upper caller know about it. ppc_md.nvram_size() can return the error code (e.g. core99_nvram_size() in 'arch/powerpc/platforms/powermac/nvram.c'). And when '*ppos = size', need return -ESPIPE (Illegal seek) The original related