[PATCH V2 4/5] powerpc: Move flush_all_to_thread() below save_sprs()

2016-04-04 Thread Cyril Bur
Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 56444a6..7625976 100644 --- a/arch/powerpc/kernel/process.c

[PATCH V2 5/5] powerpc: Preserve the SPR values across fork() syscalls

2016-04-04 Thread Cyril Bur
Currently copy_thread() doesn't flush SPRs to the parent thread struct. Currently this only affects the TAR register as perf takes care of some of the others and the remaining ones are all Event Based Branch (EBB) registers which are cleared across fork(). Signed-off-by: Cyril Bur ---

[PATCH V2 2/5] selftests/powerpc: Add fork() test to check for spr being preserved

2016-04-04 Thread Cyril Bur
Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/syscalls/Makefile | 3 +- .../testing/selftests/powerpc/syscalls/spr_fork.c | 78 ++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/powerpc/syscalls/spr_fork.c diff

[PATCH V2 3/5] powerpc: Fix SPR leak across exec() syscalls

2016-04-04 Thread Cyril Bur
the parent thread to sanitise what it deems necessary. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index d7a9df5..56444a6 100644 --- a/arch/powe

Re: [PATCH] powerpc: Add support for userspace P9 copy paste

2016-04-25 Thread Cyril Bur
; > NOTE: this is for userspace only, not in kernel, and does not deal > with KVM guests. > > Patch created with much assistance from Michael Neuling > > Hi Chris, Patch looks good. Looks like you've put 8 spaces (instead of a tab) on the PPC_CP_ABORT line. Apart from t

[PATCH] powerpc: Fix checkstop in native_hpte_clear() with lockdep

2015-09-30 Thread Cyril Bur
taking locks is unsafe therefore the best course of action is to simply do nothing. Concurrent tlbie()s are not possible in the first case as secondary CPUs have not come up yet. Signed-off-by: Cyril Bur --- arch/powerpc/mm/hash_native_64.c | 23 +++ 1 file changed, 11

[PATCH v2] powerpc: Fix checkstop in native_hpte_clear() with lockdep

2015-10-07 Thread Cyril Bur
taking locks is unsafe therefore the best course of action is to simply do nothing. Concurrent tlbie()s are not possible in the first case as secondary CPUs have not come up yet. Signed-off-by: Cyril Bur --- Tested on POWER8 system by applying this patch to the petitboot kernel, kexecing into Linus

[PATCH 0/8] FP/VEC/VSX switching optimisations

2015-11-17 Thread Cyril Bur
ance when touching all three only 5%. There is a compounding effect in so far as the cost of taking multiple unavailable exception is removed. This testing also demonstrates that the cost of the exception is by far the most expensive part of the current lazy approach. Cyril Bur (8): selftests

[PATCH 2/8] selftests/powerpc: Test preservation of FPU and VMX regs across preemption

2015-11-17 Thread Cyril Bur
Loop in assembly checking the registers with many threads. Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/Makefile | 7 +- tools/testing/selftests/powerpc/math/fpu_asm.S | 34 tools/testing/selftests/powerpc/math/fpu_preempt.c | 92

[PATCH 4/8] powerpc: Explicitly disable math features when copying thread

2015-11-17 Thread Cyril Bur
With threads leaving the math bits enabled in their saved MSR to indicate that the hardware is hot and a restore is not needed, children need to turn it off as when they do get scheduled, there's no way their registers could have been hot. Signed-off-by: Cyril Bur --- arch/powerpc/k

[PATCH 6/8] powerpc: Add the ability to save FPU without giving it up

2015-11-17 Thread Cyril Bur
userspace with hot registers avoiding a possibly pointless reload of FPU register state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 2 +- arch/powerpc/kernel/fpu.S| 21 arch/powerpc/kernel/process.c| 46

[PATCH 5/8] powerpc: Restore FPU/VEC/VSX if previously used

2015-11-17 Thread Cyril Bur
counter is used to detect if the registers have been used in the past and the registers are always loaded until the value wraps to back to zero. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/processor.h | 2 ++ arch/powerpc/kernel/asm-offsets.c| 2 ++ arch/powerpc/kernel/entry_64.S

[PATCH 7/8] powerpc: Add the ability to save Altivec without giving it up

2015-11-17 Thread Cyril Bur
reload of VEC state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 2 +- arch/powerpc/kernel/process.c| 12 +++- arch/powerpc/kernel/vector.S | 24 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/arch/powerpc

[PATCH 8/8] powerpc: Add the ability to save VSX without giving it up

2015-11-17 Thread Cyril Bur
pointless reload of VSX state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 1 - arch/powerpc/kernel/ppc_ksyms.c | 4 arch/powerpc/kernel/process.c| 23 ++- arch/powerpc/kernel/vector.S | 17 - 4 files changed, 18

[PATCH 1/8] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2015-11-17 Thread Cyril Bur
Test that the non volatile floating point and Altivec registers get correctly preserved across the fork() syscall. fork() works nicely for this purpose, the registers should be the same for both parent and child Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/Makefile

[PATCH 3/8] selftests/powerpc: Test FPU and VMX regs in signal ucontext

2015-11-17 Thread Cyril Bur
Load up the non volatile FPU and VMX regs and ensure that they are the expected value in a signal handler Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/Makefile | 4 +- tools/testing/selftests/powerpc/math/fpu_signal.c | 119 + tools/testing

Re: [PATCH 0/8] FP/VEC/VSX switching optimisations

2015-11-18 Thread Cyril Bur
On Wed, 18 Nov 2015 14:51:25 + David Laight wrote: > From: Cyril Bur > > Sent: 18 November 2015 03:27 > ... > > The goal of these patches is to rework how the 'math' registers (FP, VEC > > and VSX) are context switched. Currently the kernel adopts a l

Re: [PATCH 5/8] powerpc: Restore FPU/VEC/VSX if previously used

2015-11-22 Thread Cyril Bur
On Fri, 20 Nov 2015 22:01:04 +1100 Michael Ellerman wrote: > On Wed, 2015-11-18 at 14:26 +1100, Cyril Bur wrote: > > diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S > > index c8b4225..46e9869 100644 > > --- a/arch/powerpc/kernel/entry_64.S &

Re: [PATCH 1/8] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2015-11-22 Thread Cyril Bur
On Mon, 23 Nov 2015 11:23:13 +1100 Michael Neuling wrote: > On Wed, 2015-11-18 at 14:26 +1100, Cyril Bur wrote: > > Test that the non volatile floating point and Altivec registers get > > correctly preserved across the fork() syscall. > > Can we add a test for VSX too

Re: [PATCH 4/8] powerpc: Explicitly disable math features when copying thread

2015-11-22 Thread Cyril Bur
On Mon, 23 Nov 2015 12:08:38 +1100 Michael Neuling wrote: > On Wed, 2015-11-18 at 14:26 +1100, Cyril Bur wrote: > > With threads leaving the math bits enabled in their saved MSR to > > indicate > > that the hardware is hot and a restore is not needed, children need > >

[PATCH V2 0/8] FP/VEC/VSX switching optimisations

2016-01-14 Thread Cyril Bur
such as adding .gitignore and forcing 64 bit compiles of the tests as they use 64 bit only instructions. Cyril Bur (8): selftests/powerpc: Test the preservation of FPU and VMX regs across syscall selftests/powerpc: Test preservation of FPU and VMX regs across preemption selftests/powe

[PATCH V2 4/8] powerpc: Explicitly disable math features when copying thread

2016-01-14 Thread Cyril Bur
With threads leaving the math bits enabled in their saved MSR to indicate that the hardware is hot and a restore is not needed, children need to turn it off as when they do get scheduled, there's no way their registers could have been hot. Signed-off-by: Cyril Bur --- arch/powerpc/k

[PATCH V2 2/8] selftests/powerpc: Test preservation of FPU and VMX regs across preemption

2016-01-14 Thread Cyril Bur
Loop in assembly checking the registers with many threads. Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore| 2 + tools/testing/selftests/powerpc/math/Makefile | 5 +- tools/testing/selftests/powerpc/math/fpu_asm.S | 34 +++ tools/testing

[PATCH V2 3/8] selftests/powerpc: Test FPU and VMX regs in signal ucontext

2016-01-14 Thread Cyril Bur
Load up the non volatile FPU and VMX regs and ensure that they are the expected value in a signal handler Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore | 2 + tools/testing/selftests/powerpc/math/Makefile | 4 +- tools/testing/selftests/powerpc/math

[PATCH V2 1/8] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-01-14 Thread Cyril Bur
Test that the non volatile floating point and Altivec registers get correctly preserved across the fork() syscall. fork() works nicely for this purpose, the registers should be the same for both parent and child Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/Makefile

[PATCH V2 8/8] powerpc: Add the ability to save VSX without giving it up

2016-01-14 Thread Cyril Bur
pointless reload of VSX state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 1 - arch/powerpc/kernel/ppc_ksyms.c | 4 arch/powerpc/kernel/process.c| 23 ++- arch/powerpc/kernel/vector.S | 17 - 4 files changed, 18

[PATCH V2 7/8] powerpc: Add the ability to save Altivec without giving it up

2016-01-14 Thread Cyril Bur
reload of VEC state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 2 +- arch/powerpc/kernel/process.c| 12 +++- arch/powerpc/kernel/vector.S | 24 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/arch/powerpc

[PATCH V2 5/8] powerpc: Restore FPU/VEC/VSX if previously used

2016-01-14 Thread Cyril Bur
benchmarking it was determined that avoiding C in the common case is a performance benefit. The full check in asm greatly complicated that codepath for a negligible performance gain and the trade-off was deemed not worth it. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/processor.h | 2

[PATCH V2 6/8] powerpc: Add the ability to save FPU without giving it up

2016-01-14 Thread Cyril Bur
userspace with hot registers avoiding a possibly pointless reload of FPU register state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 2 +- arch/powerpc/kernel/fpu.S| 21 arch/powerpc/kernel/process.c| 46

Re: [PATCH V2 4/8] powerpc: Explicitly disable math features when copying thread

2016-01-14 Thread Cyril Bur
On Fri, 15 Jan 2016 16:42:22 +1100 Michael Neuling wrote: > On Fri, 2016-01-15 at 16:04 +1100, Cyril Bur wrote: > > With threads leaving the math bits enabled in their saved MSR to indicate > > that the hardware is hot and a restore is not needed, children need to turn > > i

Re: [PATCH V2 5/8] powerpc: Restore FPU/VEC/VSX if previously used

2016-01-17 Thread Cyril Bur
regs); > > + > > #endif /* CONFIG_PPC_BOOK3S_64 */ > > > return last; > > diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S > > index 162d0f7..038cff8 100644 > > --- a/arch/powerpc/ke

Re: [PATCH V2 8/8] powerpc: Add the ability to save VSX without giving it up

2016-01-17 Thread Cyril Bur
On Fri, 15 Jan 2016 17:25:26 +1100 Michael Neuling wrote: > On Fri, 2016-01-15 at 16:04 +1100, Cyril Bur wrote: > > This patch adds the ability to be able to save the VSX registers to > > the > > thread struct without giving up (disabling the facility) next time > >

[PATCH v3 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-01-20 Thread Cyril Bur
Test that the non volatile floating point and Altivec registers get correctly preserved across the fork() syscall. fork() works nicely for this purpose, the registers should be the same for both parent and child Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/Makefile

[PATCH v3 4/9] powerpc: Explicitly disable math features when copying thread

2016-01-20 Thread Cyril Bur
hot while not having MSR_{FP,VEC,VSX} means that the registers must be loaded. This allows for a smarter return to userspace. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel

[PATCH v3 5/9] powerpc: Restore FPU/VEC/VSX if previously used

2016-01-20 Thread Cyril Bur
benchmarking it was determined that avoiding C in the common case is a performance benefit. The full check in asm greatly complicated that codepath for a negligible performance gain and the trade-off was deemed not worth it. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/processor.h | 2

[PATCH v3 9/9] powerpc: Add the ability to save VSX without giving it up

2016-01-20 Thread Cyril Bur
pointless reload of VSX state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 4 arch/powerpc/kernel/process.c| 42 +--- arch/powerpc/kernel/vector.S | 17 --- 4 files

[PATCH v3 8/9] powerpc: Add the ability to save Altivec without giving it up

2016-01-20 Thread Cyril Bur
reload of VEC state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 3 ++- arch/powerpc/kernel/process.c| 12 +++- arch/powerpc/kernel/vector.S | 24 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/arch/powerpc

[PATCH v3 7/9] powerpc: Add the ability to save FPU without giving it up

2016-01-20 Thread Cyril Bur
userspace with hot registers avoiding a possibly pointless reload of FPU register state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 3 ++- arch/powerpc/kernel/fpu.S| 21 - arch/powerpc/kernel/process.c| 12 +++- 3 files changed

[PATCH v3 6/9] powerpc: Prepare for splitting giveup_{fpu, altivec, vsx} in two

2016-01-20 Thread Cyril Bur
saving of registers to thread structs and leave threads MSR with bits enabled. This patch introduces no functional change. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 7 +++ arch/powerpc/kernel/process.c| 39 +++- 2 files changed

[PATCH v3 3/9] selftests/powerpc: Test FPU and VMX regs in signal ucontext

2016-01-20 Thread Cyril Bur
Load up the non volatile FPU and VMX regs and ensure that they are the expected value in a signal handler Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore | 2 + tools/testing/selftests/powerpc/math/Makefile | 4 +- tools/testing/selftests/powerpc/math

[PATCH v3 0/9] FP/VEC/VSX switching optimisations

2016-01-20 Thread Cyril Bur
commit message in 4/9 better reflect the patch - Removed overuse of #ifdef blocks and redundant condition in 5/9 - Split 6/8 in two to better prepare for 7,8,9 - Removed #ifdefs in 6/9 Cyril Bur (9): selftests/powerpc: Test the preservation of FPU and VMX regs across syscall selftests

[PATCH v3 2/9] selftests/powerpc: Test preservation of FPU and VMX regs across preemption

2016-01-20 Thread Cyril Bur
Loop in assembly checking the registers with many threads. Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore| 2 + tools/testing/selftests/powerpc/math/Makefile | 5 +- tools/testing/selftests/powerpc/math/fpu_asm.S | 34 +++ tools/testing

Re: [PATCH v3 4/9] powerpc: Explicitly disable math features when copying thread

2016-01-26 Thread Cyril Bur
On Mon, 25 Jan 2016 11:04:23 +1100 Balbir Singh wrote: > On Thu, 21 Jan 2016 11:55:44 +1100 > Cyril Bur wrote: > > > Currently when threads get scheduled off they always giveup the FPU, > > Altivec (VMX) and Vector (VSX) units if they were using them. When they are &g

Re: [PATCH v3 4/9] powerpc: Explicitly disable math features when copying thread

2016-02-08 Thread Cyril Bur
On Wed, 27 Jan 2016 23:01:59 +1100 Balbir Singh wrote: > On Wed, Jan 27, 2016 at 10:50 AM, Cyril Bur wrote: > > On Mon, 25 Jan 2016 11:04:23 +1100 > > Balbir Singh wrote: > > > >> On Thu, 21 Jan 2016 11:55:44 +1100 > >> Cyril Bur wrote: > >>

[PATCH v4 0/9] FP/VEC/VSX switching optimisations

2016-02-14 Thread Cyril Bur
#ifdefs in V3 (6/9) - Reordered some conditions in if statements Cyril Bur (9): selftests/powerpc: Test the preservation of FPU and VMX regs across syscall selftests/powerpc: Test preservation of FPU and VMX regs across preemption selftests/powerpc: Test FPU and VMX regs in signal ucontext

[PATCH v4 2/9] selftests/powerpc: Test preservation of FPU and VMX regs across preemption

2016-02-14 Thread Cyril Bur
Loop in assembly checking the registers with many threads. Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore| 2 + tools/testing/selftests/powerpc/math/Makefile | 5 +- tools/testing/selftests/powerpc/math/fpu_asm.S | 34 +++ tools/testing

[PATCH v4 3/9] selftests/powerpc: Test FPU and VMX regs in signal ucontext

2016-02-14 Thread Cyril Bur
Load up the non volatile FPU and VMX regs and ensure that they are the expected value in a signal handler Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/math/.gitignore | 2 + tools/testing/selftests/powerpc/math/Makefile | 4 +- tools/testing/selftests/powerpc/math

[PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-02-14 Thread Cyril Bur
Test that the non volatile floating point and Altivec registers get correctly preserved across the fork() syscall. fork() works nicely for this purpose, the registers should be the same for both parent and child Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/Makefile

[PATCH v4 4/9] powerpc: Explicitly disable math features when copying thread

2016-02-14 Thread Cyril Bur
hot while not having MSR_{FP,VEC,VSX} means that the registers must be loaded. This allows for a smarter return to userspace. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel

[PATCH v4 5/9] powerpc: Restore FPU/VEC/VSX if previously used

2016-02-14 Thread Cyril Bur
benchmarking it was determined that avoiding C in the common case is a performance benefit. The full check in asm greatly complicated that codepath for a negligible performance gain and the trade-off was deemed not worth it. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/processor.h | 2

[PATCH v4 6/9] powerpc: Prepare for splitting giveup_{fpu, altivec, vsx} in two

2016-02-14 Thread Cyril Bur
saving of registers to thread structs and leave threads MSR with bits enabled. This patch introduces no functional change. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/reg.h | 8 arch/powerpc/include/asm/switch_to.h | 7 +++ arch/powerpc/kernel/process.c| 31

[PATCH v4 8/9] powerpc: Add the ability to save Altivec without giving it up

2016-02-14 Thread Cyril Bur
reload of VEC state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 3 ++- arch/powerpc/kernel/process.c| 12 +++- arch/powerpc/kernel/vector.S | 24 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/arch/powerpc

[PATCH v4 7/9] powerpc: Add the ability to save FPU without giving it up

2016-02-14 Thread Cyril Bur
userspace with hot registers avoiding a possibly pointless reload of FPU register state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 3 ++- arch/powerpc/kernel/fpu.S| 21 - arch/powerpc/kernel/process.c| 12 +++- 3 files changed

[PATCH v4 9/9] powerpc: Add the ability to save VSX without giving it up

2016-02-14 Thread Cyril Bur
pointless reload of VSX state. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/switch_to.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 4 arch/powerpc/kernel/process.c| 42 +--- arch/powerpc/kernel/vector.S | 17 --- 4 files

Re: [PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-02-15 Thread Cyril Bur
On Mon, 15 Feb 2016 22:29:17 +0530 "Naveen N. Rao" wrote: > On 2016/02/15 04:07PM, Cyril Bur wrote: > > Test that the non volatile floating point and Altivec registers get > > correctly preserved across the fork() syscall. > > > > fork() works nicely for

[PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction

2017-03-06 Thread Cyril Bur
register comparisons the big endian only byte ordering for stxvd2x and lxvd2x does not impact the test. Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/include/vsx_asm.h | 48 +++ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/testing

[PATCH v2] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction

2017-03-08 Thread Cyril Bur
e CPU loads the values from memory since the tests only performs register comparisons, using stxvd2x/lxvd2x does not impact the test. Signed-off-by: Cyril Bur Acked-by: Balbir Singh --- V2: Reword last sentence of commit message tools/testing/selftests/powerpc/include/vsx_asm.h

[PATCH] arch/powerpc: Fix zImage wrapper with 64bit only toolchains

2017-03-16 Thread Cyril Bur
piler is not 32bit capable), the Makefile should first fall back to the compiler it used for the rest of the kernel. Signed-off-by: Cyril Bur --- arch/powerpc/Makefile | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 8b4

Re: [PATCH 2/2] selftests/powerpc: Test TM and VMX register state

2017-05-12 Thread Cyril Bur
s based heavily on. > Good looking test! > Signed-off-by: Michael Neuling Reviewed-by: Cyril Bur > --- > tools/testing/selftests/powerpc/tm/Makefile| 4 +- > .../testing/selftests/powerpc/tm/tm-vmx-unavail.c | 118 > + > 2 files changed, 121 inse

Re: [PATCH 1/2] powerpc/tm: Fix FP and VMX register corruption

2017-05-12 Thread Cyril Bur
On Mon, 2017-05-08 at 17:16 +1000, Michael Neuling wrote: > In this commit: > commit dc3106690b20305c3df06b42456fe386dd632ac9 > Author: Cyril Bur > powerpc: tm: Always use fp_state and vr_state to store live registers > > A section of code was removed that copied th

[PATCH 1/2] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-06-06 Thread Cyril Bur
BUG_ON() should be reserved in situations where we can not longer guarantee the integrity of the system. In the case where powernv_flash_async_op() receives an impossible op, we can still guarantee the integrity of the system. Signed-off-by: Cyril Bur --- I think patches to powernv_flash have

[PATCH 2/2] mtd: powernv_flash: Lock around concurrent access to OPAL

2017-06-06 Thread Cyril Bur
OPAL can only manage one flash access at a time and will return an OPAL_BUSY error for each concurrent access to the flash. The simplest way to prevent this from happening is with a mutex. Signed-off-by: Cyril Bur --- This is to address https://github.com/open-power/skiboot/issues/80 drivers

Re: [RFC 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-07 Thread Cyril Bur
On Mon, 2017-06-05 at 11:43 +0530, Shilpasri G Bhat wrote: > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL > command buffer and OCC response buffer that can be used to send > inband commands to OCC. This patch add

Re: [PATCH V2 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-13 Thread Cyril Bur
On Tue, 2017-06-13 at 23:26 +0530, Shilpasri G Bhat wrote: > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL > command buffer and OCC response buffer that can be used to send > inband commands to OCC. This patch add

Re: [PATCH V3 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-18 Thread Cyril Bur
On Mon, 2017-06-19 at 11:44 +0530, Shilpasri G Bhat wrote: > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL > command buffer and OCC response buffer that can be used to send > inband commands to OCC. This patch add

Re: [PATCH V4 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-21 Thread Cyril Bur
On Wed, 2017-06-21 at 13:36 +0530, Shilpasri G Bhat wrote: > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL > command buffer and OCC response buffer that can be used to send > inband commands to OCC. This patch add

Re: [PATCH V4 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-21 Thread Cyril Bur
On Thu, 2017-06-22 at 09:57 +0530, Shilpasri G Bhat wrote: > Hi Cyril, > > On 06/22/2017 06:28 AM, Cyril Bur wrote: > > On Wed, 2017-06-21 at 13:36 +0530, Shilpasri G Bhat wrote: > > > In P9, OCC (On-Chip-Controller) supports shared memory based > > > commad-resp

Re: [PATCH] powerpc/kernel: Avoid redundancies on giveup_all

2017-06-22 Thread Cyril Bur
On Thu, 2017-06-22 at 17:27 -0300, Breno Leitao wrote: > Currently giveup_all() calls __giveup_fpu(), __giveup_altivec(), and > __giveup_vsx(). But __giveup_vsx() also calls __giveup_fpu() and > __giveup_altivec() again, in a redudant manner. > > Other than giving up FP and Altivec, __giveup_vsx()

Re: [PATCH V5] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-26 Thread Cyril Bur
the OCC works or anything so I would be best if there were other eyes on this. Provided zero is an ok request_id: Reviewed-by: Cyril Bur > Signed-off-by: Shilpasri G Bhat > --- > The skiboot patch for the interface is posted here: > https://lists.ozlabs.org/pipermail/skiboot/20

[PATCH 3/5] powerpc/opal: Add opal_async_wait_response_interruptible() to opal-async

2017-06-28 Thread Cyril Bur
functions would take upwards of two minutes causing the wait_event() to block long enough to cause hung task warnings. Furthermore, wait_event_interruptible() is preferable as otherwise there is no way for signals to stop the process which is going to be confusing in userspace. Signed-off-by: Cyril Bur

[PATCH 4/5] powerpc/powernv: Add OPAL_BUSY to opal_error_code()

2017-06-28 Thread Cyril Bur
Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 59684b4af4d1..f87e000e7c28 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch

[PATCH 2/5] powerpc/opal: Rework the opal-async interface

2017-06-28 Thread Cyril Bur
tokens there can be - it is possible that OPAL will inform Linux that there are more than 64 tokens. Rather than add a bitfield to track the extra state, rework the internals slightly. Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal-async.c | 99 - 1

[PATCH 5/5] mtd: powernv_flash: Use opal_async_wait_response_interruptible()

2017-06-28 Thread Cyril Bur
ts to quieten down the use of dev_err() when errors haven't actually occurred and also to return better information up the stack rather than always -EIO. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) di

[PATCH 1/5] powerpc/opal: Make __opal_async_{get, release}_token() static

2017-06-29 Thread Cyril Bur
ync tokens. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/opal.h | 2 -- arch/powerpc/platforms/powernv/opal-async.c | 10 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 58

[PATCH 0/5] Allow opal-async waiters to get interrupted

2017-06-29 Thread Cyril Bur
problem that the powernv_flash MTD driver can use in patch 5/5. Hello MTD folk, traditionally Michael Ellerman takes powernv_flash driver patches through the powerpc tree, as always your feedback is very welcome. Thanks, Cyril Cyril Bur (5): powerpc/opal: Make __opal_async_{get,release}_token

Re: [PATCH 1/2] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-07-03 Thread Cyril Bur
On Thu, 2017-06-29 at 20:44 -0400, Gustavo Romero wrote: > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > due to the fact vs0 is used to save FPSCR and vs32 is used to save VSCR. > > Later, we recheckpoint trusting that the live state of FP and VEC are ok > depending o

Re: [PATCH 1/2] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-07-03 Thread Cyril Bur
On Fri, 2017-06-30 at 13:41 -0300, Breno Leitao wrote: > Thanks Gustavo for the patch. > > On Thu, Jun 29, 2017 at 08:39:23PM -0400, Gustavo Romero wrote: > > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > > due to the fact vs0 is used to save FPSCR and vs32 is used to

Re: [PATCH 2/2] powerpc/tm: test for regs sanity in VSX exception

2017-07-03 Thread Cyril Bur
ood, its a nice test for a very difficult (difficult on purpose but still possible by accident!) to hit bug. Reviewed-by: Cyril Bur > --- > tools/testing/selftests/powerpc/tm/Makefile| 3 +- > .../testing/selftests/powerpc/tm/tm-vsx-unavail.c | 144 > ++

[PATCH] selftests/powerpc: context_switch: Fix pthread errors

2017-07-03 Thread Cyril Bur
Turns out pthreads returns an errno and doesn't set errno. This doesn't play well with perror(). Signed-off-by: Cyril Bur --- .../selftests/powerpc/benchmarks/context_switch.c| 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/testing

Re: [PATCH 5/5] mtd: powernv_flash: Use opal_async_wait_response_interruptible()

2017-07-09 Thread Cyril Bur
On Sat, 2017-07-08 at 14:59 -0500, Benjamin Herrenschmidt wrote: > On Thu, 2017-06-29 at 16:54 +1000, Cyril Bur wrote: > > The OPAL calls performed in this driver shouldn't be using > > opal_async_wait_response() as this performs a wait_event() which, on > > long running

[PATCH v2 04/10] mtd: powernv_flash: Remove pointless goto in driver init

2017-07-09 Thread Cyril Bur
Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c index d50b5f200f73..d7243b72ba6e 100644 --- a/drivers/mtd/devices

[PATCH v2 01/10] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-07-09 Thread Cyril Bur
BUG_ON() should be reserved in situations where we can not longer guarantee the integrity of the system. In the case where powernv_flash_async_op() receives an impossible op, we can still guarantee the integrity of the system. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 3

[PATCH v2 00/10] Allow opal-async waiters to get interrupted

2017-07-09 Thread Cyril Bur
c tree, as always your feedback is very welcome. Thanks, Cyril Cyril Bur (9): mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON() mtd: powernv_flash: Lock around concurrent access to OPAL mtd: powernv_flash: Don't treat OPAL_SUCCESS as an error mtd: powernv_flash: Remove po

[PATCH v2 10/10] mtd: powernv_flash: Use opal_async_wait_response_interruptible()

2017-07-09 Thread Cyril Bur
ieten down the use of dev_err() when errors haven't actually occurred and also to return better information up the stack rather than always -EIO. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletion

[PATCH v2 07/10] powernv/opal-sensor: remove not needed lock

2017-07-09 Thread Cyril Bur
the mutex. Additionally, we shouldn't be printing out an error when we don't get a token as the only way this should happen is if we've been interrupted in down_interruptible() on the semaphore. Reported-by: Robert Lippert Signed-off-by: Stewart Smith Signed-off-by: Cyril Bur --

[PATCH v2 05/10] powerpc/opal: Make __opal_async_{get, release}_token() static

2017-07-09 Thread Cyril Bur
ync tokens. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/opal.h | 2 -- arch/powerpc/platforms/powernv/opal-async.c | 10 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 58

[PATCH v2 09/10] powerpc/powernv: Add OPAL_BUSY to opal_error_code()

2017-07-09 Thread Cyril Bur
Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 59684b4af4d1..f87e000e7c28 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch

[PATCH v2 08/10] powerpc/opal: Add opal_async_wait_response_interruptible() to opal-async

2017-07-09 Thread Cyril Bur
functions would take upwards of two minutes causing the wait_event() to block long enough to cause hung task warnings. Furthermore, wait_event_interruptible() is preferable as otherwise there is no way for signals to stop the process which is going to be confusing in userspace. Signed-off-by: Cyril Bur

[PATCH v2 06/10] powerpc/opal: Rework the opal-async interface

2017-07-09 Thread Cyril Bur
tokens there can be - it is possible that OPAL will inform Linux that there are more than 64 tokens. Rather than add a bitfield to track the extra state, rework the internals slightly. Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal-async.c | 97 - 1

[PATCH v2 03/10] mtd: powernv_flash: Don't treat OPAL_SUCCESS as an error

2017-07-09 Thread Cyril Bur
d-off-by: Cyril Bur --- I'll note here that currently no OPAL exists that will return OPAL_SUCCESS so there isn't the possibility of a bug today. drivers/mtd/devices/powernv_flash.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/devices/

[PATCH v2 02/10] mtd: powernv_flash: Lock around concurrent access to OPAL

2017-07-09 Thread Cyril Bur
OPAL can only manage one flash access at a time and will return an OPAL_BUSY error for each concurrent access to the flash. The simplest way to prevent this from happening is with a mutex. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 18 +++--- 1 file changed

Re: [PATCH v2 08/10] powerpc/opal: Add opal_async_wait_response_interruptible() to opal-async

2017-07-10 Thread Cyril Bur
On Mon, 2017-07-10 at 14:05 +, David Laight wrote: > From: Cyril Bur > > Sent: 10 July 2017 02:31 > > This patch adds an _interruptible version of opal_async_wait_response(). > > This is useful when a long running OPAL call is performed on behalf of a > > userspa

[PATCH v3 09/10] powerpc/powernv: Add OPAL_BUSY to opal_error_code()

2017-07-11 Thread Cyril Bur
Also export opal_error_code() so that it can be used in modules Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 59684b4af4d1

[PATCH v3 01/10] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-07-11 Thread Cyril Bur
BUG_ON() should be reserved in situations where we can not longer guarantee the integrity of the system. In the case where powernv_flash_async_op() receives an impossible op, we can still guarantee the integrity of the system. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 3

[PATCH v3 02/10] mtd: powernv_flash: Lock around concurrent access to OPAL

2017-07-11 Thread Cyril Bur
OPAL can only manage one flash access at a time and will return an OPAL_BUSY error for each concurrent access to the flash. The simplest way to prevent this from happening is with a mutex. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 18 +++--- 1 file changed

[PATCH v3 07/10] powernv/opal-sensor: remove not needed lock

2017-07-11 Thread Cyril Bur
the mutex. Additionally, we shouldn't be printing out an error when we don't get a token as the only way this should happen is if we've been interrupted in down_interruptible() on the semaphore. Reported-by: Robert Lippert Signed-off-by: Stewart Smith Signed-off-by: Cyril Bur --

[PATCH v3 00/10] Allow opal-async waiters to get interrupted

2017-07-11 Thread Cyril Bur
ly Michael Ellerman takes powernv_flash driver patches through the powerpc tree, as always your feedback is very welcome. Thanks, Cyril Cyril Bur (9): mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON() mtd: powernv_flash: Lock around concurrent access to OPAL mtd: powernv_flash: D

[PATCH v3 05/10] powerpc/opal: Make __opal_async_{get, release}_token() static

2017-07-11 Thread Cyril Bur
ync tokens. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/opal.h | 2 -- arch/powerpc/platforms/powernv/opal-async.c | 10 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 58

[PATCH v3 10/10] mtd: powernv_flash: Use opal_async_wait_response_interruptible()

2017-07-11 Thread Cyril Bur
ieten down the use of dev_err() when errors haven't actually occurred and also to return better information up the stack rather than always -EIO. Signed-off-by: Cyril Bur --- drivers/mtd/devices/powernv_flash.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletion

[PATCH v3 06/10] powerpc/opal: Rework the opal-async interface

2017-07-11 Thread Cyril Bur
tokens there can be - it is possible that OPAL will inform Linux that there are more than 64 tokens. Rather than add a bitfield to track the extra state, rework the internals slightly. Signed-off-by: Cyril Bur --- arch/powerpc/platforms/powernv/opal-async.c | 97 - 1

<    1   2   3   4   5   >