Re: [PATCH] powerpc/32s: Fix RTAS machine check with VMAP stack

2020-12-22 Thread Christophe Leroy
Le 22/12/2020 à 08:11, Christophe Leroy a écrit : When we have VMAP stack, exception prolog 1 sets r1, not r11. But exception prolog 1 uses r1 to setup r1 when machine check happens in kernel. So r1 must be restored when the branch is not taken. See subsequent patch I just sent out.

[PATCH] powerpc/32s: Fix RTAS machine check with VMAP stack - again

2020-12-22 Thread Christophe Leroy
When it is not a RTAS machine check, don't trash r1 because it is needed by prolog 1. Fixes: 9c7422b92cb2 ("powerpc/32s: Fix RTAS machine check with VMAP stack") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- Sorry Michael for this last minute fix of the fix.

[powerpc:merge] BUILD SUCCESS 409655c00c9ca27e768b09af3bae5bd675fbd994

2020-12-22 Thread kernel test robot
randconfig-a002-20201221 x86_64 randconfig-a004-20201221 x86_64 randconfig-a003-20201221 x86_64 randconfig-a005-20201221 i386 randconfig-a005-20201222 i386 randconfig-a002-20201222 i386 randconfig-a006-20201222

[powerpc:fixes-test] BUILD SUCCESS 9c7422b92cb27369653c371ad9c44a502e5eea8f

2020-12-22 Thread kernel test robot
randconfig-a006-20201221 x86_64 randconfig-a002-20201221 x86_64 randconfig-a004-20201221 x86_64 randconfig-a003-20201221 x86_64 randconfig-a005-20201221 i386 randconfig-a005-20201222 i386 randconfig-a002

Re: [PATCH 3/3] powerpc: rewrite atomics to use ARCH_ATOMIC

2020-12-22 Thread Boqun Feng
On Tue, Dec 22, 2020 at 01:52:50PM +1000, Nicholas Piggin wrote: > Excerpts from Boqun Feng's message of November 14, 2020 1:30 am: > > Hi Nicholas, > > > > On Wed, Nov 11, 2020 at 09:07:23PM +1000, Nicholas Piggin wrote: > >> All the cool kids are doing it. > >> > >> Signed-off-by: Nicholas

Re: [PATCH] arch: consolidate pm_power_off callback

2020-12-22 Thread Enrico Weigelt, metux IT consult
On 22.12.20 19:54, Geert Uytterhoeven wrote: Hi, > On Tue, Dec 22, 2020 at 7:46 PM Enrico Weigelt, metux IT consult > wrote: >> Move the pm_power_off callback into one global place and also add an >> function for conditionally calling it (when not NULL), in order to remove >> code duplication

Re: [PATCH] arch: consolidate pm_power_off callback

2020-12-22 Thread Geert Uytterhoeven
Hi Enrico, On Tue, Dec 22, 2020 at 7:46 PM Enrico Weigelt, metux IT consult wrote: > Move the pm_power_off callback into one global place and also add an > function for conditionally calling it (when not NULL), in order to remove > code duplication in all individual archs. > > Signed-off-by:

[PATCH] arch: consolidate pm_power_off callback

2020-12-22 Thread Enrico Weigelt, metux IT consult
Move the pm_power_off callback into one global place and also add an function for conditionally calling it (when not NULL), in order to remove code duplication in all individual archs. Signed-off-by: Enrico Weigelt, metux IT consult --- arch/alpha/kernel/process.c| 6 --

Re: [PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs()

2020-12-22 Thread Christophe Leroy
Le 22/12/2020 à 18:29, Segher Boessenkool a écrit : On Tue, Dec 22, 2020 at 09:45:03PM +0800, Xiaoming Ni wrote: On 2020/12/22 1:12, Segher Boessenkool wrote: On Mon, Dec 21, 2020 at 04:42:23PM +, David Laight wrote: From: Segher Boessenkool Sent: 21 December 2020 16:32 On Mon, Dec

Re: [PATCH 3/3] ibmvfc: use correlation token to tag commands

2020-12-22 Thread Tyrel Datwyler
On 12/21/20 10:24 PM, Nathan Chancellor wrote: > On Tue, Nov 17, 2020 at 12:50:31PM -0600, Tyrel Datwyler wrote: >> The vfcFrame correlation field is 64bit handle that is intended to trace >> I/O operations through both the client stack and VIOS stack when the >> underlying physical FC adapter

Re: [PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs()

2020-12-22 Thread Segher Boessenkool
On Tue, Dec 22, 2020 at 09:45:03PM +0800, Xiaoming Ni wrote: > On 2020/12/22 1:12, Segher Boessenkool wrote: > >On Mon, Dec 21, 2020 at 04:42:23PM +, David Laight wrote: > >>From: Segher Boessenkool > >>>Sent: 21 December 2020 16:32 > >>> > >>>On Mon, Dec 21, 2020 at 04:17:21PM +0100,

Re: [PATCH v3 03/19] powerpc: bad_page_fault, do_break get registers from regs

2020-12-22 Thread Christophe Leroy
Le 28/11/2020 à 15:40, Nicholas Piggin a écrit : Similar to the previous patch this makes interrupt handler function types more regular so they can be wrapped with the next patch. bad_page_fault and do_break are not performance critical. I partly took your changes into one of my series, in

Re: [PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs()

2020-12-22 Thread Xiaoming Ni
On 2020/12/22 1:12, Segher Boessenkool wrote: On Mon, Dec 21, 2020 at 04:42:23PM +, David Laight wrote: From: Segher Boessenkool Sent: 21 December 2020 16:32 On Mon, Dec 21, 2020 at 04:17:21PM +0100, Christophe Leroy wrote: Le 21/12/2020 à 04:27, Xiaoming Ni a écrit : Since the commit

Re: [PATCH] tpm: ibmvtpm: fix error return code in tpm_ibmvtpm_probe()

2020-12-22 Thread Stefan Berger
On 11/25/20 10:35 PM, Jarkko Sakkinen wrote: On Tue, 2020-11-24 at 21:52 +0800, Wang Hai wrote: Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before proceeding")

[PATCH -next] ide/pmac: use DIV_ROUND_UP macro to do calculation

2020-12-22 Thread Zheng Yongjun
Don't open-code DIV_ROUND_UP() kernel macro. Signed-off-by: Zheng Yongjun --- drivers/ide/pmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index ea0b064b5f56..6c0237af610d 100644 --- a/drivers/ide/pmac.c +++

[PATCH v1 15/15] powerpc/32: Use r11 to store DSISR in prolog

2020-12-22 Thread Christophe Leroy
We now have r11 available. Use it to avoid reloading DSISR from the stack when needed. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_6xx_8xx.h | 4 ++-- arch/powerpc/kernel/head_8xx.S | 3 +-- arch/powerpc/kernel/head_book3s_32.S | 3 +-- 3 files changed, 4 insertions(+),

[PATCH v1 14/15] powerpc/32: Use r1 directly instead of r11 in exception prologs on 6xx/8xx

2020-12-22 Thread Christophe Leroy
r1 and r11 are both pointing to the stack. Use r1 and free up r11. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 4 arch/powerpc/kernel/head_6xx_8xx.h | 28 ++-- arch/powerpc/kernel/head_8xx.S | 10 +-

[PATCH v1 13/15] powerpc/32: Enable instruction translation at the same time as data translation

2020-12-22 Thread Christophe Leroy
On 8xx, kernel text is pinned. On book3s/32, kernel text is mapped by BATs. Enable instruction translation at the same time as data translation, it makes things simpler. In syscall handler, MSR_RI can also be set at the same time because srr0/srr1 are already saved and r1 is set properly. Also

[PATCH v1 12/15] powerpc/32: Remove msr argument in EXC_XFER_TEMPLATE() on 6xx/8xx

2020-12-22 Thread Christophe Leroy
Only MSR_KERNEL is used as msr in EXC_XFER_TEMPLATE(), no need to make it an argument. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_6xx_8xx.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_6xx_8xx.h

[PATCH v1 10/15] powerpc/32: Make VMAP stack code depend on HAVE_ARCH_VMAP_STACK

2020-12-22 Thread Christophe Leroy
If the code can use a stack in vm area, it can also use a stack in linear space. Simplify code by removing old non VMAP stack code on 6xx and 8xx. In common code, depend on HAVE_ARCH_VMAP_STACK instead of depending on VMAP_STACK. Signed-off-by: Christophe Leroy ---

[PATCH v1 11/15] powerpc/32: Use r1 directly instead of r11 in syscall prolog

2020-12-22 Thread Christophe Leroy
In syscall prolog, we don't need to keep the stack pointer in r11 as we do in exception prolog. So r1 can be used directly to free r11. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_6xx_8xx.h | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff

[PATCH v1 05/15] powerpc: Remove address argument from bad_page_fault()

2020-12-22 Thread Christophe Leroy
The address argument is not used by bad_page_fault(). Remove it. Suggested-by: Nicholas Piggin Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/bug.h | 4 ++-- arch/powerpc/kernel/entry_32.S | 4 +--- arch/powerpc/kernel/exceptions-64e.S | 3 +--

[PATCH v1 08/15] powerpc/32: Split head_32.h into head_40x.h and head_6xx_8xx.h

2020-12-22 Thread Christophe Leroy
book3s/32 (aka 6xx) and 8xx head will be reworked to re-enable MMU earlier. Split 40x head.h out so that we can keep 40x as is until it is phased out. There is no plan to implement VMAP stack on 40x on the near future so remove everything related. Signed-off-by: Christophe Leroy ---

[PATCH v1 09/15] powerpc/32: Preserve cr1 in exception prolog stack check

2020-12-22 Thread Christophe Leroy
THREAD_ALIGN_SHIFT = THREAD_SHIFT + 1 = PAGE_SHIFT + 1 Maximum PAGE_SHIFT is 18 for 256k pages so THREAD_ALIGN_SHIFT is 19 at the maximum. No need to clobber cr1, it can be preserved when moving r1 into CR when we check stack overflow. Signed-off-by: Christophe Leroy ---

[PATCH v1 07/15] powerpc: Remove address and errorcode arguments from do_page_fault()

2020-12-22 Thread Christophe Leroy
Let do_page_fault() retrieve address and errorcode from regs. This simplifies the code and shouldn't impeed performance as address and errorcode are likely still hot in the cache. Additional cleanup could be done in book3s/64 code once the same changes have been applied to hash_fault() handling.

[PATCH v1 06/15] powerpc: Remove address and errorcode arguments from do_break()

2020-12-22 Thread Christophe Leroy
Let do_break() retrieve address and errorcode from regs. This simplifies the code and shouldn't impeed performance as address and errorcode are likely still hot in the cache. Suggested-by: Nicholas Piggin Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/debug.h | 3 +--

[PATCH v1 01/15] powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too

2020-12-22 Thread Christophe Leroy
We need r1 to be properly set before activating MMU, otherwise any new exception taken while saving registers into the stack in syscall prologs will use the user stack, which is wrong and will even lockup or crash when KUAP is selected. Do that by switching the meaning of r11 and r1 until we have

[PATCH v1 03/15] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected

2020-12-22 Thread Christophe Leroy
It is now possible to only build book3s/32 kernel for CPUs without hash table. Opt out hash related code when CONFIG_PPC_BOOK3S_604 is not selected. Signed-off-by: Christophe Leroy --- v2: Rebased --- arch/powerpc/kernel/head_book3s_32.S | 12 arch/powerpc/mm/book3s32/Makefile

[PATCH v1 04/15] powerpc/32s: Do DABR match out of handle_page_fault()

2020-12-22 Thread Christophe Leroy
handle_page_fault() has some code dedicated to book3s/32 to call do_break() when the DSI is a DABR match. On other platforms, do_break() is handled separately. Do the same for book3s/32, do it earlier in the process of DSI. This change also avoid doing the test on ISI. Signed-off-by:

[PATCH v1 00/15] powerpc/32: Reduce head complexity and re-activate MMU earlier

2020-12-22 Thread Christophe Leroy
This series aims at reducing exception/syscall prologs complexity. It also brings earlier MMU re-activation. At the time being, we have two pathes in the prologs: one for when we have CONFIG_VMAP stack and one when we don't. Among 40x, 6xx and 8xx, only 40x doesn't support VMAP stack. When VMAP

[PATCH v1 02/15] powerpc/32s: Fix RTAS machine check with VMAP stack

2020-12-22 Thread Christophe Leroy
When we have VMAP stack, exception prolog 1 sets r1, not r11. Fixes: da7bb43ab9da ("powerpc/32: Fix vmap stack - Properly set r1 before activating MMU") Fixes: d2e006036082 ("powerpc/32: Use SPRN_SPRG_SCRATCH2 in exception prologs") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy ---

Re: GIT kernel with the PowerPC updates 5.11-1 doesn't boot on a FSL P5040 board and in a virtual e5500 QEMU machine

2020-12-22 Thread Michael Ellerman
Christian Zigotzky writes: > ... > Download: http://www.xenosoft.de/MintPPC32-X5000.tar.gz (md5sum: > b31c1c1ca1fcf5d4cdf110c4bce11654) The password for both 'root' and > 'mintppc' is 'mintppc'. ... > > QEMU command without KVM on macOS Intel: qemu-system-ppc64 -M ppce500 > -cpu e5500 -m 1024

Re: [PATCH] powerpc/boot: Fix build of dts/fsl

2020-12-22 Thread Michael Ellerman
On Tue, 15 Dec 2020 14:29:06 +1100, Michael Ellerman wrote: > The lkp robot reported that some configs fail to build, for example > mpc85xx_smp_defconfig, with: > > cc1: fatal error: opening output file > arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory > > This

Re: [PATCH 1/3] powerpc/vdso: Block R_PPC_REL24 relocations

2020-12-22 Thread Michael Ellerman
On Fri, 18 Dec 2020 22:16:17 +1100, Michael Ellerman wrote: > Add R_PPC_REL24 relocations to the list of relocations we do NOT > support in the VDSO. > > These are generated in some cases and we do not support relocating > them at runtime, so if they appear then the VDSO will not work at >

Re: [PATCH] powerpc/smp: Add __init to init_big_cores()

2020-12-22 Thread Michael Ellerman
On Mon, 21 Dec 2020 08:41:54 +0100, Cédric Le Goater wrote: > It fixes this link warning: > > WARNING: modpost: vmlinux.o(.text.unlikely+0x2d98): Section mismatch in > reference from the function init_big_cores.isra.0() to the function > .init.text:init_thread_group_cache_map() > The function

Re: [PATCH] powerpc/time: Force inlining of get_tb()

2020-12-22 Thread Michael Ellerman
On Sun, 20 Dec 2020 18:18:26 + (UTC), Christophe Leroy wrote: > Force inlining of get_tb() in order to avoid getting > following function in vdso32, leading to suboptimal > performance in clock_gettime() > > 0688 <.get_tb>: > 688: 7c 6d 42 a6 mftbu r3 > 68c: 7c 8c 42 a6 mftb

Re: [PATCH] powerpc/32s: Fix RTAS machine check with VMAP stack

2020-12-22 Thread Michael Ellerman
On Tue, 22 Dec 2020 07:11:18 + (UTC), Christophe Leroy wrote: > When we have VMAP stack, exception prolog 1 sets r1, not r11. Applied to powerpc/fixes. [1/1] powerpc/32s: Fix RTAS machine check with VMAP stack https://git.kernel.org/powerpc/c/9c7422b92cb27369653c371ad9c44a502e5eea8f

Re: [PATCH] powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too

2020-12-22 Thread Michael Ellerman
On Mon, 21 Dec 2020 06:18:03 + (UTC), Christophe Leroy wrote: > We need r1 to be properly set before activating MMU, otherwise any new > exception taken while saving registers into the stack in syscall > prologs will use the user stack, which is wrong and will even lockup > or crash when KUAP

Re: GIT kernel with the PowerPC updates 5.11-1 doesn't boot on a FSL P5040 board and in a virtual e5500 QEMU machine

2020-12-22 Thread Christian Zigotzky
Hello, I compiled the latest Git kernel today and unfortunately the boot issue still exists. I was able to reduce the patch for reverting the changes. In this way we know the problematic code now. vdso-v2.patch: diff -rupN a/arch/powerpc/kernel/vdso32/vgettimeofday.c