Re: [PATCH] selftests/powerpc: Skip tm-unavailable if TM is not enabled

2018-03-05 Thread Cyril Bur
> I spent more time than I care to admit looking at backtraces wondering how "ping" got in the mix ;). > Fixes: 77fad8bfb1d2 ("selftests/powerpc: Check FP/VEC on exception in TM") > Signed-off-by: Gustavo Romero Reviewed-by: Cyril Bur > --- > .../testing/sel

Re: [RFC PATCH 05/12] [WIP] powerpc/tm: Reclaim/recheckpoint on entry/exit

2018-02-19 Thread Cyril Bur
On Tue, 2018-02-20 at 16:25 +1100, Michael Neuling wrote: > > > > @@ -1055,6 +1082,8 @@ void restore_tm_state(struct pt_regs *regs) > > > > msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; > > > > msr_diff &= MSR_FP | MSR_VEC | MSR_VSX; > > > > > > > > + tm_recheckpoin

Re: [RFC PATCH 10/12] [WIP] powerpc/tm: Correctly save/restore checkpointed sprs

2018-02-19 Thread Cyril Bur
On Tue, 2018-02-20 at 14:00 +1100, Michael Neuling wrote: > This needs a description of what you're trying to do. "Correctly" doesn't > really mean anything. > > > On Tue, 2018-02-20 at 11:22 +1100, Cyril Bur wrote: > > --

Re: [RFC PATCH 05/12] [WIP] powerpc/tm: Reclaim/recheckpoint on entry/exit

2018-02-19 Thread Cyril Bur
On Tue, 2018-02-20 at 13:50 +1100, Michael Neuling wrote: > On Tue, 2018-02-20 at 11:22 +1100, Cyril Bur wrote: > > > The comment from the cover sheet should be here > > > --- > > arch/powerpc/include/asm/exception-64s.h | 25 + > >

Re: [RFC PATCH 06/12] [WIP] powerpc/tm: Remove dead code from __switch_to_tm()

2018-02-19 Thread Cyril Bur
sn't bisect. > Needs a comment here. > > > On Tue, 2018-02-20 at 11:22 +1100, Cyril Bur wrote: > > --- > > arch/powerpc/kernel/process.c | 24 +--- > > 1 file changed, 5 insertions(+), 19 deletions(-) > > > > diff --git a/arc

Re: [RFC PATCH 12/12] [WIP] selftests/powerpc: Remove incorrect tm-syscall selftest

2018-02-19 Thread Cyril Bur
On Tue, 2018-02-20 at 14:04 +1100, Michael Neuling wrote: > > --- a/tools/testing/selftests/powerpc/tm/tm-syscall.c > > +++ /dev/null > > @@ -1,106 +0,0 @@ > > -/* > > - * Copyright 2015, Sam Bobroff, IBM Corp. > > - * Licensed under GPLv2. > > - * > > - * Test the kernel's system call code to ensu

[RFC PATCH 12/12] [WIP] selftests/powerpc: Remove incorrect tm-syscall selftest

2018-02-19 Thread Cyril Bur
Currently we perform transactional memory work at late as possible. That is we run in the kernel with the userspace checkpointed state on the CPU untill we absolultely must remove it and store it away. Likely a process switch, but possibly also signals or ptrace. What this means is that if userspa

[RFC PATCH 10/12] [WIP] powerpc/tm: Correctly save/restore checkpointed sprs

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/process.c | 57 +-- arch/powerpc/kernel/ptrace.c | 9 +++ 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index cd3ae80a6878..674f75c56172 100644 ---

[RFC PATCH 08/12] [WIP] powerpc/tm: Fix *unavailable_tm exceptions

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/process.c | 11 ++- arch/powerpc/kernel/traps.c | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 574b05fe7d66..8a32fd062a2b 100644 --- a/arch/powerpc/kernel/process.c +++

[RFC PATCH 11/12] [WIP] powerpc/tm: Afterthoughts

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/process.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 674f75c56172..6ce41ee62b24 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@

[RFC PATCH 04/12] selftests/powerpc: Use less common thread names

2018-02-19 Thread Cyril Bur
"ping" and "pong" (in particular "ping") are common names. If a selftests causes a kernel BUG_ON or any kind of backtrace the process name is displayed. Setting a more unique name avoids confusion as to which process caused the problem. Signed-off-by: Cyril Bur

[RFC PATCH 01/12] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread()

2018-02-19 Thread Cyril Bur
Just remove it and adjust the callers. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 1738c4127b32..77dc6d8288eb 100644 --- a/arch/powerpc/k

[RFC PATCH 07/12] [WIP] powerpc/tm: Add TM_KERNEL_ENTRY in more delicate exception pathes

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/entry_64.S | 15 ++- arch/powerpc/kernel/exceptions-64s.S | 31 --- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 107c15c6f48b..32e8d8f7e091

[RFC PATCH 09/12] [WIP] powerpc/tm: Tweak signal code to handle new reclaim/recheckpoint times

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/process.c | 13 - arch/powerpc/kernel/signal.c| 11 ++- arch/powerpc/kernel/signal_32.c | 16 ++-- arch/powerpc/kernel/signal_64.c | 41 + 4 files changed, 49 insertions(+), 32 deletions(-) diff

[RFC PATCH 03/12] selftests/powerpc: Add tm-signal-drop-transaction TM test

2018-02-19 Thread Cyril Bur
This test uses a signal to 'discard' a transaction. That is, it will take a signal of a thread in a suspended transaction and just remove the suspended MSR bit. Because this will send the userspace thread back to the tebgin + 4 address, we should also set CR0 to be nice. Signed-off-by:

[RFC PATCH 05/12] [WIP] powerpc/tm: Reclaim/recheckpoint on entry/exit

2018-02-19 Thread Cyril Bur
--- arch/powerpc/include/asm/exception-64s.h | 25 + arch/powerpc/kernel/entry_64.S | 5 + arch/powerpc/kernel/process.c| 37 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/exc

[RFC PATCH 06/12] [WIP] powerpc/tm: Remove dead code from __switch_to_tm()

2018-02-19 Thread Cyril Bur
--- arch/powerpc/kernel/process.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ea75da0fd506..574b05fe7d66 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/proces

[RFC PATCH 02/12] selftests/powerpc: Fix tm.h helpers

2018-02-19 Thread Cyril Bur
Turns out the tcheck() helpers were subtly wrong Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/tm/tm.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/powerpc/tm/tm.h b/tools/testing/selftests/powerpc/tm/tm.h index

[RFC PATCH 00/12] Deal with TM on kernel entry and exit

2018-02-19 Thread Cyril Bur
ore or less complexity and though I'd have to try it to see. I feel like it was almost a win but SPRs did add some annoying caveats. In order to get this past Michael I'm going to prove it performs, or rather, doesn't slow anything down - workload suggestions welcome. Thank

Re: [PATCH] pseries/drmem: Check for zero filled ibm, dynamic-memory property.

2018-02-15 Thread Cyril Bur
0x0>; > linux,phandle = <0x7e57eed8>; > ibm,associativity-lookup-arrays = <0x1 0x4 0x0 0x0 0x0 0x0>; > ibm,memory-preservation-time = <0x0>; > }; > > Signed-off-by: Nathan Fontenot Works for me. Reviewed-by: Cyril Bur > --- > arch/powe

Re: 4.16-rc1 virtual machine crash on boot

2018-02-13 Thread Cyril Bur
On Tue, 2018-02-13 at 21:12 -0800, Tyrel Datwyler wrote: > On 02/13/2018 05:20 PM, Cyril Bur wrote: > > Hello all, > > Does reverting commit 02ef6dd8109b581343ebeb1c4c973513682535d6 alleviate the > issue? > Hi Tyrel, No it doesn't. Same backtrace. > -Tyrel >

[PATCH] powerpc: Expose TSCR via sysfs only on powernv

2018-02-13 Thread Cyril Bur
The TSCR can only be accessed in hypervisor mode. Fixes: 88b5e12eeb11 ("powerpc: Expose TSCR via sysfs") Signed-off-by: Cyril Bur --- arch/powerpc/kernel/sysfs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kern

4.16-rc1 virtual machine crash on boot

2018-02-13 Thread Cyril Bur
Hello all, I'm seeing this crash trying to boot a KVM virtual machine. This kernel was compiled with pseries_le_defconfig and run using the following qemu commandline: qemu-system-ppc64 -enable-kvm -cpu POWER8 -smp 4 -m 4G -M pseries -nographic -vga none -drive file=vm.raw,if=virtio,format=raw -d

[PATCH] powerpc/tm: Update function prototype comment

2018-02-04 Thread Cyril Bur
here is a comment in the asm file where the function is delcared which has an incorrect prototype with the 'orig_msr' parameter. This patch corrects the comment. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/tm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

Re: [PATCH] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread()

2018-02-01 Thread Cyril Bur
On Thu, 2018-02-01 at 15:46 +1100, Michael Ellerman wrote: > Cyril Bur writes: > > > tm_reclaim_thread() doesn't use the parameter anymore, both callers have > > to bother getting it as they have no need for a struct thread_info > > either. > > In future

[PATCH] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread()

2018-01-31 Thread Cyril Bur
tm_reclaim_thread() doesn't use the parameter anymore, both callers have to bother getting it as they have no need for a struct thread_info either. Just remove it and adjust the callers. Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 7 +++ 1 file changed, 3 insertions(

Re: [PATCH 2/2] selftests/powerpc: Calculate spin time in tm-unavailable

2017-12-10 Thread Cyril Bur
On Mon, 2017-12-11 at 13:02 +1100, Michael Ellerman wrote: > Cyril Bur writes: > > > On Tue, 2017-11-21 at 11:31 -0200, Gustavo Romero wrote: > > > Hi Cyril, > > > > > > On 21-11-2017 05:17, Cyril Bur wrote: > > > > Currently the tm-u

Re: [PATCH 2/2] selftests/powerpc: Calculate spin time in tm-unavailable

2017-11-21 Thread Cyril Bur
On Tue, 2017-11-21 at 11:31 -0200, Gustavo Romero wrote: > Hi Cyril, > > On 21-11-2017 05:17, Cyril Bur wrote: > > Currently the tm-unavailable test spins for a fixed amount of time in > > an attempt to ensure the FPU/VMX/VSX facilities are off. This value was > > exper

[PATCH 2/2] selftests/powerpc: Calculate spin time in tm-unavailable

2017-11-20 Thread Cyril Bur
: Cyril Bur --- Because the test no longer needs to use such a conservative time for the busy wait, it actually runs much faster. .../testing/selftests/powerpc/tm/tm-unavailable.c | 92 -- 1 file changed, 84 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests

[PATCH 1/2] selftests/powerpc: Check for pthread errors in tm-unavailable

2017-11-20 Thread Cyril Bur
Signed-off-by: Cyril Bur --- .../testing/selftests/powerpc/tm/tm-unavailable.c | 43 +- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/powerpc/tm/tm-unavailable.c b/tools/testing/selftests/powerpc/tm/tm-unavailable.c index

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

2017-11-06 Thread Cyril Bur
On Mon, 2017-11-06 at 20:41 +1100, Michael Ellerman wrote: > Cyril Bur writes: > > > diff --git a/arch/powerpc/platforms/powernv/opal-async.c > > b/arch/powerpc/platforms/powernv/opal-async.c > > index c43421ab2d2f..fbae8a37ce2c 100644 > > --- a/arch/powerpc/

Re: [PATCH] selftests/powerpc: Check FP/VEC on exception in TM

2017-11-05 Thread Cyril Bur
On Fri, 2017-11-03 at 10:28 -0200, Gustavo Romero wrote: > Hi Cyril! > > On 01-11-2017 20:10, Cyril Bur wrote: > > Thanks Gustavo, > > > > I do have one more thought on an improvement for this test which is > > that: > > + /* Counter for busy wait *

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

2017-11-02 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 Acked-by: Boris Brezillon --- drivers/mtd/devices/powernv_flash.c | 57 +++-- 1 file c

[PATCH v5 03/10] mtd: powernv_flash: Remove pointless goto in driver init

2017-11-02 Thread Cyril Bur
powernv_flash_probe() has pointless goto statements which jump to the end of the function to simply return a variable. Rather than checking for error and going to the label, just return the error as soon as it is detected. Signed-off-by: Cyril Bur Acked-by: Boris Brezillon --- drivers/mtd

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

2017-11-02 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 | 92 - 1

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

2017-11-02 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 v5 02/10] mtd: powernv_flash: Don't treat OPAL_SUCCESS as an error

2017-11-02 Thread Cyril Bur
d-off-by: Cyril Bur Acked-by: Boris Brezillon --- 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 | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-

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

2017-11-02 Thread Cyril Bur
improvements Stewart fixed another problem and he relies on the corrected behaviour of opal-async so I've sent it here. 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 (9)

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

2017-11-02 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 72

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

2017-11-02 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 v5 09/10] powerpc/powernv: Add OPAL_BUSY to opal_error_code()

2017-11-02 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 65c79ecf5a4d

[PATCH v5 04/10] mtd: powernv_flash: Don't return -ERESTARTSYS on interrupted token acquisition

2017-11-02 Thread Cyril Bur
Because the MTD core might split up a read() or write() from userspace into several calls to the driver, we may fail to get a token but already have done some work, best to return -EINTR back to userspace and have them decide what to do. Signed-off-by: Cyril Bur Acked-by: Boris Brezillon

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

2017-11-02 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 Acked-by: Boris Brezillon --- drivers/mtd

[PATCH v3 3/4] powerpc: Always save/restore checkpointed regs during treclaim/trecheckpoint

2017-11-01 Thread Cyril Bur
s hiding in the noise of everything else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur --- V2: Unchanged V3: Unchanged arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 22 ++- arch/powerpc/kernel/signa

[PATCH v3 4/4] powerpc: Remove facility loadups on transactional {fp, vec, vsx} unavailable

2017-11-01 Thread Cyril Bur
loadup code in {fp,altivec,vsx}_unavailable_tm() is doing pointless work and can simply be removed. Signed-off-by: Cyril Bur --- V2: Obvious cleanup which should have been in v1 V3: Unchanged arch/powerpc/kernel/traps.c | 30 -- 1 file changed, 30 deletions(-) diff

[PATCH v3 2/4] powerpc: Force reload for recheckpoint during tm {fp, vec, vsx} unavailable exception

2017-11-01 Thread Cyril Bur
int() altogether has been upstreamed to apply on top of this patch. Fixes: dc3106690b20 ("powerpc: tm: Always use fp_state and vr_state to store live registers") Signed-off-by: Cyril Bur --- V2: Add this patch for ease of backporting the same fix as the next patch. V3: No change arch

[PATCH v3 1/4] powerpc: Don't enable FP/Altivec if not checkpointed

2017-11-01 Thread Cyril Bur
s patch solves this by only activating FP/Altivec if userspace was using them when it entered the kernel and not simply if the process is transactional. Fixes: dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use") Signed-off-by: Cyril Bur --- V2:

Re: [PATCH 1/2] powerpc: Don't enable FP/Altivec if not checkpointed

2017-11-01 Thread Cyril Bur
tps://github.com/0day-ci/linux/commits/Cyril-Bur/powerpc-Don-t-enable-FP-Altivec-if-not-checkpointed/20171102-073816 > base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next > config: powerpc-asp8347_defconfig (attached as .config) > compiler: powerpc-linux-gnu-

Re: [PATCH] selftests/powerpc: Check FP/VEC on exception in TM

2017-11-01 Thread Cyril Bur
ests. This will only become a problem if we were to change kernel heuristics which is fine for now. I'll try to get that added soon but for now this test has proven too useful to delay adding as is. > Signed-off-by: Gustavo Romero > Signed-off-by: Breno Leitao > Signed-off-by: Cyril Bur

[PATCH v2 2/4] powerpc: Force reload for recheckpoint during tm {fp, vec, vsx} unavailable exception

2017-10-30 Thread Cyril Bur
int() altogether has been upstreamed to apply on top of this patch. Fixes: dc3106690b20 ("powerpc: tm: Always use fp_state and vr_state to store live registers") Signed-off-by: Cyril Bur --- V2: Add this patch for ease of backporting the same fix as the next patch. arch/powerpc/ke

[PATCH v2 4/4] powerpc: Remove facility loadups on transactional {fp, vec, vsx} unavailable

2017-10-30 Thread Cyril Bur
loadup code in {fp,altivec,vsx}_unavailable_tm() is doing pointless work and can simply be removed. Signed-off-by: Cyril Bur --- V2: Obvious cleanup which should have been in v1 arch/powerpc/kernel/traps.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/arch

[PATCH v2 3/4] powerpc: Always save/restore checkpointed regs during treclaim/trecheckpoint

2017-10-30 Thread Cyril Bur
s hiding in the noise of everything else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur --- V2: Unchanged arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 22 ++- arch/powerpc/kernel/signal_32.c | 2 +- a

[PATCH v2 1/4] powerpc: Don't enable FP/Altivec if not checkpointed

2017-10-30 Thread Cyril Bur
s patch solves this by only activating FP/Altivec if userspace was using them when it entered the kernel and not simply if the process is transactional. Fixes: dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use") Signed-off-by: Cyril Bur --- V2:

Re: [PATCH v4 00/10] Allow opal-async waiters to get interrupted

2017-10-30 Thread Cyril Bur
On Mon, 2017-10-30 at 10:15 +0100, Boris Brezillon wrote: > On Tue, 10 Oct 2017 14:32:52 +1100 > Cyril Bur wrote: > > > V4: Rework and rethink. > > > > To recap: > > Userspace MTD read()s/write()s and erases to powernv_flash become > > calls into the O

[PATCH 2/2] powerpc: Always save/restore checkpointed regs during treclaim/trecheckpoint

2017-10-29 Thread Cyril Bur
s hiding in the noise of everything else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 26 +++--- arch/powerpc/kernel/signal_32.c | 2 +- arch/power

[PATCH 1/2] powerpc: Don't enable FP/Altivec if not checkpointed

2017-10-29 Thread Cyril Bur
pace was using them when it entered the kernel and not simply if the process is transactional. Fixes: dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use") Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 17 +++-- 1 file ch

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

2017-10-25 Thread Cyril Bur
On Wed, 2017-07-05 at 11:02 +1000, Michael Neuling wrote: > On Tue, 2017-07-04 at 16:45 -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. > Hi Mikey, This complet

Re: [PATCH] powerpc/tm: Set ckpt_regs.msr before using it.

2017-10-24 Thread Cyril Bur
he past. I've also done a bunch of testing with variants of this patch and haven't seen a difference, however, I do believe the code is more correct with this patch. Signed-off-by: Cyril Bur Having said all that, nothing rules out that our tests simply aren't good enough ;) > >

Re: [PATCH v3 3/3] powerpc:selftest update memcmp_64 selftest for VMX implementation

2017-10-15 Thread Cyril Bur
On Fri, 2017-10-13 at 12:30 +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > This patch adjust selftest memcmp_64 so that memcmp selftest can be > compiled successfully. > Do they not compile at the moment? > It also adds testcases for: > - memcmp over 4K bytes size. > - s1/s2 with

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

2017-10-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 72

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

2017-10-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 | 57 +++-- 1 file changed, 35 insertions(+), 22

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

2017-10-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 | 92 - 1

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

2017-10-09 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 65c79ecf5a4d

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

2017-10-09 Thread Cyril Bur
I've sent it here. 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 (9): mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON() mtd: powernv_flash: Don't treat

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

2017-10-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 v4 01/10] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-10-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 | 4

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

2017-10-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 v4 03/10] mtd: powernv_flash: Remove pointless goto in driver init

2017-10-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 ca3ca6adf71e..4dd3b5d2feb2 100644 --- a/drivers/mtd/devices

[PATCH v4 04/10] mtd: powernv_flash: Don't return -ERESTARTSYS on interrupted token acquisition

2017-10-09 Thread Cyril Bur
Because the MTD core might split up a read() or write() from userspace into several calls to the driver, we may fail to get a token but already have done some work, best to return -EINTR back to userspace and have them decide what to do. Signed-off-by: Cyril Bur --- drivers/mtd/devices

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

2017-10-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 | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/driv

[PATCH 3/3] powerpc/tm: P9 disable transactionally suspended sigcontexts

2017-10-06 Thread Cyril Bur
t that is going to require additional Linux changes to support. In the interim, this allows TM to continue to (partially) work while stopping userspace from crashing Linux. Signed-off-by: Michael Neuling Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 2 ++ arch/powerpc/kernel/

[PATCH 2/3] powerpc/tm: P9 disabled suspend mode workaround

2017-10-06 Thread Cyril Bur
the kernel. [added by Cyril Bur] As the no-suspend firmware change is novel and untested using it should be opt in by users. Furthumore, currently the kernel has no method to know if the firmware has applied the no-suspend workaround. This patch extends the ppc_tm commandline option to allow users

[PATCH 1/3] powerpc/tm: Add commandline option to disable hardware transactional memory

2017-10-06 Thread Cyril Bur
allow userspace to use HTM, currently the only way to achieve this is to recompile the kernel with CONFIG_PPC_TRANSACTIONAL_MEM=n. This patch adds a simple commandline option so that HTM can be disabled at boot time. Signed-off-by: Cyril Bur --- Documentation/admin-guide/kernel-parameters.txt

Re: [PATCH v2 2/3] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2017-09-25 Thread Cyril Bur
On Sun, 2017-09-24 at 05:18 +0800, Simon Guo wrote: > Hi Cyril, > On Sat, Sep 23, 2017 at 12:06:48AM +1000, Cyril Bur wrote: > > On Thu, 2017-09-21 at 07:34 +0800, wei.guo.si...@gmail.com wrote: > > > From: Simon Guo > > > > > > This patch add VMX primit

Re: [PATCH v2 2/3] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2017-09-22 Thread Cyril Bur
On Thu, 2017-09-21 at 07:34 +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > This patch add VMX primitives to do memcmp() in case the compare size > exceeds 4K bytes. > Hi Simon, Sorry I didn't see this sooner, I've actually been working on a kernel version of glibc commit dec4a7105

Re: [PATCH v2] powerpc/tm: Flush TM only if CPU has TM feature

2017-09-14 Thread Cyril Bur
("powerpc/tm: Fix saving of TM SPRs in core dump") > Signed-off-by: Gustavo Romero Keeping in mind I reviewed cd63f3c and feeling a bit sheepish having missed this. Reviewed-by: Cyril Bur > --- > arch/powerpc/kernel/ptrace.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH] powerpc: Use reg.h values for program check reason codes

2017-08-16 Thread Cyril Bur
On Wed, 2017-08-16 at 10:52 +0200, Christophe LEROY wrote: > Hi, > > Le 16/08/2017 à 08:50, Cyril Bur a écrit : > > Small amount of #define duplication, makes sense for these to be in > > reg.h. > > > > Signed-off-by: Cyril Bur > > Looks similar to t

[PATCH] powerpc: Use reg.h values for program check reason codes

2017-08-15 Thread Cyril Bur
Small amount of #define duplication, makes sense for these to be in reg.h. Signed-off-by: Cyril Bur --- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/traps.c| 10 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch

Re: [PATCH V9 1/3] powernv: powercap: Add support for powercap framework

2017-07-30 Thread Cyril Bur
On Mon, 2017-07-31 at 07:54 +0530, Shilpasri G Bhat wrote: > Adds a generic powercap framework to change the system powercap > inband through OPAL-OCC command/response interface. > > Signed-off-by: Shilpasri G Bhat > --- > Changes from V8: > - Use __pa() while passing pointer in opal call > - Use

Re: [PATCH v4 2/5] powerpc/lib/sstep: Add popcnt instruction emulation

2017-07-30 Thread Cyril Bur
immediately clear that it is correct, we're definitely on the other side of the optimisation vs readability line. It looks like it is, perhaps some comments to clarify. Otherwise, Reviewed-by: Cyril Bur > --- > v4: > - change ifdef macro from __powerpc64__ to CONFIG_PPC64

Re: [PATCH v4 5/5] powerpc/lib/sstep: Add isel instruction emulation

2017-07-30 Thread Cyril Bur
On Mon, 2017-07-31 at 10:58 +1000, Matt Brown wrote: > This adds emulation for the isel instruction. > Tested for correctness against the isel instruction and its extended > mnemonics (lt, gt, eq) on ppc64le. > > Signed-off-by: Matt Brown Reviewed-by: Cyril Bur > --- > v

Re: [PATCH v4 4/5] powerpc/lib/sstep: Add prty instruction emulation

2017-07-30 Thread Cyril Bur
On Mon, 2017-07-31 at 10:58 +1000, Matt Brown wrote: > This adds emulation for the prtyw and prtyd instructions. > Tested for logical correctness against the prtyw and prtyd instructions > on ppc64le. > > Signed-off-by: Matt Brown Reviewed-by: Cyril Bur > --- > v4: >

Re: [PATCH v4 3/5] powerpc/lib/sstep: Add bpermd instruction emulation

2017-07-30 Thread Cyril Bur
On Mon, 2017-07-31 at 10:58 +1000, Matt Brown wrote: > This adds emulation for the bpermd instruction. > Tested for correctness against the bpermd instruction on ppc64le. > > Signed-off-by: Matt Brown Reviewed-by: Cyril Bur > --- > v4: > - change ifdef macro

Re: [PATCH v4 1/5] powerpc/lib/sstep: Add cmpb instruction emulation

2017-07-30 Thread Cyril Bur
On Mon, 2017-07-31 at 10:58 +1000, Matt Brown wrote: > This patch adds emulation of the cmpb instruction, enabling xmon to > emulate this instruction. > Tested for correctness against the cmpb asm instruction on ppc64le. > > Signed-off-by: Matt Brown Reviewed-by: Cyril B

Re: [PATCH] powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler

2017-07-27 Thread Cyril Bur
1 make[1]: *** [arch/powerpc/boot/Makefile:198: arch/powerpc/boot/cuboot.o] Error 1 COPYarch/powerpc/boot/inffixed.h make: *** [arch/powerpc/Makefile:289: zImage] Error 2 make: *** Waiting for unfinished jobs With this patch applied builds fine. Please merge! Reviewed-by: Cyril Bur &g

Re: [PATCH] powerpc/configs: Add a powernv_be_defconfig

2017-07-27 Thread Cyril Bur
nv_defconfig. > > Signed-off-by: Michael Ellerman Reviewed-by: Cyril Bur > --- > arch/powerpc/Makefile | 4 > arch/powerpc/configs/be.config | 1 + > 2 files changed, 5 insertions(+) > create mode 100644 arch/powerpc/configs/be.config > > diff --git a/arch/p

Re: [PATCH V8 3/3] powernv: Add support to clear sensor groups data

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > Adds support for clearing different sensor groups. OCC inband sensor > groups like CSM, Profiler, Job Scheduler can be cleared using this > driver. The min/max of all sensors belonging to these sensor groups > will be cleared. > Hi Shil

Re: [PATCH V8 2/3] powernv: Add support to set power-shifting-ratio

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > This patch adds support to set power-shifting-ratio for CPU-GPU which > is used by OCC power capping algorithm. > > Signed-off-by: Shilpasri G Bhat Hi Shilpasri, I started looking though this - a lot the comments to patch 1/3 apply h

Re: [PATCH V8 1/3] powernv: powercap: Add support for powercap framework

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > Adds a generic powercap framework to change the system powercap > inband through OPAL-OCC command/response interface. > > Signed-off-by: Shilpasri G Bhat > --- > Changes from V7: > - Replaced sscanf with kstrtoint > > arch/powerpc/inc

Re: [PATCH] powerpc/tm: fix TM SPRs in code dump file

2017-07-23 Thread Cyril Bur
y zero). The above test was run on the same 4.13-rc1 with this patch applied for a over 48 hours. The test was executed at a rate of about one run per second. An incorrect value was never observed. This gives me confidence that this patch is correct. Running the kernel selftests does not detect a

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

2017-07-17 Thread Cyril Bur
On Mon, 2017-07-17 at 19:29 +1000, Balbir Singh wrote: > On Mon, 2017-07-17 at 17:55 +1000, Cyril Bur wrote: > > On Mon, 2017-07-17 at 17:34 +1000, Balbir Singh wrote: > > > On Wed, 2017-07-12 at 14:22 +1000, Cyril Bur wrote: > > > > OPAL can only manage one flash ac

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

2017-07-17 Thread Cyril Bur
On Mon, 2017-07-17 at 18:50 +1000, Balbir Singh wrote: > On Wed, 2017-07-12 at 14:22 +1000, Cyril Bur wrote: > > While this driver expects to interact asynchronously, OPAL is well > > within its rights to return OPAL_SUCCESS to indicate that the operation > > completed w

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

2017-07-17 Thread Cyril Bur
On Mon, 2017-07-17 at 21:30 +1000, Balbir Singh wrote: > On Wed, 2017-07-12 at 14:23 +1000, Cyril Bur wrote: > > Future work will add an opal_async_wait_response_interruptible() > > which will call wait_event_interruptible(). This work requires extra > > token s

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

2017-07-17 Thread Cyril Bur
On Mon, 2017-07-17 at 13:33 +0200, Frans Klaver wrote: > On Wed, Jul 12, 2017 at 6:22 AM, Cyril Bur wrote: > > 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

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

2017-07-17 Thread Cyril Bur
On Mon, 2017-07-17 at 17:34 +1000, Balbir Singh wrote: > On Wed, 2017-07-12 at 14:22 +1000, Cyril Bur wrote: > > 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 t

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

2017-07-11 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 v3 04/10] mtd: powernv_flash: Remove pointless goto in driver init

2017-07-11 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 v3 08/10] powerpc/opal: Add opal_async_wait_response_interruptible() to opal-async

2017-07-11 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 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

[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

  1   2   3   4   5   >