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.

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/

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

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

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

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

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

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

[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

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

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

[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

[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

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

[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

[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

[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

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

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

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

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

[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

[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

[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

[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

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 ?

[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

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

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.

[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

[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

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

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

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

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

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.

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

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

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

[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: [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,

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

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

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: [PATCH v4] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Qiujun Huang
On Mon, Apr 6, 2020 at 6:30 PM Michael Ellerman wrote: > > Qiujun Huang writes: > > Here needs a NULL check as kzalloc may fail returning NULL. > > > > Issue was found by coccinelle. > > Generated by: scripts/coccinelle/null/kmerr.cocci > > > > Signed-off-by: Qiujun Huang > > Reviewed-by:

Re: [PATCH v4] 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. I find this wording potentially confusing. * Such function calls will usually succeed to return a pointer. * The desired memory allocation can fail. * Please choose an imperative wording for the change description. >>> Issue was

[PATCH 4/6] binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump

2020-04-06 Thread Christoph Hellwig
There is no logic in elf_fdpic_core_dump itself that uses uaccess routines on kernel pointers, the file writes are nicely encapsulated in dump_emit which does its own set_fs. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf_fdpic.c | 31 --- 1 file changed, 12

[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

[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

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

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

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

[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(-)

[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

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

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

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

[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

[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

[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

[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

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

[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

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

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

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

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

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

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

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 >

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 >

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

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

Re: [PATCH v5 05/21] powerpc: Use a function for getting the instruction op code

2020-04-06 Thread Jordan Niethe
On Mon, Apr 6, 2020 at 6:22 PM Christophe Leroy wrote: > > > > Le 06/04/2020 à 10:09, Jordan Niethe a écrit : > > In preparation for using a data type for instructions that can not be > > directly used with the '>>' operator use a function for getting the op > > code of an instruction. > > > >

[PATCH v4] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Qiujun Huang
Here needs a NULL check as kzalloc may fail returning NULL. Issue was found by coccinelle. Generated by: scripts/coccinelle/null/kmerr.cocci Signed-off-by: Qiujun Huang Reviewed-by: Oliver O'Halloran --- v3->v4: Added the information about coccinelle script. Added change log.

Re: [PATCH 1/7] powerpc/powernv/npu: Clean up compound table group initialisation

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > Re-work the control flow a bit so what's going on is a little clearer. > This also ensures the table_group is only initialised once in the P9 > case. This shouldn't be a functional change since all the GPU PCI > devices should have the same

Re: [PATCH 2/7] powerpc/powernv/iov: Don't add VFs to iommu group during PE config

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > In pnv_ioda_setup_vf_PE() we register an iommu group for the VF PE > then call pnv_ioda_setup_bus_iommu_group() to add devices to that group. > However, this function is called before the VFs are scanned so there's > no devices to add. > >

Re: [PATCH 3/7] powerpc/powernv/pci: Register iommu group at PE DMA setup

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > Move the registration of IOMMU groups out of the post-phb init fixup and > into when we configure DMA for a PE. For most devices this doesn't > result in any functional changes, but for NVLink attached GPUs it > requires a bit of care. When the

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

2020-04-06 Thread Alistair Popple
> 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 > +++ b/arch/powerpc/include/asm/inst.h > @@ -8,23 +8,67 @@ > > struct ppc_inst { > u32 val; > +#ifdef __powerpc64__ > +

Re: [PATCH 4/7] powerpc/powernv/pci: Add device to iommu group during dma_dev_setup()

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > Historically adding devices to their respective iommu group has been > handled by the post-init phb fixup for most devices. This was done > because: > > 1) The IOMMU group is tied to the PE (usually) so we can only setup the >iommu groups

Re: [PATCH 5/7] powerpc/powernv/pci: Delete old iommu recursive iommu setup

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > No longer used. > > Signed-off-by: Oliver O'Halloran Nit: you could fold it into 4/7. Reviewed-by: Alexey Kardashevskiy > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 32 --- > 1 file changed, 32 deletions(-) >

Re: [PATCH 6/7] powerpc/powernv/pci: Move tce size parsing to pci-ioda-tce.c

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > Move it in with the rest of the TCE wrangling rather than carting around > a static prototype in pci-ioda.c > > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy > --- > arch/powerpc/platforms/powernv/pci-ioda-tce.c | 28

Re: [PATCH 7/7] powerpc/powernv/npu: Move IOMMU group setup into npu-dma.c

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > The NVlink IOMMU group setup is only relevant to NVLink devices so move > it into the NPU containment zone. This let us remove some prototypes in > pci.h and staticfy some function definitions. > > Signed-off-by: Oliver O'Halloran

Re: Make PowerNV IOMMU group setup saner (and fix it for hotpug)

2020-04-06 Thread Alexey Kardashevskiy
On 06/04/2020 13:07, Oliver O'Halloran wrote: > Currently on PowerNV the IOMMU group of a device is initialised in > boot-time fixup which runs after devices are probed. Because this is > only run at boot time hotplugged devices do not recieve an iommu group > assignment which prevents them

Re: [PATCH v3] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Markus Elfring
Here needs a NULL check. >> quite obvious? I suggest to consider another fine-tuning for the wording also around such “obvious” programming items. >>> I find this change description questionable >>> (despite of a reasonable patch subject). I got further development concerns.

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

2020-04-06 Thread Gautham R Shenoy
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, the > > PSSCR[ESL|EC] bits need to be cleared by the hypervisor before > >

[PATCH v5 00/21] Initial Prefixed Instruction support

2020-04-06 Thread Jordan Niethe
A future revision of the ISA will introduce prefixed instructions. A prefixed instruction is composed of a 4-byte prefix followed by a 4-byte suffix. All prefixes have the major opcode 1. A prefix will never be a valid word instruction. A suffix may be an existing word instruction or a new

[PATCH v5 01/21] powerpc/xmon: Remove store_inst() for patch_instruction()

2020-04-06 Thread Jordan Niethe
For modifying instructions in xmon, patch_instruction() can serve the same role that store_inst() is performing with the advantage of not being specific to xmon. In some places patch_instruction() is already being using followed by store_inst(). In these cases just remove the store_inst().

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

2020-04-06 Thread Jordan Niethe
create_branch(), create_cond_branch() and translate_branch() return the instruction that they create, or return 0 to signal an error. Seperate these concerns in preparation for an instruction type that is not just an unsigned int. Fill the created instruction to a pointer passed as the first

  1   2   >