Re: [PATCH] powerpc: asm: convert directive .llong to .8byte

2017-03-09 Thread Michael Ellerman
Daniel Axtens writes: > Hi Tobin, > >> .llong is an undocumented PPC specific directive. The generic >> equivalent is .quad, but even better (because it's self describing) is >> .8byte. >> >> Convert directives .llong -> .8byte >> >> Signed-off-by: Tobin C. Harding >> --- >> >> Fixes: issue #33

Re: [PATCH kernel v8 00/10] powerpc/kvm/vfio: Enable in-kernel acceleration

2017-03-09 Thread David Gibson
On Fri, Mar 10, 2017 at 02:53:27PM +1100, Alexey Kardashevskiy wrote: > This is my current queue of patches to add acceleration of TCE > updates in KVM. > > This is based on Linus'es tree sha1 c1aa905a304e. I think we're finally there - I've now sent an R-b for all patches. > > Please comment.

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

2017-03-09 Thread David Gibson
On Fri, Mar 10, 2017 at 02:53:37PM +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 space and bac

[PATCH kernel v8 01/10] powerpc/mmu: Add real mode support for IOMMU preregistered memory

2017-03-09 Thread Alexey Kardashevskiy
This makes mm_iommu_lookup() able to work in realmode by replacing list_for_each_entry_rcu() (which can do debug stuff which can fail in real mode) with list_for_each_entry_lockless(). This adds realmode version of mm_iommu_ua_to_hpa() which adds explicit vmalloc'd-to-linear address conversion. Un

[PATCH kernel v8 00/10] powerpc/kvm/vfio: Enable in-kernel acceleration

2017-03-09 Thread Alexey Kardashevskiy
This is my current queue of patches to add acceleration of TCE updates in KVM. This is based on Linus'es tree sha1 c1aa905a304e. Please comment. Thanks. Changes: v8: * kept fixing oddities with error handling in 10/10 v7: * added realmode's WARN_ON_ONCE_RM in arch/powerpc/kvm/book3s_64_vio_hv.c

[PATCH kernel v8 10/10] KVM: PPC: VFIO: Add in-kernel acceleration for VFIO

2017-03-09 Thread Alexey Kardashevskiy
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 space and back. This adds H_PUT_TCE/H_PUT_TCE_INDIRECT/H_STUFF_TCE handlers to KVM. KVM tr

[PATCH kernel v8 09/10] KVM: PPC: iommu: Unify TCE checking

2017-03-09 Thread Alexey Kardashevskiy
This reworks helpers for checking TCE update parameters in way they can be used in KVM. This should cause no behavioral change. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v6: * s/tce/gpa/ as TCE without permission bits is a GPA and this is what is passed everywhe

[PATCH kernel v8 08/10] KVM: PPC: Use preregistered memory API to access TCE list

2017-03-09 Thread Alexey Kardashevskiy
VFIO on sPAPR already implements guest memory pre-registration when the entire guest RAM gets pinned. This can be used to translate the physical address of a guest page containing the TCE list from H_PUT_TCE_INDIRECT. This makes use of the pre-registrered memory API to access TCE list pages in ord

[PATCH kernel v8 07/10] KVM: PPC: Pass kvm* to kvmppc_find_table()

2017-03-09 Thread Alexey Kardashevskiy
The guest view TCE tables are per KVM anyway (not per VCPU) so pass kvm* there. This will be used in the following patches where we will be attaching VFIO containers to LIOBNs via ioctl() to KVM (rather than to VCPU). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- arch/powerp

[PATCH kernel v8 06/10] KVM: PPC: Enable IOMMU_API for KVM_BOOK3S_64 permanently

2017-03-09 Thread Alexey Kardashevskiy
It does not make much sense to have KVM in book3s-64 and not to have IOMMU bits for PCI pass through support as it costs little and allows VFIO to function on book3s KVM. Having IOMMU_API always enabled makes it unnecessary to have a lot of "#ifdef IOMMU_API" in arch/powerpc/kvm/book3s_64_vio*. Wi

[PATCH kernel v8 05/10] KVM: PPC: Reserve KVM_CAP_SPAPR_TCE_VFIO capability number

2017-03-09 Thread Alexey Kardashevskiy
This adds a capability number for in-kernel support for VFIO on SPAPR platform. The capability will tell the user space whether in-kernel handlers of H_PUT_TCE can handle VFIO-targeted requests or not. If not, the user space must not attempt allocating a TCE table in the host kernel via the KVM_CR

[PATCH kernel v8 04/10] powerpc/vfio_spapr_tce: Add reference counting to iommu_table

2017-03-09 Thread Alexey Kardashevskiy
So far iommu_table obejcts were only used in virtual mode and had a single owner. We are going to change this by implementing in-kernel acceleration of DMA mapping requests. The proposed acceleration will handle requests in real mode and KVM will keep references to tables. This adds a kref to iomm

[PATCH kernel v8 02/10] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()

2017-03-09 Thread Alexey Kardashevskiy
In real mode, TCE tables are invalidated using special cache-inhibited store instructions which are not available in virtual mode This defines and implements exchange_rm() callback. This does not define set_rm/clear_rm/flush_rm callbacks as there is no user for those - exchange/exchange_rm are onl

[PATCH kernel v8 03/10] powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal

2017-03-09 Thread Alexey Kardashevskiy
At the moment iommu_table can be disposed by either calling iommu_table_free() directly or it_ops::free(); the only implementation of free() is in IODA2 - pnv_ioda2_table_free() - and it calls iommu_table_free() anyway. As we are going to have reference counting on tables, we need an unified way o

[PATCH] powerpc: Fix crash introduced with commit 5657933dbb6e

2017-03-09 Thread Larry Finger
Code inserted during the code merged between kernels 4.10 and 4.11-rc1 caused an early panic quickly followed by a complete shutdown for PowerPC. The traceback was not displayed long enough to read or photograph, thus it is not reproduced here. The problem was bisected to commit 5657933dbb6e ("tre

Re: [PATCH] powerpc: fix sparse warning, include kernel header

2017-03-09 Thread Daniel Axtens
Hi Tobin, I have built the kernel with the ppc6xx_defconfig with and without your patch. Using my smart-sparse-diff tool[1], I have confirmed the warning disappears: -/scratch/dja/linux/arch/powerpc/kernel/swsusp.c:17:6: warning: symbol 'save_processor_state' was not declared. Should it be stat

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

2017-03-09 Thread David Gibson
On Thu, Mar 09, 2017 at 10:55:48PM +1100, Alexey Kardashevskiy wrote: > On 09/03/17 17:47, David Gibson wrote: > > On Wed, Mar 08, 2017 at 02:00:11PM +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

Re: [PATCH] powerpc: asm: convert directive .llong to .8byte

2017-03-09 Thread Daniel Axtens
Hi Tobin, > .llong is an undocumented PPC specific directive. The generic > equivalent is .quad, but even better (because it's self describing) is > .8byte. > > Convert directives .llong -> .8byte > > Signed-off-by: Tobin C. Harding > --- > > Fixes: issue #33 (github) Thanks for tackling these!

Re: kernel versions

2017-03-09 Thread Daniel Axtens
Hi Tobin, > Recently the kernel version on the github > repository did not match up with the master branch of > > https://kernel.googlesource.com/pub/scm/linux/kernel/git/powerpc/linux > > Specifically, github was hosting v4.10-rc5 while master had > v4.10-rc8. All the while Linus' mainline was at

[PATCH 04/19] powerpc: mpc52xx_gpt: make use of raw_spinlock variants

2017-03-09 Thread Julia Cartwright
The mpc52xx_gpt code currently implements an irq_chip for handling interrupts; due to how irq_chip handling is done, it's necessary for the irq_chip methods to be invoked from hardirq context, even on a a real-time kernel. Because the spinlock_t type becomes a "sleeping" spinlock w/ RT kernels, it

Re: [FIX PATCH v1] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-09 Thread Tyrel Datwyler
On 03/08/2017 08:37 PM, Bharata B Rao wrote: > The following warning is seen when a CPU is hot unplugged on a PowerKVM > guest: Is this the case with cpus present at boot? What about cpus hotplugged after boot? My suspicion is that the refcount was wrong to begin with. See my comments below. The

[PATCH 2/2] powerpc/fadump: update fadump documentation

2017-03-09 Thread Hari Bathini
With the unnecessary restriction to reserve memory for fadump at the top of RAM forgone, update the documentation accordingly. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt | 34 +++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff -

[PATCH 1/2] powerpc/fadump: reserve memory at halfway mark

2017-03-09 Thread Hari Bathini
Currently, the area to preserve boot memory is reserved at the top of RAM. This leaves fadump vulnerable to DLPAR memory remove operations. As memory for fadump needs to be reserved early in the boot process, fadump can't be registered after a DLPAR memory remove operation. While this problem can't

[net-next v2 07/10] dpaa_eth: do not ignore port api return value

2017-03-09 Thread Madalin Bucur
Reported-by: Dan Carpenter Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 65 +- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_

[net-next v2 10/10] dpaa_eth: enable context-A stashing

2017-03-09 Thread Madalin Bucur
Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 1b3ea38..aa769cb 100644 --- a/drivers/net/et

[net-next v2 09/10] dpaa_eth: enable multiple Tx traffic classes

2017-03-09 Thread Madalin Bucur
From: Camelia Groza Implement the setup_tc ndo to configure prioritised Tx traffic classes. Priorities range from 0 (lowest) to 3 (highest). The driver assigns NR_CPUS queues to each traffic class. Signed-off-by: Camelia Groza Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dp

[net-next v2 08/10] dpaa_eth: add four prioritised Tx traffic classes

2017-03-09 Thread Madalin Bucur
From: Camelia Groza Each traffic class corresponds to a WQ priority level. The number of Tx netdev queues and frame queues is increased to NR_CPUS queues for each traffic class. In addition, the priority of the Rx, Error and Conf queues is lowered but their order is maintained. By default, only

[net-next v2 01/10] fsl/fman: parse result data is big endian

2017-03-09 Thread Madalin Bucur
Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/fman/fman.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman.h b/drivers/net/ethernet/freescale/fman/fman.h index 57aae8d..f53e147 100644 --- a/drivers/net/ether

[net-next v2 06/10] dpaa_eth: enable Rx checksum offload

2017-03-09 Thread Madalin Bucur
Use the FMan HW parser L4CV flag to offload Rx checksumming. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 29 -- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/n

[net-next v2 05/10] dpaa_eth: remove redundant initialization

2017-03-09 Thread Madalin Bucur
Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index e2ca107..e19181f 100644 --- a/drivers/net/ethe

[net-next v2 04/10] fsl/fman: enlarge FIFO to allow for the 5th port

2017-03-09 Thread Madalin Bucur
Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/fman/fman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index d755930..4aefe24 100644 --- a/drivers/net/ethernet/freesca

[net-next v2 03/10] fsl/fman: remove wrong free

2017-03-09 Thread Madalin Bucur
Reported-by: Dan Carpenter Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/fman/fman_port.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index f314348..57

[net-next v2 02/10] fsl/fman: set HW parser as BMI next engine

2017-03-09 Thread Madalin Bucur
Enable the HW parser for all DPAA interfaces. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/fman/fman.c | 21 drivers/net/ethernet/freescale/fman/fman_port.c | 72 +++-- 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/drivers/ne

[net-next v2 00/10] QorIQ DPAA 1 updates

2017-03-09 Thread Madalin Bucur
This patch set introduces a series of fixes and features to the DPAA 1 drivers. Besides activating hardware Rx checksum offloading, four traffic classes are added for Tx traffic prioritisation. The changes are also available on the dpaa_eth-next branch in the git repository at: git://git.freesc

Re: [RFC 2/2] hwmon: powernv: Hwmon driver for OCC inband power and temperature sensors

2017-03-09 Thread Shilpasri G Bhat
Hi Guenter, On 03/09/2017 05:40 PM, Guenter Roeck wrote: > On Thu, Mar 09, 2017 at 05:19:15PM +0530, Shilpasri G Bhat wrote: >> Add support to read power and temperature sensors from OCC inband >> sensors which are copied to main memory by OCC. >> > > Is this supposed to be an alternative to the

Re: [RFC 2/2] hwmon: powernv: Hwmon driver for OCC inband power and temperature sensors

2017-03-09 Thread Guenter Roeck
On Thu, Mar 09, 2017 at 05:19:15PM +0530, Shilpasri G Bhat wrote: > Add support to read power and temperature sensors from OCC inband > sensors which are copied to main memory by OCC. > Is this supposed to be an alternative to the submission from Eddie James ? If so, is there a reason to consider

Re: 4.11.0-rc1 boot resulted in WARNING: CPU: 14 PID: 1722 at fs/sysfs/dir.c:31 .sysfs_warn_dup+0x78/0xb0

2017-03-09 Thread Brian Foster
cc linux-block On Thu, Mar 09, 2017 at 04:20:06PM +0530, Abdul Haleem wrote: > On Wed, 2017-03-08 at 08:17 -0500, Brian Foster wrote: > > On Tue, Mar 07, 2017 at 10:01:04PM +0530, Abdul Haleem wrote: > > > > > > Hi, > > > > > > Today's mainline (4.11.0-rc1) booted with warnings on Power7 LPAR. >

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

2017-03-09 Thread Alexey Kardashevskiy
On 09/03/17 17:47, David Gibson wrote: > On Wed, Mar 08, 2017 at 02:00:11PM +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 sav

[RFC 2/2] hwmon: powernv: Hwmon driver for OCC inband power and temperature sensors

2017-03-09 Thread Shilpasri G Bhat
Add support to read power and temperature sensors from OCC inband sensors which are copied to main memory by OCC. Signed-off-by: Shilpasri G Bhat CC: Rob Herring CC: Mark Rutland CC: Jean Delvare CC: Guenter Roeck CC: Jonathan Corbet CC: devicet...@vger.kernel.org CC: linux-hw...@vger.kernel

[RFC 0/2] Add support for OCC inband sensors in P9

2017-03-09 Thread Shilpasri G Bhat
On-Chip-Controller(OCC) is an embedded chip in POWER processors which maintains the thermal and power safety of the chip. OCC measures power and temperature sensors and various performance counters to maintain healthy activity of the chip. In POWER9, OCC copies these measured sensors periodically t

[RFC 1/2] powerpc/powernv: Enable support for OCC inband platform sensors

2017-03-09 Thread Shilpasri G Bhat
In P9, OCC writes the platform sensors to main memory. This patch provides support to read the sensors from main memory. OCC writes three buffers which includes one names buffer for sensor meta data and two buffers for sensor readings. The sensor names buffers is written once and contains informat

Re: [FIX PATCH v1] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-09 Thread Michael Ellerman
Bharata B Rao writes: > The following warning is seen when a CPU is hot unplugged on a PowerKVM > guest: > > refcount_t: underflow; use-after-free. ... > > Fix this by ensuring that of_node_put() is called only from the > error path in dlpar_cpu_remove_by_index(). In the normal path, > of_node_pu

Re: 4.11.0-rc1 boot resulted in WARNING: CPU: 14 PID: 1722 at fs/sysfs/dir.c:31 .sysfs_warn_dup+0x78/0xb0

2017-03-09 Thread Abdul Haleem
On Wed, 2017-03-08 at 08:17 -0500, Brian Foster wrote: > On Tue, Mar 07, 2017 at 10:01:04PM +0530, Abdul Haleem wrote: > > > > Hi, > > > > Today's mainline (4.11.0-rc1) booted with warnings on Power7 LPAR. > > > > Issue is not reproducible all the time. > > > > traces: > > > > Found de

[libhugetlbfs] linkhuge_rw fails with gcc 6.2.0 on 4.11.0-rc1 ppc64le

2017-03-09 Thread Abdul Haleem
Hi, linkhuge_rw test case fails on 4.11.0-rc1 kernel. # HUGETLB_VERBOSE=99 HUGETLB_DEBUG=yes HUGETLB_SHARE=0 LD_LIBRARY_PATH=./obj64 HUGETLB_ELFMAP=R ./tests/obj64/linkhuge_rw libhugetlbfs [pkvmhab012:8026]: INFO: Found pagesize 16384 kB libhugetlbfs [pkvmhab012:8026]: INFO: Detected page sizes

[PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

2017-03-09 Thread Christophe Leroy
Help a bit the compiler to provide better code: unsigned int f(int i) { return 1 << (31 - i); } unsigned int g(int i) { return 0x8000 >> i; } Disassembly of section .text: : 0: 20 63 00 1f subfic r3,r3,31 4: 39 20 00 01 li r9,1 8: 7d 23

[PATCH] powerpc/8xx: Adding support of IRQ in MPC8xx GPIO

2017-03-09 Thread Christophe Leroy
This patch allows the use of IRQ to notify the change of GPIO status on MPC8xx CPM IO ports. This then allows to associate IRQs to GPIOs in the Device Tree. Ex: CPM1_PIO_C: gpio-controller@960 { #gpio-cells = <2>; compatible = "fsl,cpm1-pario-bank-c";

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

2017-03-09 Thread David Gibson
On Wed, Mar 08, 2017 at 02:00:11PM +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 space and bac

Re: [PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-09 Thread Naveen N. Rao
On 2017/03/09 05:37PM, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > On 2017/03/08 11:29AM, Arnaldo Carvalho de Melo wrote: > >> > I wasn't sure if you were planning on picking up KPROBES_ON_FTRACE for > >> > v4.11. If so, it would be good to take this patch through the powerpc > >> > tr