Re: [PATCH v1 7/8] powerpc/Kconfig: Enable STRICT_KERNEL_RWX

2017-06-02 Thread Balbir Singh
On Mon, May 29, 2017 at 6:00 PM, Christophe LEROY wrote: > > > Le 25/05/2017 à 18:45, kbuild test robot a écrit : >> >> Hi Balbir, >> >> [auto build test ERROR on powerpc/next] >> [also build test ERROR on v4.12-rc2 next-20170525] >> [if your patch is applied to the wrong

Re: [PATCH 1/2] MAINTAINERS: update entry for Freescale SoC drivers

2017-06-02 Thread Scott Wood
On Fri, 2017-06-02 at 18:20 -0500, Li Yang wrote: > Add myself as the maintainer for drivers/fsl/soc/ and fix the scope for > device tree bindings. > > Signed-off-by: Li Yang > --- >  MAINTAINERS | 5 +++-- >  1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git

[PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-02 Thread Breno Leitao
Currently tsk->thread->load_vec and load_fp are not initialized during a task creation, which set garbage to these variables (non-zero value). These variables will be checked later at restore_math() to validate if the FP and vectors are being utilized. Since these values might be non-zero, the

[PATCH 2/2] MAINTAINERS: update my email address from freescale to nxp

2017-06-02 Thread Li Yang
Signed-off-by: Li Yang --- MAINTAINERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1807d3f..5a39d4a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5285,7 +5285,7 @@ S:Maintained F:

[PATCH 1/2] MAINTAINERS: update entry for Freescale SoC drivers

2017-06-02 Thread Li Yang
Add myself as the maintainer for drivers/fsl/soc/ and fix the scope for device tree bindings. Signed-off-by: Li Yang --- MAINTAINERS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index d24240b..1807d3f 100644 ---

Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-02 Thread Anton Blanchard
Hi Breno, > Currently tsk->thread->load_vec and load_fp are not initialized > during a task creation, which set garbage to these variables > (non-zero value). Nice catch! It seems like we should zero load_tm too though? Acked-by: Anton Blanchard Anton > These variables will

[PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-02 Thread Breno Leitao
Currently tsk->thread->load_vec and load_fp are not initialized during a task creation, which set garbage to these variables (non-zero value). These variables will be checked later at restore_math() to validate if the FP and vectors are being utilized. Since these values might be non-zero, the

Re: [RESEND-PATCH] cxl: Avoid double free_irq() for psl, slice interrupts

2017-06-02 Thread Vaibhav Jain
Frederic Barrat writes: >> +irq_find_mapping(NULL, afu->native->psl_virq)) > > ^^^ > Shouldn't it be psl_hwirq? > Thanks for catching this Fred. I have sent a v2 patch fixing this. -- Vaibhav Jain

[PATCH v2] cxl: Avoid double free_irq() for psl,slice interrupts

2017-06-02 Thread Vaibhav Jain
During an eeh call to cxl_remove can result in double free_irq of psl,slice interrupts. This can happen if perst_reloads_same_image == 1 and call to cxl_configure_adapter() fails during slot_reset callback. In such a case we see a kernel oops with following back-trace: Oops: Kernel access of bad

Re: [PATCH] cxl: Fix error path on bad ioctl

2017-06-02 Thread Vaibhav Jain
Hi Fred, Good catch. Frederic Barrat writes: > Fix error path if we can't copy user structure on > CXL_IOCTL_START_WORK ioctl. > > Signed-off-by: Frederic Barrat > Cc: sta...@vger.kernel.org > --- > drivers/misc/cxl/file.c | 6 ++ >

[PATCH] cxl: Fix error path on bad ioctl

2017-06-02 Thread Frederic Barrat
Fix error path if we can't copy user structure on CXL_IOCTL_START_WORK ioctl. Signed-off-by: Frederic Barrat Cc: sta...@vger.kernel.org --- drivers/misc/cxl/file.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cxl/file.c

Re: [RESEND-PATCH] cxl: Avoid double free_irq() for psl,slice interrupts

2017-06-02 Thread Frederic Barrat
Le 02/06/2017 à 11:35, Vaibhav Jain a écrit : During an eeh call to cxl_remove can result in double free_irq of psl,slice interrupts. This can happen if perst_reloads_same_image == 1 and call to cxl_configure_adapter() fails during slot_reset callback. In such a case we see a kernel oops with

Re: 4.12-rc ppc64 4k-page needs costly allocations

2017-06-02 Thread Christoph Lameter
On Thu, 1 Jun 2017, Hugh Dickins wrote: > SLUB versus SLAB, cpu versus memory? Since someone has taken the > trouble to write it with ctors in the past, I didn't feel on firm > enough ground to recommend such a change. But it may be obvious > to someone else that your suggestion would be better

Re: 4.12-rc ppc64 4k-page needs costly allocations

2017-06-02 Thread Christoph Lameter
On Thu, 1 Jun 2017, Hugh Dickins wrote: > Thanks a lot for working that out. Makes sense, fully understood now, > nothing to worry about (though makes one wonder whether it's efficient > to use ctors on high-alignment caches; or whether an internal "zero-me" > ctor would be useful). Use kzalloc

Re: powerpc/opal-irqchip: Use interrupt names if present

2017-06-02 Thread Benjamin Herrenschmidt
On Fri, 2017-06-02 at 14:39 +0200, Geert Uytterhoeven wrote: > > > diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c > > b/arch/powerpc/platforms/powernv/opal-irqchip.c > > index 998316bf2dad..ecdcba9d1220 100644 > > --- a/arch/powerpc/platforms/powernv/opal-irqchip.c > > +++

Re: [PATCH 07/14] powerpc/64s: idle avoid SRR usage in idle sleep/wake paths

2017-06-02 Thread kbuild test robot
Hi Nicholas, [auto build test ERROR on pm/linux-next] [also build test ERROR on v4.12-rc3] [cannot apply to powerpc/next next-20170602] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Nicholas

[RFC] powerpc/hotplug: Resolve dlpar hot-add cpu deadlock

2017-06-02 Thread Michael Bringmann
A deadlock problem was detected in the hot-add CPU operation when modifying a Shared CPU Topology configuration on powerpc. We have a case where the cpu_hotplug_begin locks 'cpu_hotplug.lock' in one thread, and then a call to get_online_cpus attempts to acquire the same lock from lower in the

Re: [PATCH] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-02 Thread Nicholas Piggin
On Fri, 02 Jun 2017 19:54:32 +1000 Michael Ellerman wrote: > >> @@ -672,10 +672,19 @@ static void __init pcpu_fc_free(void *ptr, size_t > >> size) > >> > >> static int pcpu_cpu_distance(unsigned int from, unsigned int to) > >> { > >> - if (cpu_to_node(from) ==

[PATCH v3 2/6] arm64: dts: lg1313: DT fix s/#interrupts-cells/#interrupt-cells/

2017-06-02 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven Acked-by: Chanho Min --- v3: - Add Acked-by, v2: - New. --- arch/arm64/boot/dts/lg/lg1313.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/lg/lg1313.dtsi

[PATCH v3 1/6] arm64: dts: lg1312: DT fix s/#interrupts-cells/#interrupt-cells/

2017-06-02 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Acked-by: Chanho Min --- v3: - Add Acked-by, v2: - Add Acked-by, - Rebased. --- arch/arm64/boot/dts/lg/lg1312.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 4/6] powerpc: dts: acadia: DT fix s/#interrupts-parent/#interrupt-parent/

2017-06-02 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring --- v3: - No changes, v2: - Add Acked-by. --- arch/powerpc/boot/dts/acadia.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/boot/dts/acadia.dts

[PATCH v3 5/6] dt-bindings: display: amlogic: DT fix s/resets-names/reset-names/

2017-06-02 Thread Geert Uytterhoeven
Fixes: 8cceda5349377e30 ("dt-bindings: Add bindings for the Amlogic Meson dw-hdmi extension") Signed-off-by: Geert Uytterhoeven --- v3: - New. --- Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 0/6] DT: Fix spelling of standard properties

2017-06-02 Thread Geert Uytterhoeven
Hi all, This patch series fixes misspellings of various standard DT properties in DT binding documentation, DTS files, and examples. While most of these are harmless, some of them may cause hard-to-debug failures. Changes compared to v3: - Drop patches that have been applied already,

[PATCH v3 6/6] dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/

2017-06-02 Thread Geert Uytterhoeven
Fixes: fd913ef7ce619467 ("Bluetooth: btusb: Add out-of-band wakeup support") Signed-off-by: Geert Uytterhoeven --- v3: - New. --- Documentation/devicetree/bindings/net/btusb.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 3/6] dt: booting-without-of: DT fix s/#interrupt-cell/#interrupt-cells/

2017-06-02 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring --- v3: - No changes, v2: - Add Acked-by. --- Documentation/devicetree/booting-without-of.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: powerpc/opal-irqchip: Use interrupt names if present

2017-06-02 Thread Geert Uytterhoeven
Hi Ben, On Wed, Feb 22, 2017 at 8:02 PM, Linux Kernel Mailing List wrote: > Web: > https://git.kernel.org/torvalds/c/2717a33d60745f2f72e521cdaedf79b00f66f8ca > Commit: 2717a33d60745f2f72e521cdaedf79b00f66f8ca > Parent:

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 14:11, Benjamin Herrenschmidt a écrit : On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: The difference between get_user() and __get_user() is that get_user() performs an access_ok() in addition. Doesn't access_ok() only checks whether addr is below TASK_SIZE to

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Benjamin Herrenschmidt
On Fri, 2017-06-02 at 11:39 +0200, Christophe LEROY wrote: > The difference between get_user() and __get_user() is that get_user() > performs an access_ok() in addition. > > Doesn't access_ok() only checks whether addr is below TASK_SIZE to > ensure it is a valid user address ? Do you have a

RE: [PATCH] powerpc/powernv: Enable PCI peer-to-peer

2017-06-02 Thread David Laight
From: Benjamin Herrenschmidt > Sent: 31 May 2017 03:26 ... > We might also need a way to provide the "initiator" with translated DMA > addresses that allow to target the receiver. Related to that is the ability to allocate memory that two (or more) PCIe devices can DMA to/from. That can be useful

Re: [PATCH v2 1/1] tty: add TIOCGPTPEER ioctl

2017-06-02 Thread Arnd Bergmann
On Fri, Jun 2, 2017 at 10:48 AM, Aleksa Sarai wrote: > When opening the slave end of a PTY, it is not possible for userspace to > safely ensure that /dev/pts/$num is actually a slave (in cases where the > mount namespace in which devpts was mounted is controlled by an > untrusted

Re: [PATCH] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-02 Thread Michael Ellerman
Nicholas Piggin writes: > On Fri, 2 Jun 2017 15:14:47 +1000 > Michael Ellerman wrote: > >> In commit 8c272261194d ("powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID"), we >> switched to the generic implementation of cpu_to_node(), which uses a percpu >>

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Christophe LEROY
Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: Only the get_user() in store_updates_sp() has to be done outside the mm semaphore. All the comparison can be done within the semaphore, so only when really needed. As we got a DSI exception,

[RESEND-PATCH] cxl: Avoid double free_irq() for psl,slice interrupts

2017-06-02 Thread Vaibhav Jain
During an eeh call to cxl_remove can result in double free_irq of psl,slice interrupts. This can happen if perst_reloads_same_image == 1 and call to cxl_configure_adapter() fails during slot_reset callback. In such a case we see a kernel oops with following back-trace: Oops: Kernel access of bad

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-02 Thread Michael Ellerman
Christophe Leroy writes: > Only the get_user() in store_updates_sp() has to be done outside > the mm semaphore. All the comparison can be done within the semaphore, > so only when really needed. > > As we got a DSI exception, the address pointed by regs->nip is >

[PATCH] cxl: Export library to support IBM XSL

2017-06-02 Thread Christophe Lombard
From: Christophe Lombard This patch exports a in-kernel 'library' API which can be called by other drivers to help interacting with an IBM XSL on a POWER9 system. The XSL (Translation Service Layer) is a stripped down version of the PSL (Power Service Layer) used

[PATCH v2 1/1] tty: add TIOCGPTPEER ioctl

2017-06-02 Thread Aleksa Sarai
When opening the slave end of a PTY, it is not possible for userspace to safely ensure that /dev/pts/$num is actually a slave (in cases where the mount namespace in which devpts was mounted is controlled by an untrusted process). In addition, there are several unresolvable race conditions if

[PATCH v2 0/1] tty: add TIOCGPTPEER ioctl

2017-06-02 Thread Aleksa Sarai
Changes in v2: * Reordered addition to ioctls.h to follow correct hex ordering. Aleksa Sarai (1): tty: add TIOCGPTPEER ioctl arch/alpha/include/uapi/asm/ioctls.h | 1 + arch/mips/include/uapi/asm/ioctls.h| 1 + arch/parisc/include/uapi/asm/ioctls.h | 1 +

Re: [PATCH v6 0/7] perf report: Show branch type

2017-06-02 Thread Jin, Yao
Hi maintainers, Is this patch series (v6) OK for merging? Thanks Jin Yao On 4/20/2017 5:36 PM, Jiri Olsa wrote: On Thu, Apr 20, 2017 at 08:07:48PM +0800, Jin Yao wrote: v6: Update according to the review comments from Jiri Olsa . Major modifications are: 1.

[PATCH 14/14] powerpc/64: context switch additional hwsync can be avoided

2017-06-02 Thread Nicholas Piggin
The hwsync in the context switch code to prevent MMIO access being reordered from the point of view of a single process if it gets migrated to a different CPU is not required because there is an hwsync performed earlier in the context switch path. Comment this so it's clear enough if anything

[PATCH 13/14] powerpc/64: context switch can avoid reservation clear

2017-06-02 Thread Nicholas Piggin
There is no need to break reservation in _switch, because we are guranteed that context switch path will include a larx/stcx. Comment the guarantee and remove the reservation clear from _switch. This is worth 1-2% in context switch performance. Signed-off-by: Nicholas Piggin

[PATCH 12/14] powerpc/64s: Leave IRQs hard enabled over context switch for radix

2017-06-02 Thread Nicholas Piggin
Commit 4387e9ff25 ("[POWERPC] Fix PMU + soft interrupt disable bug") hard disabled interrupts over the low level context switch, because the SLB management can't cope with a PMU interrupt accesing the stack in that window. Radix based kernel mapping does not use the SLB so it does not require

[PATCH 11/14] powerpc/64s: idle no memory barrier after break from idle

2017-06-02 Thread Nicholas Piggin
A memory barrier is not required after the task wakes up, only if we clear the polling flag before waking. The case where we have work to do is the important one, so optimise for it. Signed-off-by: Nicholas Piggin --- drivers/cpuidle/cpuidle-powernv.c | 11 +--

[PATCH 10/14] powerpc/64: CTRL[RUN] run-latch setting optimisation

2017-06-02 Thread Nicholas Piggin
The CTRL register is read-only except bit 63 which is the run latch control. This means it can be updated with a mtspr rather than mfspr/mtspr. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-)

[PATCH 09/14] powerpc/64s: idle read mostly for common globals

2017-06-02 Thread Nicholas Piggin
Ensure these don't get put into bouncing cachelines. Signed-off-by: Nicholas Piggin --- drivers/cpuidle/cpuidle-powernv.c | 10 +- drivers/cpuidle/cpuidle-pseries.c | 8 2 files changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 08/14] powerpc/64s: idle set polling before enabling irqs

2017-06-02 Thread Nicholas Piggin
local_irq_enable can cause interrupts to be taken which could take significant amount of processing time. The idle process should set its polling flag before this, so another process that wakes it during this time will not have to send an IPI. Expand the TIF_POLLING_NRFLAG coverage to as large as

[PATCH 07/14] powerpc/64s: idle avoid SRR usage in idle sleep/wake paths

2017-06-02 Thread Nicholas Piggin
Idle code now always runs at the 0xc... effective address whether in real or virtual mode. This means rfid can be ditched, along with a lot of SRR manipulations. In the wakeup path, carry SRR1 around in r12. Use mtmsrd to change MSR states as required. I haven't tested KVM with this yet. ---

[PATCH 06/14] powerpc/64s: branch to idle handler with virtual mode offset

2017-06-02 Thread Nicholas Piggin
Have the system reset idle wakeup handlers branched to in real mode with the 0xc... kernel address applied. This allows simplifications of avoiding rfid when switching to virtual mode in the wakeup handler. Signed-off-by: Nicholas Piggin ---

[PATCH 05/14] powerpc/64s: msgclr when handling doorbell exceptions

2017-06-02 Thread Nicholas Piggin
msgsnd doorbell exceptions are cleared when the doorbell interrupt is taken. However if a doorbell exception causes a system reset interrupt wake from power saving state, the message is not cleared. Processing the doorbell from the system reset interrupt requires msgclr to avoid taking the

[PATCH 04/14] powerpc/64s: process interrupts from system reset wakeup

2017-06-02 Thread Nicholas Piggin
When the CPU wakes from low power state, it begins at the system reset interrupt with the exception that caused the wakeup encoded in SRR1. Today, powernv idle wakeup ignores the wakeup reason (except a special case for HMI), and the regular interrupt corresponding to the exception will fire

[PATCH 03/14] powerpc/64s: idle move soft interrupt mask logic into C code

2017-06-02 Thread Nicholas Piggin
This simplifies the asm and fixes irq-off tracing over sleep instructions. Also move powersave_nap check for POWER8 into C code, and move PSSCR register value calculation for POWER9 into C. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/machdep.h | 1 +

[PATCH 02/14] powerpc/64: syscall avoid restore_math call if possible

2017-06-02 Thread Nicholas Piggin
The syscall exit code that branches to restore_math is quite heavyweight on Book3S, consisting of 2 mtmsr instructions. This case can happen even if restore_math decides there is nothing to do due to lazy math restore. Check for lazy restore before calling restore_math. Move most of that case out

[PATCH 01/14] powerpc/64s: optimize hypercall/syscall

2017-06-02 Thread Nicholas Piggin
After bc3551257a ("powerpc/64: Allow for relocation-on interrupts from guest to host"), a getppid() system call goes from 307 cycles to 358 cycles (+17%). This is due significantly to the scratch SPR used by the hypercall. It turns out there are a some volatile registers common to both system

[RFC][PATCH 00/14] syscall, context switch, idle performance stuff

2017-06-02 Thread Nicholas Piggin
Hi, I'm sitting on a few performance improvements that I'm hoping to try get polished up enough to merge, but it's taking a while, so I juts post them out for review because I think most are at the stage where they are good enough to start getting some reviews on. After this series, light weight

[RESEND PATCH v2] powerpc/fadump: set an upper limit for boot memory size

2017-06-02 Thread Hari Bathini
By default, 5% of system RAM is reserved for preserving boot memory. Alternatively, a user can specify the amount of memory to reserve. See Documentation/powerpc/firmware-assisted-dump.txt for details. In addition to the memory reserved for preserving boot memory, some more memory is reserved, to