Re: [PATCH 0/3] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-09 Thread Jerome Glisse
On Mon, Apr 09, 2018 at 04:07:21PM +0200, Michal Hocko wrote: > On Mon 09-04-18 15:57:06, Laurent Dufour wrote: > > The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the > > per architecture header files. This doesn't allow to make other > > configuration dependent on it. > >

Re: [PATCH 0/3] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-09 Thread Vineet Gupta
On 04/09/2018 06:57 AM, Laurent Dufour wrote: The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the per architecture header files. This doesn't allow to make other configuration dependent on it. So I understand this series has more "readability" value and I'm fine with this

ppc compat v4.16 regression: sending SIGTRAP or SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-09 Thread Dmitry V. Levin
Hi, There seems to be a regression in v4.16 on ppc compat very similar to sparc compat regression reported earlier at https://marc.info/?l=linux-sparc=151501500704383 . The symptoms are exactly the same: the same signal_receive test from the strace test suite fails with the same diagnostics:

Re: [PATCH 0/3] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-09 Thread Laurent Dufour
On 09/04/2018 18:03, Vineet Gupta wrote: > On 04/09/2018 06:57 AM, Laurent Dufour wrote: >> The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the >> per architecture header files. This doesn't allow to make other >> configuration dependent on it. > > So I understand this

[PATCH 4/6] powerpc/powernv: move opal console flushing to udbg

2018-04-09 Thread Nicholas Piggin
OPAL console writes do not have to synchronously flush firmware / hardware buffers unless they are going through the udbg path. Remove the unconditional flushing from opal_put_chars. Flush if there was no space in the buffer as an optimisation (callers loop waiting for success in that case). udbg

Re: [PATCH 5/6] powerpc/powernv: implement opal_put_chars_nonatomic

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > The RAW console does not need writes to be atomic, so implement a > _nonatomic variant which does not take a spinlock. This API is used > in xmon, so the less locking thta's used, the better chance there is > that a crash can be debugged.

Re: [PATCH 6/6] drivers/tty/hvc: remove unexplained "just in case" spin delay

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > This delay was in the very first OPAL console commit 6.5 years ago. > The firmware console has hardened sufficiently to remove it. > Reviewed-by: Benjamin Herrenschmidt > Signed-off-by: Nicholas Piggin

[PATCH 6/6] drivers/tty/hvc: remove unexplained "just in case" spin delay

2018-04-09 Thread Nicholas Piggin
This delay was in the very first OPAL console commit 6.5 years ago. The firmware console has hardened sufficiently to remove it. Cc: Benjamin Herrenschmidt Signed-off-by: Nicholas Piggin --- drivers/tty/hvc/hvc_opal.c | 8 +--- 1 file changed, 1

Re: [PATCH v2 4/9] powerpc/powernv: OPAL console standardise OPAL_BUSY loops

2018-04-09 Thread Nicholas Piggin
On Mon, 09 Apr 2018 15:53:33 +1000 Benjamin Herrenschmidt wrote: > On Mon, 2018-04-09 at 15:24 +1000, Nicholas Piggin wrote: > > Convert to using the standard delay poll/delay form. > > > > The console code: > > > > - Did not previously delay or sleep in its busy

Re: [PATCH 5/6] powerpc/powernv: implement opal_put_chars_nonatomic

2018-04-09 Thread Nicholas Piggin
On Mon, 09 Apr 2018 15:57:55 +1000 Benjamin Herrenschmidt wrote: > On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > > The RAW console does not need writes to be atomic, so implement a > > _nonatomic variant which does not take a spinlock. This API is used > >

Re: [PATCH v2 3/9] powerpc/powernv: opal_put_chars partial write fix

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 15:24 +1000, Nicholas Piggin wrote: > The intention here is to consume and discard the remaining buffer > upon error. This works if there has not been a previous partial write. > If there has been, then total_len is no longer total number of bytes > to copy. total_len is

Re: [PATCH v2 4/9] powerpc/powernv: OPAL console standardise OPAL_BUSY loops

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 15:24 +1000, Nicholas Piggin wrote: > Convert to using the standard delay poll/delay form. > > The console code: > > - Did not previously delay or sleep in its busy loop. > > Cc: Benjamin Herrenschmidt > Signed-off-by: Nicholas Piggin

Re: [PATCH 2/3] mm: replace __HAVE_ARCH_PTE_SPECIAL

2018-04-09 Thread Christoph Hellwig
> -#ifdef __HAVE_ARCH_PTE_SPECIAL > +#ifdef CONFIG_ARCH_HAS_PTE_SPECIAL > # define HAVE_PTE_SPECIAL 1 > #else > # define HAVE_PTE_SPECIAL 0 I'd say kill this odd indirection and just use the CONFIG_ARCH_HAS_PTE_SPECIAL symbol directly.

Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Christoph Hellwig
On Mon, Apr 09, 2018 at 05:46:04PM +1000, Oliver O'Halloran wrote: > Some OF platforms (pseries and some SPARC systems) has their own > implementations of NUMA affinity detection rather than using the generic > OF_NUMA driver, which mainly exists for arm64. For other platforms one > of two

Re: [PATCH 2/3] mm: replace __HAVE_ARCH_PTE_SPECIAL

2018-04-09 Thread David Rientjes
On Mon, 9 Apr 2018, Christoph Hellwig wrote: > > -#ifdef __HAVE_ARCH_PTE_SPECIAL > > +#ifdef CONFIG_ARCH_HAS_PTE_SPECIAL > > # define HAVE_PTE_SPECIAL 1 > > #else > > # define HAVE_PTE_SPECIAL 0 > > I'd say kill this odd indirection and just use the > CONFIG_ARCH_HAS_PTE_SPECIAL symbol

Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Rob Herring
On Mon, Apr 9, 2018 at 2:46 AM, Oliver O'Halloran wrote: > Some OF platforms (pseries and some SPARC systems) has their own > implementations of NUMA affinity detection rather than using the generic > OF_NUMA driver, which mainly exists for arm64. For other platforms one > of

Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Dan Williams
On Mon, Apr 9, 2018 at 1:52 PM, Rob Herring wrote: > On Mon, Apr 9, 2018 at 2:46 AM, Oliver O'Halloran wrote: >> Some OF platforms (pseries and some SPARC systems) has their own >> implementations of NUMA affinity detection rather than using the generic >>

Re: [PATCH 1/2] powerpc/mm: Flush cache on memory hot(un)plug

2018-04-09 Thread Reza Arbab
On Fri, Apr 06, 2018 at 03:24:23PM +1000, Balbir Singh wrote: This patch adds support for flushing potentially dirty cache lines when memory is hot-plugged/hot-un-plugged. Acked-by: Reza Arbab -- Reza Arbab

Re: [PATCH] ASoC: fsl_esai: Fix divisor calculation failure at lower ratio

2018-04-09 Thread Marek Vasut
On 04/09/2018 01:57 AM, Nicolin Chen wrote: > When the desired ratio is less than 256, the savesub (tolerance) > in the calculation would become 0. This will then fail the loop- > search immediately without reporting any errors. > > But if the ratio is smaller enough, there is no need to

Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Rob Herring
On Mon, Apr 9, 2018 at 4:05 PM, Dan Williams wrote: > On Mon, Apr 9, 2018 at 1:52 PM, Rob Herring wrote: >> On Mon, Apr 9, 2018 at 2:46 AM, Oliver O'Halloran wrote: >>> Some OF platforms (pseries and some SPARC systems) has their own

[PATCH] powerpc/modules: Fix crashes by adding CONFIG_RELOCATABLE to vermagic

2018-04-09 Thread Michael Ellerman
If you build the kernel with CONFIG_RELOCATABLE=n, then install the modules, rebuild the kernel with CONFIG_RELOCATABLE=y and leave the old modules installed, we crash something like: Unable to handle kernel paging request for data at address 0xd00018d66cef Faulting instruction address:

Occasionally losing the tick_sched_timer

2018-04-09 Thread Nicholas Piggin
We are seeing rare hard lockup watchdog timeouts, a CPU seems to have no more timers scheduled, despite hard and soft lockup watchdogs should have their heart beat timers and probably many others. The reproducer we have is running a KVM workload. The lockup is in the host kernel, quite rare but

Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Dan Williams
On Mon, Apr 9, 2018 at 6:02 PM, Rob Herring wrote: > On Mon, Apr 9, 2018 at 4:05 PM, Dan Williams wrote: >> On Mon, Apr 9, 2018 at 1:52 PM, Rob Herring wrote: >>> On Mon, Apr 9, 2018 at 2:46 AM, Oliver O'Halloran

Re: [PATCH v3] powerpc/64: Fix section mismatch warnings for early boot symbols

2018-04-09 Thread Michael Ellerman
Mauricio Faria de Oliveira writes: > Some of the boot code located at the start of kernel text is "init" > class, in that it only runs at boot time, however marking it as normal > init code is problematic because that puts it into a different section > located at the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode

2018-04-09 Thread Michael Ellerman
Nicholas Piggin writes: > On Sun, 8 Apr 2018 20:17:47 +1000 > Balbir Singh wrote: > >> On Fri, Apr 6, 2018 at 3:56 AM, Nicholas Piggin wrote: >> > This crashes with a "Bad real address for load" attempting to load >> > from the

Re: [PATCH v2 9/9] powerpc/powernv: opal-kmsg standardise OPAL_BUSY handling

2018-04-09 Thread Russell Currey
On Mon, 2018-04-09 at 15:24 +1000, Nicholas Piggin wrote: > OPAL_CONSOLE_FLUSH is documented as being able to return OPAL_BUSY, > so implement the standard OPAL_BUSY handling for it. > > Cc: Russell Currey > Signed-off-by: Nicholas Piggin Reviewed-by:

Re: [PATCH 1/6] powerpc/powernv: opal-kmsg use flush fallback from console code

2018-04-09 Thread Russell Currey
On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > Use the more refined and tested event polling loop from > opal_put_chars > as the fallback console flush in the opal-kmsg path. This loop is > used > by the console driver today, whereas the opal-kmsg fallback is not > likely to have been

Re: [PATCH 2/6] powerpc/powernv: Implement and use opal_flush_console

2018-04-09 Thread Russell Currey
On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > A new console flushing firmware API was introduced to replace event > polling loops, and implemented in opal-kmsg with affddff69c55e > ("powerpc/powernv: Add a kmsg_dumper that flushes console output on > panic"), to flush the console in

Re: [PATCH 1/2] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode

2018-04-09 Thread Naveen N. Rao
Michael Ellerman wrote: Nicholas Piggin writes: On Sun, 8 Apr 2018 20:17:47 +1000 Balbir Singh wrote: On Fri, Apr 6, 2018 at 3:56 AM, Nicholas Piggin wrote: > This crashes with a "Bad real address for load" attempting to load >

[PATCH 1/4] powerpc/perf: Rearrange memory freeing in imc init

2018-04-09 Thread Anju T Sudhakar
When any of the IMC (In-Memory Collection counter) devices fail to initialize, imc_common_mem_free() frees set of memory. In doing so, pmu_ptr pointer is also freed. But pmu_ptr pointer is used in subsequent function (imc_common_cpuhp_mem_free()) which is wrong. Patch here reorders the code to

[PATCH 4/4] powerpc/perf: Unregister thread-imc if core-imc not supported

2018-04-09 Thread Anju T Sudhakar
Enable thread-imc in the kernel, only if core-imc is registered. Signed-off-by: Anju T Sudhakar --- arch/powerpc/include/asm/imc-pmu.h| 1 + arch/powerpc/perf/imc-pmu.c | 12 arch/powerpc/platforms/powernv/opal-imc.c | 9 + 3

[PATCH 3/4] powerpc/perf: Return appropriate value for unknown domain

2018-04-09 Thread Anju T Sudhakar
Return proper error code for unknown domain during IMC initialization. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index

Re: [PATCH] ASoC: fsl_ssi: Fix mode setting when changing channel number

2018-04-09 Thread Mika Penttilä
On 04/08/2018 07:40 AM, Nicolin Chen wrote: > This is a partial revert (in a cleaner way) of commit ebf08ae3bc90 > ("ASoC: fsl_ssi: Keep ssi->i2s_net updated") to fix a regression > at test cases when switching between mono and stereo audio. > > The problem is that ssi->i2s_net is initialized in

[PATCH 0/4] powerpc/perf: IMC Cleanups

2018-04-09 Thread Anju T Sudhakar
This patch series includes some cleanups and Unregistration of thread-imc pmu, if the kernel does not have core-imc registered. The entire patch set has been verified using the static

[PATCH 2/4] powerpc/perf: Replace the direct return with goto statement

2018-04-09 Thread Anju T Sudhakar
Replace the direct return statement in imc_mem_init() with goto, to adhere to the kernel coding style. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

Re: [PATCH 5/6] powerpc/powernv: implement opal_put_chars_nonatomic

2018-04-09 Thread Nicholas Piggin
On Mon, 09 Apr 2018 18:24:46 +1000 Benjamin Herrenschmidt wrote: > On Mon, 2018-04-09 at 16:23 +1000, Nicholas Piggin wrote: > > On Mon, 09 Apr 2018 15:57:55 +1000 > > Benjamin Herrenschmidt wrote: > > > > > On Mon, 2018-04-09 at 15:40

Re: [PATCH 5/6] powerpc/powernv: implement opal_put_chars_nonatomic

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 16:23 +1000, Nicholas Piggin wrote: > On Mon, 09 Apr 2018 15:57:55 +1000 > Benjamin Herrenschmidt wrote: > > > On Mon, 2018-04-09 at 15:40 +1000, Nicholas Piggin wrote: > > > The RAW console does not need writes to be atomic, so implement a > > >

Re: [PATCH V6 2/4] powerpc/mm: Add support for handling > 512TB address in SLB miss

2018-04-09 Thread Christophe LEROY
Le 09/04/2018 à 10:33, Aneesh Kumar K.V a écrit : On 04/09/2018 12:49 PM, Christophe LEROY wrote: Le 26/03/2018 à 12:04, Aneesh Kumar K.V a écrit : For addresses above 512TB we allocate additional mmu contexts. To make it all easy, addresses above 512TB are handled with IR/DR=1 and with

Re: [PATCH V6 2/4] powerpc/mm: Add support for handling > 512TB address in SLB miss

2018-04-09 Thread Christophe LEROY
Le 26/03/2018 à 12:04, Aneesh Kumar K.V a écrit : For addresses above 512TB we allocate additional mmu contexts. To make it all easy, addresses above 512TB are handled with IR/DR=1 and with stack frame setup. The mmu_context_t is also updated to track the new extended_ids. To support upto 4PB

Re: [PATCH v2 4/9] powerpc/powernv: OPAL console standardise OPAL_BUSY loops

2018-04-09 Thread Benjamin Herrenschmidt
On Mon, 2018-04-09 at 16:13 +1000, Nicholas Piggin wrote: > We can always make exceptions to the standard form, but in those > cases I would like to document it in the OPAL API and comment for > the Linux side. > > My thinking in this case is that it reduces time in firmware and > in particular

Re: [PATCH V6 2/4] powerpc/mm: Add support for handling > 512TB address in SLB miss

2018-04-09 Thread Aneesh Kumar K.V
On 04/09/2018 12:49 PM, Christophe LEROY wrote: Le 26/03/2018 à 12:04, Aneesh Kumar K.V a écrit : For addresses above 512TB we allocate additional mmu contexts. To make it all easy, addresses above 512TB are handled with IR/DR=1 and with stack frame setup. The mmu_context_t is also updated

[PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA

2018-04-09 Thread Oliver O'Halloran
Some OF platforms (pseries and some SPARC systems) has their own implementations of NUMA affinity detection rather than using the generic OF_NUMA driver, which mainly exists for arm64. For other platforms one of two fallbacks provided by the base OF driver are used depending on CONFIG_NUMA. In

Re: [PATCH] powerpc/64: irq_work avoid immediate interrupt when raised with hard irqs enabled

2018-04-09 Thread Benjamin Herrenschmidt
On Fri, 2018-04-06 at 00:31 +1000, Nicholas Piggin wrote: > irq_work_raise should not schedule the hardware decrementer interrupt > unless it is called from NMI context. Doing so often just results in an > immediate masked decrementer interrupt: > ><...>-55090d...4us : update_curr_rt

Re: [PATCH] powerpc/64: irq_work avoid immediate interrupt when raised with hard irqs enabled

2018-04-09 Thread Nicholas Piggin
On Mon, 09 Apr 2018 18:46:29 +1000 Benjamin Herrenschmidt wrote: > On Fri, 2018-04-06 at 00:31 +1000, Nicholas Piggin wrote: > > irq_work_raise should not schedule the hardware decrementer interrupt > > unless it is called from NMI context. Doing so often just results

[PATCH RFC] hvc: provide a flush operation, implement for opal console, and use in hvc console

2018-04-09 Thread Nicholas Piggin
This patch is not quite polished and needs to be split out, but the idea is to move busy waits in hvc console drivers out from under locks and into the main hvc driver where it can sleep. The flush op allows for a 0 timeout which reverts to spin wait behaviour to cater for polling cases. A

[PATCH 2/3] mm: replace __HAVE_ARCH_PTE_SPECIAL

2018-04-09 Thread Laurent Dufour
Replace __HAVE_ARCH_PTE_SPECIAL by the new configuration variable CONFIG_ARCH_HAS_PTE_SPECIAL. Signed-off-by: Laurent Dufour --- Documentation/features/vm/pte_special/arch-support.txt | 2 +- include/linux/pfn_t.h | 4 ++-- mm/gup.c

[PATCH 1/3] mm: introduce ARCH_HAS_PTE_SPECIAL

2018-04-09 Thread Laurent Dufour
Currently the PTE special supports is turned on in per architecture header files. Most of the time, it is defined in arch/*/include/asm/pgtable.h depending or not on some other per architecture static definition. This patch introduce a new configuration variable to manage this directly in the

[PATCH 3/3] mm: remove __HAVE_ARCH_PTE_SPECIAL

2018-04-09 Thread Laurent Dufour
It is now replaced by Kconfig variable CONFIG_ARCH_HAS_PTE_SPECIAL. Signed-off-by: Laurent Dufour --- arch/arc/include/asm/pgtable.h | 2 -- arch/arm/include/asm/pgtable-3level.h| 1 - arch/arm64/include/asm/pgtable.h | 2 --

Re: [PATCH 0/3] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-09 Thread Michal Hocko
On Mon 09-04-18 15:57:06, Laurent Dufour wrote: > The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the > per architecture header files. This doesn't allow to make other > configuration dependent on it. > > This series is moving the __HAVE_ARCH_PTE_SPECIAL into the Kconfig

[PATCH v2 2/2] powerpc/time: Only set ARCH_HAS_SCALED_CPUTIME on PPC64

2018-04-09 Thread Christophe Leroy
scaled cputime is only meaningfull when the processor has SPURR and/or PURR, which means only on PPC64. Removing it on PPC32 significantly reduces the size of vtime_account_system() and vtime_account_idle() on an 8xx: Before: 0114 l F .text 00a8 vtime_delta 04c0 g F .text

[PATCH v2 1/2] powerpc/time: inline arch_vtime_task_switch()

2018-04-09 Thread Christophe Leroy
arch_vtime_task_switch() is a small function which is called only from vtime_common_task_switch(), so it is worth inlining Signed-off-by: Christophe Leroy --- v2: added a local pointer for get_accounting(prev) to avoid GCC to read it twice

[PATCH 5/6] powerpc/powernv: implement opal_put_chars_nonatomic

2018-04-09 Thread Nicholas Piggin
The RAW console does not need writes to be atomic, so implement a _nonatomic variant which does not take a spinlock. This API is used in xmon, so the less locking thta's used, the better chance there is that a crash can be debugged. Cc: Benjamin Herrenschmidt

[PATCH 0/3] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-09 Thread Laurent Dufour
The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the per architecture header files. This doesn't allow to make other configuration dependent on it. This series is moving the __HAVE_ARCH_PTE_SPECIAL into the Kconfig files, setting it automatically when architectures was