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 <grom...@linux.vnet.ibm.com> Reviewed-by: Cyril Bur <cyri

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; > > > > > > > > +

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
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/arch/powerpc/

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

[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

[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
ust remove it and adjust the callers. Signed-off-by: Cyril Bur <cyril...@gmail.com> --- 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 --

[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

[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: Cyril Bur

[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

[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 +++

[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 <cyril...@gmail.com> --- 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/powe

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

2018-02-19 Thread Cyril Bur
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. Thanks, Cyril Bur (12): powerpc/tm: Remove struct thread_info param from

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

2018-02-15 Thread Cyril Bur
mory = <0x0 0x0 0x0 0x0 0x0 0x0>; > linux,phandle = <0x7e57eed8>; > ibm,associativity-lookup-arrays = <0x1 0x4 0x0 0x0 0x0 0x0>; > ibm,memory-preservation-time = <0x0>; > }; > > Signed-off-by: Nathan Fontenot <nf...@linux.vnet.ibm

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 <cyril...@gmail.com> --- arch/powerpc/kernel/sysfs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kerne

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

[PATCH] powerpc/tm: Update function prototype comment

2018-02-04 Thread Cyril Bur
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 <cyril...@gmail.com> --- arch/powerpc/kernel/tm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) d

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 <cyril...@gmail.com> 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. >

[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 <cyril...@gmail.com> --- arch/powerpc/kernel/process.c | 7 +++ 1 file c

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 <cyril...@gmail.com> writes: > > > On Tue, 2017-11-21 at 11:31 -0200, Gustavo Romero wrote: > > > Hi Cyril, > > > > > > On 21-11-2017 05:17, Cyril Bur wrote: > > >

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
-by: Cyril Bur <cyril...@gmail.com> --- 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

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

2017-11-20 Thread Cyril Bur
Signed-off-by: Cyril Bur <cyril...@gmail.com> --- .../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

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 <cyril...@gmail.com> writes: > > > diff --git a/arch/powerpc/platforms/powernv/opal-async.c > > b/arch/powerpc/platforms/powernv/opal-async.c > > index c43421ab2d2f..fbae8a37ce2c 100644 &g

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
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 <cyril...@gmail.com> Acked-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/devices/powernv_

[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 <cyril...@gmail.com> Acked-by: Boris Bre

[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 <cyril...@gmail.com> --- arch/powerpc/platforms/powernv/opal-async.

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

2017-11-02 Thread Cyril Bur
that these 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
-by: Cyril Bur <cyril...@gmail.com> Acked-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- 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 ++-

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

2017-11-02 Thread Cyril Bur
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): mtd: powernv_flash: Use WARN_ON_ONCE

[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 <cyril...@gmail.com> --- 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/

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

2017-11-02 Thread Cyril Bur
Smith <stew...@linux.vnet.ibm.com> Signed-off-by: Cyril Bur <cyril...@gmail.com> --- arch/powerpc/platforms/powernv/opal-sensor.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/pow

[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 <cyril...@gmail.com> --- 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

[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 <cyril...@gmail.com>

[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 <cyril...@gmail.com> Acked-by:

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

2017-11-01 Thread Cyril Bur
else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur <cyril...@gmail.com> --- V2: Unchanged V3: Unchanged arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 22 ++- arch/powerpc/kernel/signal_32.

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

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

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

2017-11-01 Thread Cyril Bur
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 <cyril...@gmail.com> --- V2: Add this patch for ease of backporting the same fix as the next patch. V3: No chang

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

2017-11-01 Thread Cyril Bur
ly 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 <cyril...@gmail.com> --- V2:

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

2017-11-01 Thread Cyril Bur
/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-gcc (

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

2017-11-01 Thread Cyril Bur
erpc/tm/tm-unavailable.c > new file mode 100644 > index 000..69a4e8c > --- /dev/null > +++ b/tools/testing/selftests/powerpc/tm/tm-unavailable.c > @@ -0,0 +1,368 @@ > +/* > + * Copyright 2017, Gustavo Romero, Breno Leitao, Cyril Bur, IBM Corp. > + * Licensed under GPLv2. > + * >

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

2017-10-30 Thread Cyril Bur
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 <cyril...@gmail.com> --- V2: Add this patch for ease of backporting the same fix as the next patch. arch/powerpc/

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

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

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

2017-10-30 Thread Cyril Bur
else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur <cyril...@gmail.com> --- V2: Unchanged arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 22 ++- arch/powerpc/kernel/signal_32.c | 2 +- arch/p

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

2017-10-30 Thread Cyril Bur
ly 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 <cyril...@gmail.com> --- 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 <cyril...@gmail.com> wrote: > > > V4: Rework and rethink. > > > > To recap: > > Userspace MTD read()s/write()s and erases to powernv_flash become

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

2017-10-29 Thread Cyril Bur
else I was working with. I find it exceedingly likely this will be the case here. Signed-off-by: Cyril Bur <cyril...@gmail.com> --- arch/powerpc/include/asm/tm.h | 5 ++-- arch/powerpc/kernel/process.c | 26 +++--- arch/powerpc/kernel/signal_32.c | 2 +- arch/powerpc/

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

2017-10-29 Thread Cyril Bur
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 <cyril...@gmail.com> --- 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

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

2017-10-24 Thread Cyril Bur
e come to the same conclusion in the 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 <cyril...@gmail.com> Having said all that, nothing rules out that our te

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

[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 <cyril...@gmail.com> --- 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/

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

2017-10-09 Thread Cyril Bur
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 <cyril...@gmail.com> --- drivers/mtd/devices/powernv_flash.c | 57 +++-- 1 file changed, 35 inse

[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 <cyril...@gmail.com> --- arch/powerpc/platforms/powernv/opal-async.

[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 <cyril...@gmail.com> --- 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

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

2017-10-09 Thread Cyril Bur
, 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 OPAL_SUCCESS as an error mtd: powernv_flash

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

2017-10-09 Thread Cyril Bur
Smith <stew...@linux.vnet.ibm.com> Signed-off-by: Cyril Bur <cyril...@gmail.com> --- arch/powerpc/platforms/powernv/opal-sensor.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/pow

[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 <cyril...@gmail.com> --- drivers/mtd/d

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

2017-10-09 Thread Cyril Bur
that these 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 <cyril...@gmail.com> --- 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

[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 <cyril...@gmail.com> --- d

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

2017-10-09 Thread Cyril Bur
-by: Cyril Bur <cyril...@gmail.com> --- 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/drive

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

2017-10-06 Thread Cyril Bur
POWER9 but 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 <mi...@neuling.org> Signed-off-by: Cyril Bur <cyril...@gmail.com> --- a

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

2017-10-06 Thread Cyril Bur
into 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
to not 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 <cyril...@gmail.com> --- Documentation/admin

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 <wei.guo.si...@gmail.com> > > > > > &g

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

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

2017-09-14 Thread Cyril Bur
f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") > Signed-off-by: Gustavo Romero <grom...@linux.vnet.ibm.com> Keeping in mind I reviewed cd63f3c and feeling a bit sheepish having missed this. Reviewed-by: Cyril Bur <cyril...@gmail.com> > --- > arch/powerpc/kern

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 <cyril...@gmail.com> >

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

2017-08-16 Thread Cyril Bur
Small amount of #define duplication, makes sense for these to be in reg.h. Signed-off-by: Cyril Bur <cyril...@gmail.com> --- 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/i

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

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

2017-07-30 Thread Cyril Bur
est of this series, it isn't 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 <cyril...@gmail.com> > --- > v4: > - chan

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 <matthew.brown@gmail.com> R

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 <matthew.brown@gmail.com> Reviewed

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 <matthew.brown@gmail.com> Reviewed-by: Cyril Bur <cyril...@g

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

2017-07-30 Thread Cyril Bur
ail.com> Reviewed-by: Cyril Bur <cyril...@gmail.com> > --- > v2: > - fixed opcode > - fixed mask typecasting > --- > arch/powerpc/lib/sstep.c | 20 > 1 file changed, 20 insertions(+) > > diff --git a/arch/powerpc/lib/sstep.c b/ar

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

2017-07-28 Thread Cyril Bur
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 <cy

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

2017-07-28 Thread Cyril Bur
nv_defconfig. > > Signed-off-by: Michael Ellerman <m...@ellerman.id.au> Reviewed-by: Cyril Bur <cyril...@gmail.com> > --- > arch/powerpc/Makefile | 4 > arch/powerpc/configs/be.config | 1 + > 2 files changed, 5 insertions(+) > create mode 100644 arch/pow

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

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

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

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

2017-07-23 Thread Cyril Bur
the kernel selftests does not detect any regressions. Reviewed-by: Cyril Bur <cyril...@gmail.com> > --- > arch/powerpc/kernel/ptrace.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.

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 > > compl

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 > > toke

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 <cyril...@gmail.com> wrote: > > BUG_ON() should be reserved in situations where we can not longer > > guarantee the integrity of the system. In the case where > > powern

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 preven

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

2017-07-11 Thread Cyril Bur
-by: Cyril Bur <cyril...@gmail.com> --- 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/drive

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

2017-07-11 Thread Cyril Bur
Signed-off-by: Cyril Bur <cyril...@gmail.com> --- 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

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

2017-07-11 Thread Cyril Bur
that these 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 <cyril...@gmail.com> --- arch/powerpc/platforms/powernv/opal-async.

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

2017-07-11 Thread Cyril Bur
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 <cyril...@gmail.com> --- drivers/mtd/devices/powernv_flash.c | 28 +++- 1 file changed, 23 insertions

  1   2   3   4   5   >