Re: [PATCH 1/3] powerpc: make CPU selection logic generic in Makefile

2018-08-07 Thread Michael Ellerman
Christophe Leroy writes: > At the time being, when adding a new CPU for selection, both > Kconfig.cputype and Makefile have to be modified. > > This patch moves into Kconfig.cputype the name of the CPU to me > passed to the -mcpu= argument. > > Signed-off-by: Christophe Leroy > --- > arch/power

Re: [PATCH v3 00/14] Implement use of HW assistance on TLB table walk on 8xx

2018-08-07 Thread Christophe LEROY
Hi Please note that I'm currently deeply reworking this serie in order to make it more clear hence more simple to review. So don't consider taking it yet (except maybe the first patch of the serie which is a bugfix). Christophe Le 29/05/2018 à 17:50, Christophe Leroy a écrit : The purpose o

Re: [PATCH v6 00/11] hugetlb: Factorize hugetlb architecture primitives

2018-08-07 Thread Ingo Molnar
* Alexandre Ghiti wrote: > [CC linux-mm for inclusion in -mm tree] > > > > In order to reduce copy/paste of functions across architectures and then > > make ri

Re: Several suspected memory leaks

2018-08-07 Thread Catalin Marinas
(catching up with emails) On Wed, 11 Jul 2018 at 00:40, Benjamin Herrenschmidt wrote: > On Tue, 2018-07-10 at 17:17 +0200, Paul Menzel wrote: > > On a the IBM S822LC (8335-GTA) with Ubuntu 18.04 I built Linux master > > – 4.18-rc4+, commit 092150a2 (Merge branch 'for-linus' > > of git://git.kerne

[PATCH] powerpc/64: Disable irq restore warning for now

2018-08-07 Thread Michael Ellerman
We recently added a warning in arch_local_irq_restore() to check that the soft masking state matches reality. Unfortunately it trips in a few places, which are not entirely trivial to fix. The key problem is if we're doing function_graph tracing of restore_math(), the warning pops and then seems t

Re: [RFC PATCH 0/3] New device-tree format and Opal based idle save-restore

2018-08-07 Thread Michael Ellerman
Akshay Adiga writes: > Previously if a older kernel runs on a newer firmware, it may enable > all available states irrespective of its capability of handling it. > New device tree format adds a compatible flag, so that only kernel > which has the capability to handle the version of stop state wil

Re: [PATCH] misc: ibmvsm: Fix wrong assignment of return code

2018-08-07 Thread Michael Ellerman
"Bryant G. Ly" writes: > From: "Bryant G. Ly" > > Currently the assignment is flipped and rc is always 0. If you'd left rc uninitialised at the start of the function the compiler would have caught it for you. And what is the consequence of the bug? Nothing, complete system crash, subtle data c

Re: [PATCH] of/fdt: Remove PPC32 longtrail hack in memory scan

2018-08-07 Thread Michael Ellerman
Rob Herring writes: > On Mon, Jul 30, 2018 at 4:47 AM Michael Ellerman wrote: >> Rob Herring writes: >> > On Thu, Jul 26, 2018 at 11:36 PM Michael Ellerman >> > wrote: >> >> When the OF code was originally made common by Grant in commit >> >> 51975db0b733 ("of/flattree: merge early_init_dt_sca

[PATCH] powerpc/64s: idle_power4 fix PACA_IRQ_HARD_DIS accounting

2018-08-07 Thread Nicholas Piggin
When idle_power4 hard disables interrupts then finds a soft pending interrupt, it returns with interrupts hard disabled but without PACA_IRQ_HARD_DIS set. Commit 9b81c0211c ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely") added a warning for that condition. Fix this by adding the PACA

[PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Breno Leitao
On a kernel TM Bad thing program exception, the Machine State Register (MSR) is not being properly displayed. The exception code dumps a 32-bits value but MSR is a 64 bits register for all platforms that have HTM enabled. This patch dumps the MSR value as a 64-bits value instead of 32 bits. In ord

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-07 Thread Christoph Hellwig
On Tue, Aug 07, 2018 at 04:42:44PM +1000, Benjamin Herrenschmidt wrote: > Note that I can make it so that the same DMA ops (basically standard > swiotlb ops without arch hacks) work for both "direct virtio" and > "normal PCI" devices. > > The trick is simply in the arch to setup the iommu to map t

[PATCH v3] selftests/powerpc: Kill child processes on SIGINT

2018-08-07 Thread Breno Leitao
There are some powerpc selftests, as tm/tm-unavailable, that run for a long period (>120 seconds), and if it is interrupted, as pressing CRTL-C (SIGINT), the foreground process (harness) dies but the child process and threads continue to execute (with PPID = 1 now) in background. In this case, you

[PATCH v7 0/9] powerpc/pseries: Machine check handler improvements.

2018-08-07 Thread Mahesh J Salgaonkar
This patch series includes some improvement to Machine check handler for pseries. Patch 1 fixes a buffer overrun issue if rtas extended error log size is greater than RTAS_ERROR_LOG_MAX. Patch 2 fixes an issue where machine check handler crashes kernel while accessing vmalloc-ed buffer while in nmi

[PATCH v7 1/9] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar The global mce data buffer that used to copy rtas error log is of 2048 (RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read extended_log_length from rtas error log header, then use max of extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied. Ide

[PATCH v7 2/9] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar rtas_log_buf is a buffer to hold RTAS event data that are communicated to kernel by hypervisor. This buffer is then used to pass RTAS event data to user through proc fs. This buffer is allocated from vmalloc (non-linear mapping) area. On Machine check interrupt, register

[PATCH v7 3/9] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar During Machine Check interrupt on pseries platform, register r3 points RTAS extended event log passed by hypervisor. Since hypervisor uses r3 to pass pointer to rtas log, it stores the original r3 value at the start of the memory (first 8 bytes) pointed by r3. Since hyperv

[PATCH v7 4/9] powerpc/pseries: Define MCE error event section.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, the machine check error details are part of RTAS extended event log passed under Machine check exception section. This patch adds the definition of rtas MCE event section and related helper functions. Signed-off-by: Mahesh Salgaonkar --- arch/powerpc/include

[PATCH v7 5/9] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, as of today system crashes if we get a machine check exceptions due to SLB errors. These are soft errors and can be fixed by flushing the SLBs so the kernel can continue to function instead of system crash. We do this in real mode before turning on MMU. Otherwi

[PATCH v7 6/9] powerpc/pseries: Display machine check error details.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Extract the MCE error details from RTAS extended log and display it to console. With this patch you should now see mce logs like below: [ 142.371818] Severe Machine check interrupt [Recovered] [ 142.371822] NIP [dca301b8]: init_module+0x1b8/0x338 [bork_kernel

[PATCH v7 7/9] powerpc/pseries: Dump the SLB contents on SLB MCE errors.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar If we get a machine check exceptions due to SLB errors then dump the current SLB contents which will be very much helpful in debugging the root cause of SLB errors. Introduce an exclusive buffer per cpu to hold faulty SLB entries. In real mode mce handler saves the old SLB

[PATCH v7 8/9] powerpc/mce: Add sysctl control for recovery action on MCE.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Introduce recovery action for recovered memory errors (MCEs). There are soft memory errors like SLB Multihit, which can be a result of a bad hardware OR software BUG. Kernel can easily recover from these soft errors by flushing SLB contents. After the recovery kernel can s

[PATCH v7 9/9] powernv/pseries: consolidate code for mce early handling.

2018-08-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Now that other platforms also implements real mode mce handler, lets consolidate the code by sharing existing powernv machine check early code. Rename machine_check_powernv_early to machine_check_common_early and reuse the code. Signed-off-by: Mahesh Salgaonkar --- arch

Re: [PATCH] misc: ibmvsm: Fix wrong assignment of return code

2018-08-07 Thread Bryant G. Ly
On 8/7/18 7:28 AM, Michael Ellerman wrote: > "Bryant G. Ly" writes: > >> From: "Bryant G. Ly" >> >> Currently the assignment is flipped and rc is always 0. > If you'd left rc uninitialised at the start of the function the compiler > would have caught it for you. > > And what is the consequence

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Segher Boessenkool
On Tue, Aug 07, 2018 at 10:35:00AM -0300, Breno Leitao wrote: > On a kernel TM Bad thing program exception, the Machine State Register > (MSR) is not being properly displayed. The exception code dumps a 32-bits > value but MSR is a 64 bits register for all platforms that have HTM > enabled. > > Th

Re: [PATCH v7 5/9] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-08-07 Thread Michal Suchánek
Hello, On Tue, 07 Aug 2018 19:47:14 +0530 "Mahesh J Salgaonkar" wrote: > From: Mahesh Salgaonkar > > On pseries, as of today system crashes if we get a machine check > exceptions due to SLB errors. These are soft errors and can be fixed > by flushing the SLBs so the kernel can continue to fun

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Christophe LEROY
Le 07/08/2018 à 15:35, Breno Leitao a écrit : On a kernel TM Bad thing program exception, the Machine State Register (MSR) is not being properly displayed. The exception code dumps a 32-bits value but MSR is a 64 bits register for all platforms that have HTM enabled. This patch dumps the MSR

Re: [RFC 3/5] powerpc/mpic: Add support for non-contiguous irq ranges

2018-08-07 Thread Rob Herring
On Fri, Jul 27, 2018 at 03:17:59PM +0530, Bharat Bhushan wrote: > Freescale MPIC h/w may not support all interrupt sources reported > by hardware, "last-interrupt-source" or platform. On these platforms > a misconfigured device tree that assigns one of the reserved > interrupts leaves a non-functio

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Breno Leitao
Hi, On 08/07/2018 02:15 PM, Christophe LEROY wrote: > Le 07/08/2018 à 15:35, Breno Leitao a écrit : >> On a kernel TM Bad thing program exception, the Machine State Register >> (MSR) is not being properly displayed. The exception code dumps a 32-bits >> value but MSR is a 64 bits register for all

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread LEROY Christophe
Breno Leitao a écrit : Hi, On 08/07/2018 02:15 PM, Christophe LEROY wrote: Le 07/08/2018 à 15:35, Breno Leitao a écrit : On a kernel TM Bad thing program exception, the Machine State Register (MSR) is not being properly displayed. The exception code dumps a 32-bits value but MSR is a 64 bits

Re: [PATCH v2 2/2] powerpc/pseries: Wait for completion of hotplug events during PRRN handling

2018-08-07 Thread John Allen
On Wed, Aug 01, 2018 at 11:16:22PM +1000, Michael Ellerman wrote: John Allen writes: On Mon, Jul 23, 2018 at 11:41:24PM +1000, Michael Ellerman wrote: John Allen writes: While handling PRRN events, the time to handle the actual hotplug events dwarfs the time it takes to perform the device

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-07 Thread Benjamin Herrenschmidt
On Tue, 2018-08-07 at 06:55 -0700, Christoph Hellwig wrote: > On Tue, Aug 07, 2018 at 04:42:44PM +1000, Benjamin Herrenschmidt wrote: > > Note that I can make it so that the same DMA ops (basically standard > > swiotlb ops without arch hacks) work for both "direct virtio" and > > "normal PCI" devic

Re: [RFC 3/5] powerpc/mpic: Add support for non-contiguous irq ranges

2018-08-07 Thread Scott Wood
On Tue, 2018-08-07 at 12:09 -0600, Rob Herring wrote: > On Fri, Jul 27, 2018 at 03:17:59PM +0530, Bharat Bhushan wrote: > > Freescale MPIC h/w may not support all interrupt sources reported > > by hardware, "last-interrupt-source" or platform. On these platforms > > a misconfigured device tree that

Re: [RFC 5/5] powerpc/fsl: Add supported-irq-ranges for P2020

2018-08-07 Thread Scott Wood
On Fri, 2018-07-27 at 15:18 +0530, Bharat Bhushan wrote: > MPIC on NXP (Freescale) P2020 supports following irq > ranges: > > 0 - 11 (External interrupt) > > 16 - 79 (Internal interrupt) > > 176 - 183 (Messaging interrupt) > > 224 - 231 (Shared message signaled interrupt) Why

[PATCH] powerpc/powernv: Add support for NPU2 relaxed-ordering mode

2018-08-07 Thread Reza Arbab
From: Alistair Popple Some device drivers support out of order access to GPU memory. This does not affect the CPU view of memory but it does affect the GPU view, so it should only be enabled once the GPU driver has requested it. Add APIs allowing a driver to do so. Signed-off-by: Alistair Popple

RE: [RFC 3/5] powerpc/mpic: Add support for non-contiguous irq ranges

2018-08-07 Thread Bharat Bhushan
> -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Wednesday, August 8, 2018 2:34 AM > To: Rob Herring ; Bharat Bhushan > > Cc: b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > ga...@kernel.crashing.org; mark.rutl...@arm.com; > kstew...@linuxfoun

RE: [RFC 5/5] powerpc/fsl: Add supported-irq-ranges for P2020

2018-08-07 Thread Bharat Bhushan
> -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Wednesday, August 8, 2018 2:44 AM > To: Bharat Bhushan ; > b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > ga...@kernel.crashing.org; mark.rutl...@arm.com; > kstew...@linuxfoundation.org; gre...@

[PATCH] powerpc/topology: Check at boot for topology updates

2018-08-07 Thread Srikar Dronamraju
On a shared lpar, Phyp will not update the cpu associativity at boot time. Just after the boot system does recognize itself as a shared lpar and trigger a request for correct cpu associativity. But by then the scheduler would have already created/destroyed its sched domains. This causes - Broken l

Re: [PATCH v6 00/11] hugetlb: Factorize hugetlb architecture primitives

2018-08-07 Thread Alex Ghiti
Thanks for your time, Alex Le 07/08/2018 à 09:54, Ingo Molnar a écrit : * Alexandre Ghiti wrote: [CC linux-mm for inclusion in -mm tree] In order to reduce copy/paste of functions across architectures and then

RE: [RFC 3/5] powerpc/mpic: Add support for non-contiguous irq ranges

2018-08-07 Thread Bharat Bhushan
> -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Wednesday, August 8, 2018 11:21 AM > To: Bharat Bhushan ; Rob Herring > > Cc: b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > ga...@kernel.crashing.org; mark.rutl...@arm.com; > kstew...@linuxfou

Re: [RFC 3/5] powerpc/mpic: Add support for non-contiguous irq ranges

2018-08-07 Thread Scott Wood
On Wed, 2018-08-08 at 03:37 +, Bharat Bhushan wrote: > > -Original Message- > > From: Scott Wood [mailto:o...@buserror.net] > > Sent: Wednesday, August 8, 2018 2:34 AM > > To: Rob Herring ; Bharat Bhushan > > > > Cc: b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > >

Re: [RFC 5/5] powerpc/fsl: Add supported-irq-ranges for P2020

2018-08-07 Thread Scott Wood
On Wed, 2018-08-08 at 03:44 +, Bharat Bhushan wrote: > > -Original Message- > > From: Scott Wood [mailto:o...@buserror.net] > > Sent: Wednesday, August 8, 2018 2:44 AM > > To: Bharat Bhushan ; > > b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > > ga...@kernel.crashing

Re: [RFC PATCH 0/3] New device-tree format and Opal based idle save-restore

2018-08-07 Thread Gautham R Shenoy
Hello Michael, On Tue, Aug 07, 2018 at 10:15:37PM +1000, Michael Ellerman wrote: > > Skiboot patch-set for device-tree is posted here : > > https://patchwork.ozlabs.org/project/skiboot/list/?series=58934 > > I don't see a device tree binding documented anywhere? > > There is an existing binding

RE: [RFC 5/5] powerpc/fsl: Add supported-irq-ranges for P2020

2018-08-07 Thread Bharat Bhushan
> -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Wednesday, August 8, 2018 11:26 AM > To: Bharat Bhushan ; > b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > ga...@kernel.crashing.org; mark.rutl...@arm.com; > kstew...@linuxfoundation.org; gre...

[PATCH] lib/test_hexdump: fix failure on big endian cpu

2018-08-07 Thread Christophe Leroy
On a big endian cpu, test_hexdump fails as follows. The logs show that bytes are expected in reversed order. [...] [ 16.643648] test_hexdump: Len: 24 buflen: 130 strlen: 97 [ 16.648681] test_hexdump: Result: 97 'be32db7b 0a1893b2 70bac424 7d83349b a69c31ad 9c0face9.2.{

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-07 Thread Christoph Hellwig
On Wed, Aug 08, 2018 at 06:32:45AM +1000, Benjamin Herrenschmidt wrote: > As for the flag itself, while we could set it from qemu when we get > notified that the guest is going secure, both Michael and I think it's > rather gross, it requires qemu to go iterate all virtio devices and > "poke" somet