Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-27 Thread Benjamin Herrenschmidt
On Fri, 2018-07-27 at 17:25 -0500, Bjorn Helgaas wrote: > > As for the powerpc bits, I'm probably the one who wrote them, however, > > I'm on vacation this week and right now, no bandwidth to context switch > > all that back in :-) So give me a few days and/or ping me next week. > > OK, here's a p

[PATCH v5 8/8] Documentation: Add nospectre_v1 parameter

2018-07-27 Thread Michael Ellerman
From: Diana Craciun Currently only supported on powerpc. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- Documentation/admin-guide/kernel-parameters.txt | 4 1 file changed, 4 insertions(+) v5: Change log and whitespace. diff --git a/Documentation/admin-guide/kernel-pa

[PATCH v5 7/8] powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms

2018-07-27 Thread Michael Ellerman
From: Diana Craciun Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/entry_32.S | 10 ++ 1 file changed, 10 insertions(+) v5: No change. diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/

[PATCH v5 6/8] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2018-07-27 Thread Michael Ellerman
From: Diana Craciun Implement the barrier_nospec as a isync;sync instruction sequence. The implementation uses the infrastructure built for BOOK3S 64. Signed-off-by: Diana Craciun [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig | 2 +-

[PATCH v5 5/8] powerpc/64: Make meltdown reporting Book3S 64 specific

2018-07-27 Thread Michael Ellerman
From: Diana Craciun In a subsequent patch we will enable building security.c for Book3E. However the NXP platforms are not vulnerable to Meltdown, so make the Meltdown vulnerability reporting PPC_BOOK3S_64 specific. Signed-off-by: Diana Craciun [mpe: Split out of larger patch] Signed-off-by: Mi

[PATCH v5 4/8] powerpc/64: Call setup_barrier_nospec() from setup_arch()

2018-07-27 Thread Michael Ellerman
Currently we require platform code to call setup_barrier_nospec(). But if we add an empty definition for the !CONFIG_PPC_BARRIER_NOSPEC case then we can call it in setup_arch(). Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/setup.h | 4 arc

[PATCH v5 3/8] powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC

2018-07-27 Thread Michael Ellerman
Add a config symbol to encode which platforms support the barrier_nospec speculation barrier. Currently this is just Book3S 64 but we will add Book3E in a future patch. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig | 7 ++- arch/powerpc/

[PATCH v5 2/8] powerpc/64: Make stf barrier PPC_BOOK3S_64 specific.

2018-07-27 Thread Michael Ellerman
From: Diana Craciun NXP Book3E platforms are not vulnerable to speculative store bypass, so make the mitigations PPC_BOOK3S_64 specific. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/security.c | 3 +++ 1 file changed, 3 insertions(+) v5: No change. di

[PATCH v5 1/8] powerpc/64: Disable the speculation barrier from the command line

2018-07-27 Thread Michael Ellerman
From: Diana Craciun The speculation barrier can be disabled from the command line with the parameter: "nospectre_v1". Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/security.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) v5: No chan

[PATCH v5 0/8] powerpc/fsl: Speculation barrier for NXP PowerPC Book3E

2018-07-27 Thread Michael Ellerman
Implement barrier_nospec for NXP PowerPC Book3E processors. Hi Diana, This series interacts with another series of mine, so I wanted to rework it slightly. Let me know if this looks OK to you. cheers Diana Craciun (6): powerpc/64: Disable the speculation barrier from the command line powerp

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-27 Thread Bjorn Helgaas
On Thu, Jul 19, 2018 at 02:18:09PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: > > [+cc Paul, Michael, linuxppc-dev] > > > >/... > > > > Debugging revealed a race condition between pcie core driver > > > enabling is_added bit(pci_bus_add

Re: Infinite looping observed in __offline_pages

2018-07-27 Thread John Allen
On Wed, Jul 25, 2018 at 10:03:36PM +0200, Michal Hocko wrote: On Wed 25-07-18 13:11:15, John Allen wrote: [...] Does a failure in do_migrate_range indicate that the range is unmigratable and the loop in __offline_pages should terminate and goto failed_removal? Or should we allow a certain number

Re: [PATCH v2 04/10] powerpc/traps: Use REG_FMT in show_signal_msg()

2018-07-27 Thread Joe Perches
On Fri, 2018-07-27 at 18:40 +0200, LEROY Christophe wrote: > Murilo Opsfelder Araujo a écrit : > > > Simplify the message format by using REG_FMT as the register format. This > > avoids having two different formats and avoids checking for MSR_64BIT. > > Are you sure it is what we want ? > > Wo

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

2018-07-27 Thread Rob Herring
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_scan_memory() common > code") (Feb 2010), the common code inherited a hack to handle > PPC "longtrail" machines, which had a

Re: [PATCH v2 04/10] powerpc/traps: Use REG_FMT in show_signal_msg()

2018-07-27 Thread LEROY Christophe
Murilo Opsfelder Araujo a écrit : Simplify the message format by using REG_FMT as the register format. This avoids having two different formats and avoids checking for MSR_64BIT. Are you sure it is what we want ? Won't it change the behaviour for a 32 bits app running on a 64bits kernel ?

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Nicholas Piggin
On Fri, 27 Jul 2018 08:38:35 -0700 Matthew Wilcox wrote: > On Sat, Jul 28, 2018 at 12:29:06AM +1000, Nicholas Piggin wrote: > > On Fri, 27 Jul 2018 06:41:56 -0700 > > Matthew Wilcox wrote: > > > > > On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > > > > The page table frag

Re: [PATCH 0/6] lib/crc32: treewide: Use existing define with polynomial

2018-07-27 Thread Herbert Xu
On Tue, Jul 17, 2018 at 06:05:35PM +0200, Krzysztof Kozlowski wrote: > Hi, > > Kernel defines same polynomial for CRC-32 in few places. > This is unnecessary duplication of the same value. Also this might > be error-prone for future code - every driver will define the > polynomial again. > > This

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Matthew Wilcox
On Sat, Jul 28, 2018 at 12:29:06AM +1000, Nicholas Piggin wrote: > On Fri, 27 Jul 2018 06:41:56 -0700 > Matthew Wilcox wrote: > > > On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > > > The page table fragment allocator uses the main page refcount racily > > > with respect to spe

[PATCH v2 10/10] powerpc/traps: Add line prefix in show_instructions()

2018-07-27 Thread Murilo Opsfelder Araujo
Remove "Instruction dump:" line by adding a prefix to display current->comm and current->pid, along with the instructions dump. The prefix can serve as a glue that links the instructions dump to its originator, allowing messages to be interleaved in the logs. Before this patch, a page fault looke

[PATCH v2 09/10] powerpc/traps: Show instructions on exceptions

2018-07-27 Thread Murilo Opsfelder Araujo
Call show_instructions() in arch/powerpc/kernel/traps.c to dump instructions at faulty location, useful to debugging. Before this patch, an unhandled signal message looked like: pandafault[10524]: segfault (11) at 17d0 nip 161c lr 7fffbd295100 code 2 in pandafault

[PATCH v2 08/10] powerpc: Add stacktrace.h header

2018-07-27 Thread Murilo Opsfelder Araujo
Move show_instructions() declaration to arch/powerpc/include/asm/stacktrace.h and include asm/stracktrace.h in arch/powerpc/kernel/process.c, which contains the implementation. This allows show_instructions() to be called on, for example, show_signal_msg(). Signed-off-by: Murilo Opsfelder Araujo

[PATCH v2 07/10] powerpc: Do not call __kernel_text_address() in show_instructions()

2018-07-27 Thread Murilo Opsfelder Araujo
Modify show_instructions() not to call __kernel_text_address(), allowing userspace instruction dump. probe_kernel_address(), which returns -EFAULT if something goes wrong, is still being called. Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/kernel/process.c | 3 +-- 1 file changed, 1

[PATCH v2 04/10] powerpc/traps: Use REG_FMT in show_signal_msg()

2018-07-27 Thread Murilo Opsfelder Araujo
Simplify the message format by using REG_FMT as the register format. This avoids having two different formats and avoids checking for MSR_64BIT. Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/kernel/traps.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git

[PATCH v2 06/10] powerpc/traps: Print signal name for unhandled signals

2018-07-27 Thread Murilo Opsfelder Araujo
This adds a human-readable name in the unhandled signal message. Before this patch, a page fault looked like: pandafault[6303]: unhandled signal 11 at 17d0 nip 161c lr 7fff93c55100 code 2 in pandafault[1000+1] After this patch, a page fault looks like:

[PATCH v2 05/10] powerpc/traps: Print VMA for unhandled signals

2018-07-27 Thread Murilo Opsfelder Araujo
This adds VMA address in the message printed for unhandled signals, similarly to what other architectures, like x86, print. Before this patch, a page fault looked like: pandafault[61470]: unhandled signal 11 at 17d0 nip 161c lr 7fff8d185100 code 2 After this patc

[PATCH v2 03/10] powerpc/reg: Add REG_FMT definition

2018-07-27 Thread Murilo Opsfelder Araujo
Make REG definition, in arch/powerpc/kernel/process.c, generic enough by renaming it to REG_FMT and placing it in arch/powerpc/include/asm/reg.h to be used elsewhere. Replace occurrences of REG by REG_FMT in arch/powerpc/kernel/process.c. Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/

[PATCH v2 02/10] powerpc/traps: Return early in show_signal_msg()

2018-07-27 Thread Murilo Opsfelder Araujo
Modify the logic of show_signal_msg() to return early, if possible. Replace printk_ratelimited() by printk() and a default rate limit burst to limit displaying unhandled signals messages. Mainly reason of this change is to improve readability of the function. The conditions to display the message

[PATCH v2 01/10] powerpc/traps: Print unhandled signals in a separate function

2018-07-27 Thread Murilo Opsfelder Araujo
Isolate the logic of printing unhandled signals out of _exception_pkey(). No functional change, only code rearrangement. Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/kernel/traps.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/po

[PATCH v2 00/10] powerpc: Modernize unhandled signals message

2018-07-27 Thread Murilo Opsfelder Araujo
Hi, everyone. This series was inspired by the need to modernize and display more informative messages about unhandled signals. The "unhandled signal NN" is not very informative. We thought it would be helpful adding a human-readable message describing what the signal number means, printing the V

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Nicholas Piggin
On Fri, 27 Jul 2018 06:41:56 -0700 Matthew Wilcox wrote: > On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > > The page table fragment allocator uses the main page refcount racily > > with respect to speculative references. A customer observed a BUG due > > to page table page ref

Re: [PATCH 0/3] powerpc/pseries: use H_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
Sorry for the noise, I forgot to add CC people in copy of this cover. A wall new thread has been resent : https://lkml.org/lkml/2018/7/27/651 On 27/07/2018 15:22, Laurent Dufour wrote: > On very large system we could see soft lockup fired when a process is exiting > > watchdog: BUG: soft lockup -

[PATCH] powerpc: Wire up file system mount new syscalls

2018-07-27 Thread Breno Leitao
Wire up the new file system mount syscalls for Powerpc. The new syscall being contemplated by this patch are those already available in the linux-next tree: open_tree(), move_mount(), fsopen(), fsmount(), fspick() and fsinfo(). These system calls were tested with David Howells test case[1], as som

[PATCH 2/3] powerpc/pseries/mm: factorize PTE slot computation

2018-07-27 Thread Laurent Dufour
This part of code will be called also when dealing with H_BLOCK_REMOVE. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Signed-off-by: Laurent Dufour --- arch/powerpc/platforms/pseries/lpar.c | 27 --- 1 f

[PATCH 1/3] powerpc/pseries/mm: Introducing FW_FEATURE_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
This feature tells if the hcall H_BLOCK_REMOVE is available. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Signed-off-by: Laurent Dufour --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/platforms/pseries/firm

[PATCH 3/3] powerpc/pseries/mm: call H_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
This hypervisor call allows to remove up to 8 ptes with only call to tlbie. The virtual pages must be all within the same naturally aligned 8 page virtual address block and have the same page and segment size encodings. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul M

[resend] [PATCH 0/3] powerpc/pseries: use H_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
[Resending so everyone is getting the cover letter] On very large system we could see soft lockup fired when a process is exiting watchdog: BUG: soft lockup - CPU#851 stuck for 21s! [forkoff:215523] Modules linked in: pseries_rng rng_core xfs raid10 vmx_crypto btrfs libcrc32c xor zstd_decompress

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Matthew Wilcox
On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > The page table fragment allocator uses the main page refcount racily > with respect to speculative references. A customer observed a BUG due > to page table page refcount underflow in the fragment allocator. This > can be caused by

[PATCH 0/3] powerpc/pseries: use H_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
On very large system we could see soft lockup fired when a process is exiting watchdog: BUG: soft lockup - CPU#851 stuck for 21s! [forkoff:215523] Modules linked in: pseries_rng rng_core xfs raid10 vmx_crypto btrfs libcrc32c xor zstd_decompress zstd_compress xxhash lzo_compress raid6_pq crc32c_vp

[PATCH 3/3] powerpc/pseries/mm: call H_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
This hypervisor call allows to remove up to 8 ptes with only call to tlbie. The virtual pages must be all within the same naturally aligned 8 page virtual address block and have the same page and segment size encodings. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul M

[PATCH 2/3] powerpc/pseries/mm: factorize PTE slot computation

2018-07-27 Thread Laurent Dufour
This part of code will be called also when dealing with H_BLOCK_REMOVE. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Signed-off-by: Laurent Dufour --- arch/powerpc/platforms/pseries/lpar.c | 27 --- 1 f

[PATCH 1/3] powerpc/pseries/mm: Introducing FW_FEATURE_BLOCK_REMOVE

2018-07-27 Thread Laurent Dufour
This feature tells if the hcall H_BLOCK_REMOVE is available. Cc: "Aneesh Kumar K.V" Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Signed-off-by: Laurent Dufour --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/platforms/pseries/firm

[PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Nicholas Piggin
The page table fragment allocator uses the main page refcount racily with respect to speculative references. A customer observed a BUG due to page table page refcount underflow in the fragment allocator. This can be caused by the fragment allocator set_page_count stomping on a speculative reference

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

2018-07-27 Thread Michael S. Tsirkin
On Wed, Jul 25, 2018 at 08:56:23AM +0530, Anshuman Khandual wrote: > Results with and without the patches are similar. Thanks! And another thing to try is virtio-net with a fast NIC backend (40G and up). Unfortunately at this point loopback tests stress the host scheduler too much. -- MST

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

2018-07-27 Thread Anshuman Khandual
On 07/27/2018 03:28 PM, Will Deacon wrote: > Hi Anshuman, > > On Fri, Jul 20, 2018 at 09:29:37AM +0530, Anshuman Khandual wrote: >> This patch series is the follow up on the discussions we had before about >> the RFC titled [RFC,V2] virtio: Add platform specific DMA API translation >> for virito d

RE: [PATCH] Adds __init annotation at mmu_init_secondary func

2018-07-27 Thread Alexey Spirkov
Without any additional option WARNING: modpost: Found 1 section mismatch(es). If detailed debug is switched on than: WARNING: vmlinux.o(.text+0x142ac): Section mismatch in reference from the function mmu_init_secondary() to the function .init.text:ppc44x_pin_tlb() The function mmu_init_seconda

Re: [PATCH] Adds __init annotation at mmu_init_secondary func

2018-07-27 Thread Michael Ellerman
Alexey Spirkov writes: > mmu_init_secondary function called at initialization sequence > but it misses __init annotation. As result modpost warning is generated. > Some building systems sensitive to such kind of warnings. What warning are you seeing? AFAICS it's not called from, nor does it cal

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

2018-07-27 Thread Will Deacon
Hi Anshuman, On Fri, Jul 20, 2018 at 09:29:37AM +0530, Anshuman Khandual wrote: > This patch series is the follow up on the discussions we had before about > the RFC titled [RFC,V2] virtio: Add platform specific DMA API translation > for virito devices (https://patchwork.kernel.org/patch/10417371/

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

2018-07-27 Thread Bharat Bhushan
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) We have to remove "irq_count" from platform code as platform is given pre

[RFC 4/5] powerpc/mpic: Boot print supported interrupt ranges

2018-07-27 Thread Bharat Bhushan
As mpic can have non-contiguous source of interrupt range, print same during boot. Signed-off-by: Bharat Bhushan --- arch/powerpc/sysdev/mpic.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index cb

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

2018-07-27 Thread Bharat Bhushan
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-functioning system without warning. This patch adds "supported-irq-ranges" pro

[RFC 2/5] powerpc/mpic: Rework last source irq calculation logic

2018-07-27 Thread Bharat Bhushan
Last irq calculation logic uses below priority order: 1) irq_count from platform 2) "last-interrupt-source" from device tree 3) isu_size from platform 4) MPIC h/w GREG_FEATURE_0 register This patch reworks the last irq calculation logic but functionality and priority order are same as befo

[RFC 1/5] powerpc/mpic: move last irq logic to function

2018-07-27 Thread Bharat Bhushan
This function just moves the last-irq calculation logic to a function, while no change in logic. Signed-off-by: Bharat Bhushan --- arch/powerpc/sysdev/mpic.c | 52 +- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/sysdev/m

[RFC 0/5] powerpc/mpic: Add non-contiguous interrupt sources

2018-07-27 Thread Bharat Bhushan
Freescale MPIC h/w may not support all interrupt sources reported by hardware or "last-interrupt-source" or platform. On these platforms a misconfigured device tree that assigns one of the reserved interrupts leaves a non-functioning system without warning. First Patch just moves the last-irq cal

Re: linux-next: manual merge of the staging tree with the powerpc tree

2018-07-27 Thread Greg KH
On Fri, Jul 27, 2018 at 05:59:11PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the staging tree got a conflict in: > > MAINTAINERS > > between commit: > > d69ccc00c497 ("MAINTAINERS: Remove the entry for the orphaned ams driver") > > from the powerpc tree and c

linux-next: manual merge of the staging tree with the powerpc tree

2018-07-27 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the staging tree got a conflict in: MAINTAINERS between commit: d69ccc00c497 ("MAINTAINERS: Remove the entry for the orphaned ams driver") from the powerpc tree and commit: 28d1a7ac2a0d ("iio: dac: Add AD5758 support") from the staging tree. I fixed