Re: [PATCH v5 02/21] powerpc/xmon: Move out-of-line instructions to text section

2020-04-06 Thread Balamuruhan S
On Mon, 2020-04-06 at 18:09 +1000, Jordan Niethe wrote: > To execute an instruction out of line after a breakpoint, the NIP is set > to the address of struct bpt::instr. Here a copy of the instruction that > was replaced with a breakpoint is kept, along with a trap so normal flow > can be resumed a

Re: [PATCH v5 04/21] powerpc: Use a macro for creating instructions from u32s

2020-04-06 Thread Balamuruhan S
On Mon, 2020-04-06 at 18:09 +1000, Jordan Niethe wrote: > In preparation for instructions having a more complex data type start > using a macro, ppc_inst(), for making an instruction out of a u32. A > macro is used so that instructions can be used as initializer elements. > Currently this does not

Re: [PATCH v5 03/21] powerpc: Change calling convention for create_branch() et. al.

2020-04-06 Thread Jordan Niethe
On Tue, Apr 7, 2020 at 4:10 PM Balamuruhan S wrote: > > On Mon, 2020-04-06 at 18:09 +1000, Jordan Niethe wrote: > > create_branch(), create_cond_branch() and translate_branch() return the > > instruction that they create, or return 0 to signal an error. Seperate > > s/seperate/separate thanks. > >

Re: [PATCH v5 03/21] powerpc: Change calling convention for create_branch() et. al.

2020-04-06 Thread Balamuruhan S
On Mon, 2020-04-06 at 18:09 +1000, Jordan Niethe wrote: > create_branch(), create_cond_branch() and translate_branch() return the > instruction that they create, or return 0 to signal an error. Seperate s/seperate/separate > these concerns in preparation for an instruction type that is not just >

Re: [PATCH v12 5/8] powerpc/64: make buildable without CONFIG_COMPAT

2020-04-06 Thread Christophe Leroy
Le 20/03/2020 à 11:20, Michal Suchanek a écrit : There are numerous references to 32bit functions in generic and 64bit code so ifdef them out. Signed-off-by: Michal Suchanek --- v2: - fix 32bit ifdef condition in signal.c - simplify the compat ifdef condition in vdso.c - 64bit is redundant -

Re: [PATCH v3 15/15] powerpc: make unrecoverable NMIs die instead of panic

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : System Reset and Machine Check interrupts that are not recoverable due to being nested or interrupting when RI=0 currently panic. This is not necessary, and can often just kill the current context and recover. Signed-off-by: Nicholas Piggin

Re: [PATCH v3 14/15] powerpc/64s: system reset do not trace

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : Similarly to the previous patch, do not trace system reset. This code is used when there is a crash or hang, and tracing disturbs the system more and has been known to crash in the crash handling path. Acked-by: Naveen N. Rao Signed-off-by: Ni

Re: [PATCH v3 13/15] powerpc/64s: machine check do not trace real-mode handler

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : Rather than notrace annotations throughout a significant part of the machine check code across kernel/ pseries/ and powernv/ which can easily be broken and is infrequently tested, use paca->ftrace_enabled to blanket-disable tracing of the real-m

Re: [PATCH v3 12/15] powerpc: ftrace_enabled helper

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : Signed-off-by: Nicholas Piggin Reviewed-by: Christophe Leroy --- arch/powerpc/include/asm/ftrace.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace

Re: [PATCH v3 05/15] powerpc/pseries/ras: avoid calling rtas_token in NMI paths

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : In the interest of reducing code and possible failures in the machine check and system reset paths, grab the "ibm,nmi-interlock" token at init time. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin Reviewed-by: Christophe Leroy

Re: [PATCH v3 08/15] powerpc/pseries/ras: fwnmi sreset should not interlock

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : PAPR does not specify that fwnmi sreset should be interlocked, and PowerVM (and therefore now QEMU) do not require it. These "ibm,nmi-interlock" calls are ignored by firmware, but there is a possibility that the sreset could have interrupted a

Re: [PATCH v3 09/15] powerpc/pseries: limit machine check stack to 4GB

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : This allows rtas_args to be put on the machine check stack, which avoids a lot of complications with re-entrancy deadlocks. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin Reviewed-by: Christophe Leroy --- arch/powerpc/ke

Re: [PATCH v3 11/15] powerpc/64s: machine check interrupt update NMI accounting

2020-04-06 Thread Christophe Leroy
Le 07/04/2020 à 07:16, Nicholas Piggin a écrit : machine_check_early is taken as an NMI, so nmi_enter is used there. machine_check_exception is no longer taken as an NMI (it's invoked via irq_work in the case a machine check hits in kernel mode), so remove the nmi_enter from that case. Euh .

Re: [PATCH] powerpcs: perf: consolidate perf_callchain_user_64 and perf_callchain_user_32

2020-04-06 Thread Christophe Leroy
Le 06/04/2020 à 23:00, Michal Suchanek a écrit : perf_callchain_user_64 and perf_callchain_user_32 are nearly identical. Consolidate into one function with thin wrappers. Suggested-by: Nicholas Piggin Signed-off-by: Michal Suchanek --- arch/powerpc/perf/callchain.h| 24 +++

[PATCH v3 15/15] powerpc: make unrecoverable NMIs die instead of panic

2020-04-06 Thread Nicholas Piggin
System Reset and Machine Check interrupts that are not recoverable due to being nested or interrupting when RI=0 currently panic. This is not necessary, and can often just kill the current context and recover. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/traps.c | 6 +++--- 1 file chan

[PATCH v3 14/15] powerpc/64s: system reset do not trace

2020-04-06 Thread Nicholas Piggin
Similarly to the previous patch, do not trace system reset. This code is used when there is a crash or hang, and tracing disturbs the system more and has been known to crash in the crash handling path. Acked-by: Naveen N. Rao Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/traps.c | 5 ++

[PATCH v3 13/15] powerpc/64s: machine check do not trace real-mode handler

2020-04-06 Thread Nicholas Piggin
Rather than notrace annotations throughout a significant part of the machine check code across kernel/ pseries/ and powernv/ which can easily be broken and is infrequently tested, use paca->ftrace_enabled to blanket-disable tracing of the real-mode non-maskable handler. Acked-by: Naveen N. Rao Si

[PATCH v3 12/15] powerpc: ftrace_enabled helper

2020-04-06 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ftrace.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index f54a08a2cd70..bc76970b6ee5 100644 --- a/arch/powerpc/include/asm/ftrace.h +++ b/arc

[PATCH v3 11/15] powerpc/64s: machine check interrupt update NMI accounting

2020-04-06 Thread Nicholas Piggin
machine_check_early is taken as an NMI, so nmi_enter is used there. machine_check_exception is no longer taken as an NMI (it's invoked via irq_work in the case a machine check hits in kernel mode), so remove the nmi_enter from that case. In NMI context, hash faults don't try to refill the hash tab

[PATCH v3 10/15] powerpc/pseries: machine check use rtas_call_unlocked with args on stack

2020-04-06 Thread Nicholas Piggin
With the previous patch, machine checks can use rtas_call_unlocked which avoids the rtas spinlock which would deadlock if a machine check hits while making an rtas call. This also avoids the complex rtas error logging which has more rtas calls and includes kmalloc (which can return memory beyond R

[PATCH v3 09/15] powerpc/pseries: limit machine check stack to 4GB

2020-04-06 Thread Nicholas Piggin
This allows rtas_args to be put on the machine check stack, which avoids a lot of complications with re-entrancy deadlocks. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/setup_64.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) di

[PATCH v3 08/15] powerpc/pseries/ras: fwnmi sreset should not interlock

2020-04-06 Thread Nicholas Piggin
PAPR does not specify that fwnmi sreset should be interlocked, and PowerVM (and therefore now QEMU) do not require it. These "ibm,nmi-interlock" calls are ignored by firmware, but there is a possibility that the sreset could have interrupted a machine check and release the machine check's interloc

[PATCH v3 07/15] powerpc/pseries/ras: fwnmi avoid modifying r3 in error case

2020-04-06 Thread Nicholas Piggin
If there is some error with the fwnmi save area, r3 has already been modified which doesn't help with debugging. Only update r3 when to restore the saved value. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[PATCH v3 06/15] powerpc/pseries/ras: FWNMI_VALID off by one

2020-04-06 Thread Nicholas Piggin
This was discovered developing qemu fwnmi sreset support. This off-by-one bug means the last 16 bytes of the rtas area can not be used for a 16 byte save area. It's not a serious bug, and QEMU implementation has to retain a workaround for old kernels, but it's good to tighten it. Acked-by: Mahesh

[PATCH v3 05/15] powerpc/pseries/ras: avoid calling rtas_token in NMI paths

2020-04-06 Thread Nicholas Piggin
In the interest of reducing code and possible failures in the machine check and system reset paths, grab the "ibm,nmi-interlock" token at init time. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/firmware.h| 1 + arch/powerpc/platforms/pseries/ra

[PATCH v3 04/15] powerpc/64s/exceptions: machine check reconcile irq state

2020-04-06 Thread Nicholas Piggin
pseries fwnmi machine check code pops the soft-irq checks in rtas_call (after the previous patch to remove rtas_token from this call path). Rather than play whack a mole with these and forever having fragile code, it seems better to have the early machine check handler perform the same kind of reco

[PATCH v3 03/15] powerpc/64s/exceptions: Change irq reconcile for NMIs from reusing _DAR to RESULT

2020-04-06 Thread Nicholas Piggin
A spare interrupt stack slot is needed to save irq state when reconciling NMIs (sreset and decrementer soft-nmi). _DAR is used for this, but we want to reconcile machine checks as well, which do use _DAR. Switch to using RESULT instead, as it's used by system calls. Signed-off-by: Nicholas Piggin

[PATCH v3 02/15] powerpc/64s/exceptions: Fix in_mce accounting in unrecoverable path

2020-04-06 Thread Nicholas Piggin
Acked-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index bbf3109c5cba..3322000316ab 100644 --- a/arch/powerpc/kern

[PATCH v3 01/15] powerpc/64s/exception: Fix machine check no-loss idle wakeup

2020-04-06 Thread Nicholas Piggin
The architecture allows for machine check exceptions to cause idle wakeups which resume at the 0x200 address which has to return via the idle wakeup code, but the early machine check handler is run first. The case of a no state-loss sleep is broken because the early handler uses non-volatile regis

[PATCH v3 00/15] powerpc/64: machine check and system reset fixes

2020-04-06 Thread Nicholas Piggin
There's a bunch of problems we hit bringing up fwnmi sreset and testing with mce injection on QEMU. Mostly pseries issues. This series of fixes applies on top of next-test, the machine check reconcile patch won't apply cleanly to previous kernels but it might want to be backported. We can do that

Re: [PATCH v2 05/14] powerpc/pseries/ras: avoid calling rtas_token in NMI paths

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 4, 2020 12:30 am: > > > Le 03/04/2020 à 15:26, Nicholas Piggin a écrit : >> In the interest of reducing code and possible failures in the >> machine check and system reset paths, grab the "ibm,nmi-interlock" >> token at init time. >> >> Reviewed-by: Mahesh Salgaonkar

Re: [PATCH v2 09/14] powerpc/pseries: limit machine check stack to 4GB

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 4, 2020 12:19 am: > > > Le 03/04/2020 à 15:26, Nicholas Piggin a écrit : >> This allows rtas_args to be put on the machine check stack, which >> avoids a lot of complications with re-entrancy deadlocks. >> >> Reviewed-by: Mahesh Salgaonkar >> Signed-off-by: Nicholas

Re: [PATCH v2 13/14] powerpc/64s: system reset do not trace

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 4, 2020 12:45 am: > > > Le 03/04/2020 à 15:26, Nicholas Piggin a écrit : >> Similarly to the previous patch, do not trace system reset. This code >> is used when there is a crash or hang, and tracing disturbs the system >> more and has been known to crash in the crash

Re: [PATCH v2 08/14] powerpc/pseries/ras: fwnmi sreset should not interlock

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 4, 2020 12:35 am: > > > Le 03/04/2020 à 15:26, Nicholas Piggin a écrit : >> PAPR does not specify that fwnmi sreset should be interlocked, and >> PowerVM (and therefore now QEMU) do not require it. >> >> These "ibm,nmi-interlock" calls are ignored by firmware, but the

[PATCH v3] powerpc/uaccess: evaluate macro arguments once, before user access is allowed

2020-04-06 Thread Nicholas Piggin
get/put_user can be called with nontrivial arguments. fs/proc/page.c has a good example: if (put_user(stable_page_flags(ppage), out)) { stable_page_flags is quite a lot of code, including spin locks in the page allocator. Ensure these arguments are evaluated before user access is allowed. Th

Re: [PATCH v2 1/4] powerpc/64s: implement probe_kernel_read/write without touching AMR

2020-04-06 Thread Nicholas Piggin
Nicholas Piggin's on April 3, 2020 9:05 pm: > Christophe Leroy's on April 3, 2020 8:31 pm: >> >> >> Le 03/04/2020 à 11:35, Nicholas Piggin a écrit : >>> There is no need to allow user accesses when probing kernel addresses. >> >> I just discovered the following commit >> https://git.kernel.org/

Re: [PATCH v3 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-04-06 Thread Bharata B Rao
On Mon, Apr 06, 2020 at 12:41:01PM -0300, Leonardo Bras wrote: > Hello Bharata, > > On Fri, 2020-04-03 at 20:08 +0530, Bharata B Rao wrote: > > The patch would be more complete with the following change that ensures > > that DRCONF_MEM_HOTREMOVABLE flag is set for non-boot-time hotplugged > > memo

Re: [PATCH v2 0/2] Don't generate thousands of new warnings when building docs

2020-04-06 Thread Michael Ellerman
Mauro Carvalho Chehab writes: > This small series address a regression caused by a new patch at > docs-next (and at linux-next). > > Before this patch, when a cross-reference to a chapter within the > documentation is needed, we had to add a markup like: > > .. _foo: > > foo > ==

RE: [EXT] [PATCH 2/2] clk: qoriq: add cpufreq platform device

2020-04-06 Thread Andy Tang
> -Original Message- > From: Mian Yousaf Kaukab > Sent: 2020年4月4日 5:21 > To: linux...@vger.kernel.org; Andy Tang ; > shawn...@kernel.org; Leo Li > Cc: viresh.ku...@linaro.org; linux-ker...@vger.kernel.org; > linux-arm-ker...@lists.infradead.org; linuxppc-dev@lists.ozlabs.org; Mian > Yous

Linux-next POWER9 NULL pointer NIP since 1st Apr.

2020-04-06 Thread Qian Cai
Ever since 1st Apr, linux-next starts to trigger a NULL pointer NIP on POWER9 below using this config, https://raw.githubusercontent.com/cailca/linux-mm/master/powerpc.config It takes a while to reproduce, so before I bury myself into bisecting and just send a head-up to see if anyone spots any

Re: [PATCH v5 18/21] powerpc64: Add prefixed instructions to instruction data type

2020-04-06 Thread Alistair Popple
On Monday, 6 April 2020 8:42:57 PM AEST Jordan Niethe wrote: > On Mon, 6 Apr 2020, 7:52 pm Alistair Popple, wrote: > > > diff --git a/arch/powerpc/include/asm/inst.h > > > b/arch/powerpc/include/asm/inst.h index 70b37a35a91a..7e23e7146c66 > > > 100644 > > > --- a/arch/powerpc/include/asm/inst.h >

Re: [RFC PATCH v3 15/15] powerpc/kernel: Do not inconditionally save non volatile registers on system call

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 7, 2020 4:16 am: > + ret = syscall_exit_prepare_end(ret, regs, ti_flags); > + if (unlikely(ret & 0x8000)) { > + ret &= ~0x8000; We could just add our own set of defines for these, there's no real reason to use _TIF_RESTOREALL as I had. Thank

Re: [RFC PATCH v3 05/15] powerpc/irq: Add helpers to get and set regs->softe

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 7, 2020 4:16 am: > regs->softe doesn't exist on PPC32. > > Add helpers to get and set regs->softe. > Those helpers will void on PPC32. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/hw_irq.h | 21 +++-- > 1 file changed, 19 inser

Re: [PATCH v6 7/7] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers

2020-04-06 Thread Nicolin Chen
On Wed, Apr 01, 2020 at 04:45:40PM +0800, Shengjiu Wang wrote: > EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module > found on i.MX8MN. It is different with old ASRC module. > > The primary features for the EASRC are as follows: > - 4 Contexts - groups of channels with an indep

Re: [RFC PATCH v2 12/13] powerpc/kernel: Do not inconditionally save non volatile registers on system call

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 7, 2020 4:18 am: > > > Le 06/04/2020 à 03:25, Nicholas Piggin a écrit : >> Christophe Leroy's on April 6, 2020 3:44 am: >>> Before : 347 cycles on null_syscall >>> After : 327 cycles on null_syscall >> >> The problem I had doing this is that signal delivery wnats ful

Re: [RFC PATCH v2 05/13] powerpc/syscall: Rename syscall_64.c into syscall.c

2020-04-06 Thread Nicholas Piggin
Christophe Leroy's on April 7, 2020 4:20 am: > > > Le 06/04/2020 à 03:42, Nicholas Piggin a écrit : >> Christophe Leroy's on April 6, 2020 3:44 am: >>> syscall_64.c will be reused almost as is for PPC32. >>> >>> Rename it syscall.c >> >> Don't mind this, but I wonder if we can rename it to inter

[PATCH AUTOSEL 5.4 11/32] soc: fsl: dpio: register dpio irq handlers after dpio create

2020-04-06 Thread Sasha Levin
From: Grigore Popescu [ Upstream commit fe8fe7723a3a824790bda681b40efd767e2251a7 ] The dpio irqs must be registered when you can actually receive interrupts, ie when the dpios are created. Kernel goes through NULL pointer dereference errors followed by kernel panic [1] because the dpio irqs are

Re: [PATCH 1/6] powerpc/spufs: simplify spufs core dumping

2020-04-06 Thread Jeremy Kerr
Hi Christoph, > Replace the coredump ->read method with a ->dump method that must call > dump_emit itself. That way we avoid a buffer allocation an messing with > set_fs() to call into code that is intended to deal with user buffers. > For the ->get case we can now use a small on-stack buffer and

[PATCH AUTOSEL 5.5 12/35] soc: fsl: dpio: register dpio irq handlers after dpio create

2020-04-06 Thread Sasha Levin
From: Grigore Popescu [ Upstream commit fe8fe7723a3a824790bda681b40efd767e2251a7 ] The dpio irqs must be registered when you can actually receive interrupts, ie when the dpios are created. Kernel goes through NULL pointer dereference errors followed by kernel panic [1] because the dpio irqs are

Re: [PATCH v6 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common

2020-04-06 Thread Nicolin Chen
On Wed, Apr 01, 2020 at 04:45:38PM +0800, Shengjiu Wang wrote: > static int fsl_asrc_probe(struct platform_device *pdev) > { > struct device_node *np = pdev->dev.of_node; > struct fsl_asrc *asrc; > + struct fsl_asrc_priv *asrc_priv; Could we move it before "struct fsl_asrc *asrc

Re: [PATCH] selftests/powerpc: Always build the tm-poison test 64-bit

2020-04-06 Thread Gustavo Romero
On 04/06/2020 10:06 AM, Michael Ellerman wrote: On Fri, 2020-04-03 at 09:56:56 UTC, Michael Ellerman wrote: The tm-poison test includes inline asm which is 64-bit only, so the test must be built 64-bit in order to work. Otherwise it fails, eg: # file tm-poison tm-poison: ELF 32-bit MSB ex

Re: [PATCH v6 4/7] ASoC: fsl_asrc: Support new property fsl,asrc-format

2020-04-06 Thread Nicolin Chen
Just some small comments. On Wed, Apr 01, 2020 at 04:45:37PM +0800, Shengjiu Wang wrote: > In order to align with new ESARC, we add new property fsl,asrc-format. > The fsl,asrc-format can replace the fsl,asrc-width, driver > can accept format from devicetree, don't need to convert it to > format t

Re: [PATCH v6 3/7] ASoC: fsl-asoc-card: Support new property fsl,asrc-format

2020-04-06 Thread Nicolin Chen
On Wed, Apr 01, 2020 at 04:45:36PM +0800, Shengjiu Wang wrote: > In order to align with new ESARC, we add new property fsl,asrc-format. > The fsl,asrc-format can replace the fsl,asrc-width, driver > can accept format from devicetree, don't need to convert it to > format through width. > > Signed-o

[Bug 207129] PowerMac G4 DP (5.6.2 debug kernel + inline KASAN) freezes shortly after booting with "do_IRQ: stack overflow: 1760"

2020-04-06 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207129 --- Comment #4 from Erhard F. (erhar...@mailbox.org) --- Without CONFIG_VMAP_STACK I had one crash after 2-3 hours of building but the panic timer kicked in and rebooted the machine. Now it has been building packages for hours again without any an

Re: [PATCH v6 2/7] ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format

2020-04-06 Thread Nicolin Chen
On Wed, Apr 01, 2020 at 04:45:35PM +0800, Shengjiu Wang wrote: > In order to support new EASRC and simplify the code structure, > We decide to share the common structure between them. This bring > a problem that EASRC accept format directly from devicetree, but > ASRC accept width from devicetree.

Re: [RFC/PATCH 2/3] pseries/kvm: Clear PSSCR[ESL|EC] bits before guest entry

2020-04-06 Thread David Gibson
On Fri, Apr 03, 2020 at 03:01:03PM +0530, Gautham R Shenoy wrote: > On Fri, Apr 03, 2020 at 12:20:26PM +1000, Nicholas Piggin wrote: > > Gautham R. Shenoy's on March 31, 2020 10:10 pm: > > > From: "Gautham R. Shenoy" > > > > > > ISA v3.0 allows the guest to execute a stop instruction. For this, t

[PATCH] powerpcs: perf: consolidate perf_callchain_user_64 and perf_callchain_user_32

2020-04-06 Thread Michal Suchanek
perf_callchain_user_64 and perf_callchain_user_32 are nearly identical. Consolidate into one function with thin wrappers. Suggested-by: Nicholas Piggin Signed-off-by: Michal Suchanek --- arch/powerpc/perf/callchain.h| 24 +++- arch/powerpc/perf/callchain_32.c | 21 ++

Re: [PATCH v11 3/8] powerpc/perf: consolidate read_user_stack_32

2020-04-06 Thread Michal Suchánek
On Fri, Apr 03, 2020 at 05:13:25PM +1000, Nicholas Piggin wrote: > Michal Suchánek's on March 25, 2020 5:38 am: > > On Tue, Mar 24, 2020 at 06:48:20PM +1000, Nicholas Piggin wrote: > >> Michal Suchanek's on March 19, 2020 10:19 pm: > >> > There are two almost identical copies for 32bit and 64bit. >

Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-04-06 Thread Leonardo Bras
On Thu, 2020-04-02 at 22:28 +1100, Michael Ellerman wrote: > Leonardo Bras > TBH I think we could just drop that printk() entirely. > > Or we could tell printk() that we're in NMI context so that it uses the > percpu buffers. > > We should probably do the latter anyway, in case there's any othe

Re: [RFC PATCH v2 06/13] powerpc/syscall: Make syscall_64.c buildable on PPC32

2020-04-06 Thread Christophe Leroy
Le 06/04/2020 à 03:52, Nicholas Piggin a écrit : Christophe Leroy's on April 6, 2020 3:44 am: ifdef out specific PPC64 stuff to allow building syscall_64.c on PPC32. Modify Makefile to always build syscall.o Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile | 5 ++--- a

Re: [RFC PATCH v2 05/13] powerpc/syscall: Rename syscall_64.c into syscall.c

2020-04-06 Thread Christophe Leroy
Le 06/04/2020 à 03:42, Nicholas Piggin a écrit : Christophe Leroy's on April 6, 2020 3:44 am: syscall_64.c will be reused almost as is for PPC32. Rename it syscall.c Don't mind this, but I wonder if we can rename it to interrupt.c. Interrupt for me is irq. Maybe exception.c ? Exception

Re: [RFC PATCH v2 11/13] powerpc/syscall: Avoid stack frame in likely part of syscall_call_exception()

2020-04-06 Thread Christophe Leroy
Le 06/04/2020 à 03:29, Nicholas Piggin a écrit : Christophe Leroy's on April 6, 2020 3:44 am: When r3 is not modified, reload it from regs->orig_r3 to free volatile registers. This avoids a stack frame for the likely part of syscall_call_exception() Before : 353 cycles on null_syscall After

Re: [RFC PATCH v2 12/13] powerpc/kernel: Do not inconditionally save non volatile registers on system call

2020-04-06 Thread Christophe Leroy
Le 06/04/2020 à 03:25, Nicholas Piggin a écrit : Christophe Leroy's on April 6, 2020 3:44 am: Before : 347 cycles on null_syscall After : 327 cycles on null_syscall The problem I had doing this is that signal delivery wnats full regs, and you don't know if you have a signal pending ahead o

[RFC PATCH v3 15/15] powerpc/kernel: Do not inconditionally save non volatile registers on system call

2020-04-06 Thread Christophe Leroy
To allow that, syscall_exit_prepare() gets split in 3 parts. On PPC32, the three parts are called from entry_32.S On PPC64, we keep a syscall_exit_prepare() function which concatenates the three parts. One benefit is also that the likely part of syscall_exit_prepare_begin() and the syscall_exit_pr

[RFC PATCH v3 14/15] powerpc/syscall: Avoid stack frame in likely part of syscall_call_exception()

2020-04-06 Thread Christophe Leroy
When r3 is not modified, reload it from regs->orig_r3 to free volatile registers. This avoids a stack frame for the likely part of syscall_call_exception() Before : 353 cycles on null_syscall After : 347 cycles on null_syscall Before the patch: c000b4d4 : c000b4d4: 7c 08 02 a6 mflr

[RFC PATCH v3 13/15] powerpc/syscall: system call implement entry/exit logic in C for PPC32

2020-04-06 Thread Christophe Leroy
That's port of PPC64 syscall entry/exit logic in C to PPC32. Performancewise: Before : 311 cycles on null_syscall After : 353 cycles on null_syscall Note: before the patch, if calling NVGPRS all the time as well, we have 335 cycles on null_syscall Signed-off-by: Christophe Leroy --- arch/powe

[RFC PATCH v3 12/15] powerpc/syscall: Selectively check MSR_RI and MSR_PR on syscall entry

2020-04-06 Thread Christophe Leroy
In system_call_exception(), MSR_RI needs to also be checked on 8xx. Only book3e doesn't have MSR_RI. On PPC32, MSR_PR is checked in real mode to avoid clobbering the stack, so no need to check and panic in system_call_exception(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/syscall.

[RFC PATCH v3 11/15] powerpc/syscall: Save r3 in regs->orig_r3

2020-04-06 Thread Christophe Leroy
Save r3 in regs->orig_r3 in system_call_exception() Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_64.S | 1 - arch/powerpc/kernel/syscall.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index

[RFC PATCH v3 10/15] powerpc/syscall: Use is_compat_task()

2020-04-06 Thread Christophe Leroy
Instead of hard comparing task flags with _TIF_32BIT, use is_compat_task(). The advantage is that it returns 0 on PPC32 allthough _TIF_32BIT is always set. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arc

[RFC PATCH v3 07/15] powerpc/irq: Add stub irq_soft_mask_return() for PPC32

2020-04-06 Thread Christophe Leroy
To allow building syscall_64.c smoothly on PPC32, add stub version of irq_soft_mask_return(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hw_irq.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h inde

[RFC PATCH v3 09/15] powerpc/syscall: Make syscall_64.c buildable on PPC32

2020-04-06 Thread Christophe Leroy
ifdef out specific PPC64 stuff to allow building syscall_64.c on PPC32. Modify Makefile to always build syscall.o Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile | 5 ++--- arch/powerpc/kernel/syscall.c | 9 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --gi

[RFC PATCH v3 08/15] powerpc/syscall: Rename syscall_64.c into syscall.c

2020-04-06 Thread Christophe Leroy
syscall_64.c will be reused almost as is for PPC32. Rename it syscall.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile| 2 +- arch/powerpc/kernel/{syscall_64.c => syscall.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/powerpc/kernel/{sy

[RFC PATCH v3 06/15] powerpc/irq: Add new helpers to play with MSR_EE and MSR_RI on PPC32

2020-04-06 Thread Christophe Leroy
In preparation of porting PPC32 to C syscall entry/exit, add PPC32 version of following helpers: __hard_irq_enable() __hard_irq_disable() __hard_EE_RI_disable() __hard_RI_enable() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hw_irq.h | 15 +

[RFC PATCH v3 05/15] powerpc/irq: Add helpers to get and set regs->softe

2020-04-06 Thread Christophe Leroy
regs->softe doesn't exist on PPC32. Add helpers to get and set regs->softe. Those helpers will void on PPC32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hw_irq.h | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm

[RFC PATCH v3 04/15] powerpc/8xx: Create C version of kuap_restore() and kuap_check()

2020-04-06 Thread Christophe Leroy
In preparation of porting PPC32 to C syscall entry/exit, create C version of kuap_restore() and kuap_check() on 8xx Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/kup-8xx.h | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/include/asm/nohash/

[RFC PATCH v3 03/15] powerpc/32s: Create C version of kuap_restore() and kuap_check()

2020-04-06 Thread Christophe Leroy
In preparation of porting PPC32 to C syscall entry/exit, create C version of kuap_restore() and kuap_check() on book3s/32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/powerpc/include/

[RFC PATCH v3 02/15] powerpc/radix: Make kuap_check_amr() and kuap_restore_amr() generic

2020-04-06 Thread Christophe Leroy
In preparation of porting powerpc32 to C syscall entry/exit, rename kuap_check_amr() and kuap_restore_amr() as kuap_check() and kuap_restore(), and move the stub for when CONFIG_PPC_KUAP is not selected in the generic asm/kup.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/

[RFC PATCH v3 01/15] powerpc/syscall: Refactorise from Nick

2020-04-06 Thread Christophe Leroy
From: Nicholas Piggin Christophe Leroy's on April 6, 2020 3:44 am: > ifdef out specific PPC64 stuff to allow building > syscall_64.c on PPC32. > > Modify Makefile to always build syscall.o > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/Makefile | 5 ++--- > arch/powerpc/kerne

[PATCH 1/1] powerpc/crash: Use NMI context for printk after crashing other CPUs

2020-04-06 Thread Leonardo Bras
Currently, if printk lock (logbuf_lock) is held by other thread during crash, there is a chance of deadlocking the crash on next printk, and blocking a possibly desired kdump. After sending IPI to all other CPUs, make printk enter in NMI context, as it will use per-cpu buffers to store the message

Re: [PATCH] powerpc/mce: Add MCE notification chain

2020-04-06 Thread Mahesh J Salgaonkar
On 2020-04-06 12:17:22 Mon, Nicholas Piggin wrote: > Ganesh's on April 4, 2020 11:05 pm: > > On 4/3/20 7:38 AM, Nicholas Piggin wrote: > > > >> Ganesh Goudar's on March 30, 2020 5:12 pm: > >>> From: Santosh S > >>> > >>> Introduce notification chain which lets know about uncorrected memory > >>>

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-06 Thread Christoph Hellwig
On Mon, Apr 06, 2020 at 11:25:09PM +1000, Alexey Kardashevskiy wrote: > >> Do you see any serious problem with this approach? Thanks! > > > > Do you have a link to the whole branch? The github UI is unfortunately > > unusable for that (or I'm missing something). > > The UI shows the branch but s

[PATCH v2] powerpc/vio: drop bus_type from parent device

2020-04-06 Thread Thadeu Lima de Souza Cascardo
Commit df44b479654f62b478c18ee4d8bc4e9f897a9844 ("kobject: return error code if writing /sys/.../uevent fails") started returning failure when writing to /sys/devices/vio/uevent. This causes an early udevadm trigger to fail. On some installer versions of Ubuntu, this will cause init to exit, thus

Re: [PATCH v3 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-04-06 Thread Leonardo Bras
Hello Bharata, On Fri, 2020-04-03 at 20:08 +0530, Bharata B Rao wrote: > The patch would be more complete with the following change that ensures > that DRCONF_MEM_HOTREMOVABLE flag is set for non-boot-time hotplugged > memory too. This will ensure that ibm,dynamic-memory-vN property > reflects the

Re: [PATCH v5 1/2] powerpc/powernv: Return directly after a failed of_property_read_u64_array() in opal_add_one_export()

2020-04-06 Thread Markus Elfring
> We don't need to go to the labal of out … Please avoid a typo for this change description. > fails, as there is nothing to do. Just return. I suggest to reconsider also this wording. Return directly after a call of the function “of_property_read_u64_array” failed at the beginning. > An

Re: [PATCH v8 1/7] perf expr: Add expr_ prefix for parse_ctx and parse_id

2020-04-06 Thread Arnaldo Carvalho de Melo
Em Thu, Apr 02, 2020 at 02:03:34AM +0530, Kajol Jain escreveu: > From: Jiri Olsa > > Adding expr_ prefix for parse_ctx and parse_id, > to straighten out the expr* namespace. > > There's no functional change. Next time please add your Signed-off-by: as well when pushing 3rd party patches. Appli

Re: [PATCH v5 2/2] powerpc/powernv: Add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Markus Elfring
> Here needs a NULL check, as kzalloc may fail returning NULL. > > Issue was found by coccinelle. * Do you really try to ignore (my) specific patch review comments (for a moment)? https://lore.kernel.org/linuxppc-dev/b7d64d4a-74dd-ee21-db7b-018070f12...@web.de/ https://lore.kernel.org/patch

Re: [PATCH v5 1/2] powerpc/powernv: Remove two unnecessary variable initialisations in opal_add_one_export()

2020-04-06 Thread Markus Elfring
> And we can remove the redundant assignments to attr and name. How do you think about a wording like the following? Two local variables will eventually be set to appropriate pointers a bit later. Thus omit their explicit initialisation at the beginning. Regards, Markus

Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 21:50, Christoph Hellwig wrote: > On Fri, Apr 03, 2020 at 07:38:11PM +1100, Alexey Kardashevskiy wrote: >> >> >> On 26/03/2020 12:26, Alexey Kardashevskiy wrote: >>> >>> >>> On 25/03/2020 19:37, Christoph Hellwig wrote: On Wed, Mar 25, 2020 at 03:51:36PM +1100, Alexey Kardashe

Re: [PATCH 1/6] powerpc/spufs: simplify spufs core dumping

2020-04-06 Thread Arnd Bergmann
On Mon, Apr 6, 2020 at 2:03 PM Christoph Hellwig wrote: > > Replace the coredump ->read method with a ->dump method that must call > dump_emit itself. That way we avoid a buffer allocation an messing with > set_fs() to call into code that is intended to deal with user buffers. > For the ->get cas

Re: [PATCH] powerpc: improve ppc_save_regs

2020-04-06 Thread Michael Ellerman
On Fri, 2020-04-03 at 13:10:05 UTC, Nicholas Piggin wrote: > Make ppc_save_regs a bit more useful: > - Set NIP to our caller rather rather than the caller's caller (which is > what we save to LR in the stack frame). > - Set SOFTE to the current irq soft-mask state rather than > uninitialised. >

Re: [PATCH] selftests/powerpc: Always build the tm-poison test 64-bit

2020-04-06 Thread Michael Ellerman
On Fri, 2020-04-03 at 09:56:56 UTC, Michael Ellerman wrote: > The tm-poison test includes inline asm which is 64-bit only, so the > test must be built 64-bit in order to work. > > Otherwise it fails, eg: > # file tm-poison > tm-poison: ELF 32-bit MSB executable, PowerPC or cisco 4500, version

Re: [PATCH] powerpc/64s: Fix doorbell wakeup msgclr optimisation

2020-04-06 Thread Michael Ellerman
On Thu, 2020-04-02 at 12:12:12 UTC, Nicholas Piggin wrote: > Commit 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C") > broke the doorbell wakeup optimisation introduced by commit a9af97aa0a12 > ("powerpc/64s: msgclr when handling doorbell exceptions from system > reset"). > > This

Re: [PATCH] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-06 Thread Michael Ellerman
On Thu, 2020-04-02 at 12:04:01 UTC, Nicholas Piggin wrote: > This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. > > That commit does not play well with soft-masked irq state manipulations > in idle, interrupt replay, and possibly others due to tracing code > sometimes using irq_work_que

Re: [PATCH kernel] powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory

2020-04-06 Thread Michael Ellerman
On Tue, 2020-03-31 at 01:23:38 UTC, Alexey Kardashevskiy wrote: > Unlike normal memory ("memory" compatible type in the FDT), > the persistent memory ("ibm,pmemory" in the FDT) can be mapped anywhere > in the guest physical space and it can be used for DMA. > > In order to maintain 1:1 mapping via

Re: [PATCH 6/9] powerpc/ps3: Set CONFIG_UEVENT_HELPER=y in ps3_defconfig

2020-04-06 Thread Michael Ellerman
On Fri, 2020-03-27 at 20:26:23 UTC, Geoff Levand wrote: > Set CONFIG_UEVENT_HELPER=y in ps3_defconfig. > > commit 1be01d4a57142ded23bdb9e0c8d9369e693b26cc (driver: base: Disable > CONFIG_UEVENT_HELPER by default) disabled the CONFIG_UEVENT_HELPER option > that is needed for hotplug and module load

Re: [PATCH] selftests/eeh: Skip ahci adapters

2020-04-06 Thread Michael Ellerman
On Thu, 2020-03-26 at 06:11:44 UTC, Michael Ellerman wrote: > The ahci driver doesn't support error recovery, and if your root > filesystem is attached to it the eeh-basic.sh test will likely kill > your machine. > > So skip any device we see using the ahci driver. > > Signed-off-by: Michael Elle

Re: [PATCH 4/9] powerpc/ps3: remove an unneeded NULL check

2020-04-06 Thread Michael Ellerman
On Fri, 2020-03-27 at 20:26:23 UTC, Geoff Levand wrote: > From: Dan Carpenter > > Static checkers don't like the inconsistent NULL checking on "ops". > This function is only called once and "ops" isn't NULL so the check can > be removed. > > Signed-off-by: Dan Carpenter > Signed-off-by: Geoff L

Re: [PATCH 1/9] powerpc/ps3: Remove duplicate error messages

2020-04-06 Thread Michael Ellerman
On Fri, 2020-03-27 at 20:26:23 UTC, Geoff Levand wrote: > From: Markus Elfring > > Remove duplicate memory allocation failure error messages. > > Signed-off-by: Markus Elfring > Signed-off-by: Geoff Levand Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/7ee417497a29028502cf

Re: [PATCH v12 1/8] powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro

2020-04-06 Thread Michael Ellerman
On Fri, 2020-03-20 at 10:20:12 UTC, Michal Suchanek wrote: > This partially reverts commit caf6f9c8a326 ("asm-generic: Remove > unneeded __ARCH_WANT_SYS_LLSEEK macro") > > When CONFIG_COMPAT is disabled on ppc64 the kernel does not build. > > There is resistance to both removing the llseek syscal

Re: [PATCH v2] powerpc/pseries: Fix MCE handling on pseries

2020-04-06 Thread Michael Ellerman
On Fri, 2020-03-20 at 11:01:19 UTC, Ganesh Goudar wrote: > MCE handling on pSeries platform fails as recent rework to use common > code for pSeries and PowerNV in machine check error handling tries to > access per-cpu variables in realmode. The per-cpu variables may be > outside the RMO region on p

  1   2   >