[PATCH v3] powerpc: Implement csum_ipv6_magic in assembly

2018-05-21 Thread Christophe Leroy
The generic csum_ipv6_magic() generates a pretty bad result : (PPC32) 0: 81 23 00 00 lwz r9,0(r3) 4: 81 03 00 04 lwz r8,4(r3) 8: 7c e7 4a 14 add r7,r7,r9 c: 7d 29 38 10 subfc r9,r9,r7 10: 7d 4a 51 10 subfe r10,r10,r10 14: 7d

[PATCH] powerpc: Implement csum_ipv6_magic in assembly

2018-05-21 Thread Christophe Leroy
The generic csum_ipv6_magic() generates a pretty bad result : (PPC32) 0: 81 23 00 00 lwz r9,0(r3) 4: 81 03 00 04 lwz r8,4(r3) 8: 7c e7 4a 14 add r7,r7,r9 c: 7d 29 38 10 subfc r9,r9,r7 10: 7d 4a 51 10 subfe r10,r10,r10 14: 7d

[RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-21 Thread Anshuman Khandual
This adds a hook which a platform can define in order to allow it to force the use of the DMA API for all virtio devices even if they don't have the VIRTIO_F_IOMMU_PLATFORM flag set. We want to use this to do bounce-buffering of data on the new secure pSeries platform, currently under development,

Re: [PATCH 00/19] powerpc/ppc32: make W=1 compilation errors free

2018-05-21 Thread Mathieu Malaterre
Any chance this could be applied to powerpc/next ? On Thu, Mar 22, 2018 at 9:19 PM, Mathieu Malaterre wrote: > Here is another batch for warnings treated as error on ppc32. Tested with: > > $ make ARCH=powerpc ppc32_defconfig > $ make -j8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- W=1 > > Usin

[PATCH 2/2] selftests/powerpc: Add perf breakpoint test

2018-05-21 Thread Michael Neuling
This tests perf hardware breakpoints (ie PERF_TYPE_BREAKPOINT) on powerpc. Signed-off-by: Michael Neuling --- .../selftests/powerpc/ptrace/.gitignore | 1 + .../testing/selftests/powerpc/ptrace/Makefile | 3 +- .../selftests/powerpc/ptrace/perf-hwbreak.c | 214 ++ 3 f

[PATCH 1/2] selftests/powerpc: Add ptrace hw breakpoint test

2018-05-21 Thread Michael Neuling
This test the ptrace hw breakpoints via PTRACE_SET_DEBUGREG and PPC_PTRACE_SETHWDEBUG. This test was use to find the bugs fixed by these recent commits: 4f7c06e26e powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG cd6ef7eebf powerpc/ptrace: Fix enforcement of DAWR

[PATCH] selftests/powerpc: Add missing .gitignores

2018-05-21 Thread Michael Neuling
Signed-off-by: Michael Neuling --- tools/testing/selftests/powerpc/alignment/.gitignore | 1 + tools/testing/selftests/powerpc/tm/.gitignore| 1 + 2 files changed, 2 insertions(+) diff --git a/tools/testing/selftests/powerpc/alignment/.gitignore b/tools/testing/selftests/powerpc/alignme

[PATCH v2] powerpc/32: Implement csum_ipv6_magic in assembly

2018-05-21 Thread Christophe Leroy
The generic csum_ipv6_magic() generates a pretty bad result : 0: 81 23 00 00 lwz r9,0(r3) 4: 81 03 00 04 lwz r8,4(r3) 8: 7c e7 4a 14 add r7,r7,r9 c: 7d 29 38 10 subfc r9,r9,r7 10: 7d 4a 51 10 subfe r10,r10,r10 14: 7d 27 42 14

Re: [PATCH 1/2] powerpc: Detect the presence of big-core with interleaved threads

2018-05-21 Thread Gautham R Shenoy
Hello Michael, On Fri, May 18, 2018 at 11:21:22PM +1000, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > > diff --git a/arch/powerpc/kernel/setup-common.c > > b/arch/powerpc/kernel/setup-common.c > > index 0af5c11..884dff2 100644 > > --- a/arch/powerpc/kernel/setup-common.c > > +++ b/

Re: [PATCH 1/2] powerpc: Detect the presence of big-core with interleaved threads

2018-05-21 Thread Gautham R Shenoy
Hello Michael, On Fri, May 18, 2018 at 11:14:04PM +1000, Michael Ellerman wrote: > Gautham R Shenoy writes: > ... > >> > @@ -565,7 +615,16 @@ void __init smp_setup_cpu_maps(void) > >> > vdso_data->processorCount = num_present_cpus(); > >> > #endif /* CONFIG_PPC64 */ > >> > > >> > -

Re: [PATCH ] powerpc/pkeys: Detach execute_only key on !PROT_EXEC

2018-05-21 Thread Thiago Jung Bauermann
Ram Pai writes: > Disassociate the exec_key from a VMA if the VMA permission is not > PROT_EXEC anymore. Otherwise the exec_only key continues to be > associated with the vma, causing unexpected behavior. > > The problem was reported on x86 by Shakeel Butt, > which is also applicable on powerpc

Re: [PATCH v2] powerpc/64s/radix: do not flush TLB when relaxing access

2018-05-21 Thread kbuild test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on v4.17-rc6] [cannot apply to powerpc/next next-20180517] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Nichol

Re: [PATCH bpf v2 6/6] bpf: fix JITed dump for multi-function programs via syscall

2018-05-21 Thread Sandipan Das
Hi Daniel, On 05/18/2018 09:21 PM, Daniel Borkmann wrote: > On 05/18/2018 02:50 PM, Sandipan Das wrote: >> Currently, for multi-function programs, we cannot get the JITed >> instructions using the bpf system call's BPF_OBJ_GET_INFO_BY_FD >> command. Because of this, userspace tools such as bpftool

[RFC v5 6/6] migration/memory: Update memory for assoc changes

2018-05-21 Thread Michael Bringmann
migration/memory: This patch adds more recognition for changes to the associativity of memory blocks described by the device-tree properties and updates local and general kernel data structures to reflect those changes. These differences may include: * Evaluating 'ibm,dynamic-memory' properties w

[RFC v5 5/6] powerpc/mobility: Add lock/unlock device hotplug

2018-05-21 Thread Michael Bringmann
powerpc/mobility: Add device lock/unlock to PowerPC 'mobility' operation to delay the operation of CPU DLPAR work queue operations by the 'readd' activity until after any changes to the corresponding device-tree properties have been written. Signed-off-by: Michael Bringmann --- arch/powerpc/plat

[RFC v5 4/6] powerpc/dlpar: Provide CPU readd operation

2018-05-21 Thread Michael Bringmann
powerpc/dlpar: Provide hotplug CPU 'readd by index' operation to support LPAR Post Migration state updates. When such changes are invoked by the PowerPC 'mobility' code, they will be queued up so that modifications to CPU properties will take place after the new property value is written to the de

[RFC v5 3/6] migration/dlpar: Add device readd queuing function

2018-05-21 Thread Michael Bringmann
migration/dlpar: This patch adds function dlpar_readd_action() which will queue a worker function to 'readd' a device in the system. Such devices must be identified by a 'resource' type and a drc_index to be readded. Signed-off-by: Michael Bringmann --- arch/powerpc/platforms/pseries/dlpar.c

[RFC v5 2/6] powerpc/cpu: Conditionally acquire/release DRC index

2018-05-21 Thread Michael Bringmann
powerpc/cpu: Modify dlpar_cpu_add and dlpar_cpu_remove to allow the skipping of DRC index acquire or release operations during the CPU add or remove operations. This is intended to support subsequent changes to provide a 'CPU readd' operation. Signed-off-by: Michael Bringmann --- arch/powerpc/p

[RFC v5 1/6] powerpc/drmem: Export 'dynamic-memory' loader

2018-05-21 Thread Michael Bringmann
powerpc/drmem: Export many of the functions of DRMEM to parse "ibm,dynamic-memory" and "ibm,dynamic-memory-v2" during hotplug operations and for Post Migration events. Also modify the DRMEM initialization code to allow it to, * Be called after system initialization * Provide a separate user copy

[RFC v5 0/6] powerpc/hotplug: Fix affinity assoc for LPAR migration

2018-05-21 Thread Michael Bringmann
The migration of LPARs across Power systems affects many attributes including that of the associativity of memory blocks and CPUs. The patches in this set execute when a system is coming up fresh upon a migration target. They are intended to, * Recognize changes to the associativity of memory an

[PATCH v2 2/2] selftests/powerpc: Add test to verify rfi flush across a system call

2018-05-21 Thread Naveen N. Rao
This adds a test to verify proper functioning of the rfi flush capability implemented to mitigate meltdown. The test works by measuring the number of L1d cache misses encountered while loading data from memory. Across a system call, since the L1d cache is flushed when rfi_flush is enabled, the numb

[PATCH v2 1/2] selftests/powerpc: Move UCONTEXT_NIA() into utils.h

2018-05-21 Thread Naveen N. Rao
... so that it can be used by others. Signed-off-by: Naveen N. Rao --- tools/testing/selftests/powerpc/include/utils.h | 8 .../selftests/powerpc/primitives/load_unaligned_zeropad.c | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/self

[PATCH v2 0/2] selftests/powerpc: Add test for rfi_flush

2018-05-21 Thread Naveen N. Rao
This is v2 of: https://patchwork.ozlabs.org/patch/895765/ Changes: - Patch 1 is new. - Patch 2 uses the new macro introduced in the first patch. The output message has also been slightly tweaked to make things clearer. - Naveen Naveen N. Rao (2): selftests/powerpc: Move UCONTEXT_NIA() into

Re: [PATCH] selftests/powerpc: add test to verify rfi flush across a system call

2018-05-21 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/powerpc/utils.c index d46916867a6f..c6b1d20ed3ba 100644 --- a/tools/testing/selftests/powerpc/utils.c +++ b/tools/testing/selftests/powerpc/utils.c @@ -104,3 +111,149

[PATCH] powerpc/xmon: really enable xmon when a breakpoint is set

2018-05-21 Thread Michal Suchanek
When single-stepping kernel code from xmon without a debug hook enabled the kernel crashes. This can happen when kernel starts with xmon on crash disabled but xmon is entered using sysrq. Commit e1368d0c9edb ("powerpc/xmon: Setup debugger hooks when first break-point is set") adds force_enable_xmo

Re: pkeys on POWER: Access rights not reset on execve

2018-05-21 Thread Florian Weimer
On 05/20/2018 09:11 PM, Ram Pai wrote: Florian, Does the following patch fix the problem for you? Just like x86 I am enabling all keys in the UAMOR register during initialization itself. Hence any key created by any thread at any time, will get activated on all t

[PATCH v3] powerpc/powernv: Add queue mechanism for early messages

2018-05-21 Thread Deb McLemore
Problem being solved is when issuing a BMC soft poweroff during IPL, the poweroff was being lost so the machine would not poweroff. Opal messages were being received before the opal-power code registered its notifiers. Alternatives discussed (option #3 was chosen): 1 - Have opal_message_init() e

Re: powerpc: fix spelling mistake: "Discharching" -> "Discharging"

2018-05-21 Thread Michael Ellerman
On Fri, 2018-05-18 at 09:31:17 UTC, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in battery_charging array > > Signed-off-by: Colin Ian King Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/ba01b058a52abcb0539d94ae976ef1 cheers

Re: [RESEND] powerpc/lib: Fix "integer constant is too large" build failure

2018-05-21 Thread Michael Ellerman
On Fri, 2018-05-18 at 01:18:33 UTC, Finn Thain wrote: > My powerpc-linux-gnu-gcc v4.4.5 compiler can't build a 32-bit kernel > any more: > > arch/powerpc/lib/sstep.c: In function 'do_popcnt': > arch/powerpc/lib/sstep.c:1068: error: integer constant is too large for > 'long' type > arch/powerpc/li

Re: [1/2] powerpc/ptrace: Fix enforcement of DAWR contraints

2018-05-21 Thread Michael Ellerman
On Thu, 2018-05-17 at 05:37:14 UTC, Michael Neuling wrote: > Back when we first introduced the DAWR in this commit: > 4ae7ebe952 powerpc: Change hardware breakpoint to allow longer ranges > > We screwed up the constraint making it a 1024 byte boundary rather > than a 512. This makes the check ov

Re: powerpc: get rid of PMD_PAGE_SIZE() and _PMD_SIZE

2018-05-21 Thread Michael Ellerman
On Wed, 2018-05-16 at 06:58:57 UTC, Christophe Leroy wrote: > PMD_PAGE_SIZE() is nowhere used and _PMD_SIZE is only > used by PMD_PAGE_SIZE(). > > This patch removes them. > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/5279821a6f5ff75d7dce

Re: [v2] powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

2018-05-21 Thread Michael Ellerman
On Wed, 2018-05-16 at 06:35:18 UTC, Anju T Sudhakar wrote: > Currently memory is allocated for core-imc based on cpu_present_mask, > which has bit 'cpu' set iff cpu is populated. We use (cpu number / threads > per core) as the array index to access the memory. > > Under some circumstances firmware

Re: [1/2] powerpc/powernv: Fix opal_event_shutdown() called with interrupts disabled

2018-05-21 Thread Michael Ellerman
On Mon, 2018-05-14 at 15:59:46 UTC, Nicholas Piggin wrote: > A kernel crash in process context that calls emergency_restart from > panic will end up calling opal_event_shutdown with interrupts disabled > but not in interrupt. This causes a sleeping function to be called > which gives the following

Re: [1/3] powerpc/io: Add __raw_writeq_be() __raw_rm_writeq_be()

2018-05-21 Thread Michael Ellerman
On Mon, 2018-05-14 at 12:50:31 UTC, Michael Ellerman wrote: > Add byte-swapping versions of __raw_writeq() and __raw_rm_writeq(). > > This allows us to avoid sparse warnings caused by passing __be64 to > __raw_writeq(), which takes unsigned long: > > arch/powerpc/platforms/powernv/pci-ioda.c:19

Re: [1/2] powerpc: flipper-pic: Don't match all IRQ domains

2018-05-21 Thread Michael Ellerman
On Thu, 2018-05-10 at 21:59:18 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote: > On the Wii, there is a secondary IRQ controller (hlwd-pic), so > flipper-pic's match operation should not be hardcoded to return 1. > In fact, the default matching logic is sufficient, and we can completely > omit fli

Re: [v2, 1/2] powerpc: avoid an unnecessary test and branch in longjmp()

2018-05-21 Thread Michael Ellerman
On Tue, 2018-04-17 at 17:08:16 UTC, Christophe Leroy wrote: > Doing the test at exit of the function avoids an unnecessary > test and branch inside longjmp() > > Signed-off-by: Christophe Leroy Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/24c78586cc6798028205e12c34fe

Re: Revert "powerpc/64: Fix checksum folding in csum_add()"

2018-05-21 Thread Michael Ellerman
On Tue, 2018-04-10 at 06:34:37 UTC, Christophe Leroy wrote: > This reverts commit 6ad966d7303b70165228dba1ee8da1a05c10eefe. > > That commit was pointless, because csum_add() sums two 32 bits > values, so the sum is 0x1fffe at the maximum. > And then when adding upper part (1) and lower part (0

Re: selftests/powerpc: Remove redundant cp_abort test

2018-05-21 Thread Michael Ellerman
On Thu, 2017-10-05 at 23:48:57 UTC, Michael Neuling wrote: > Paste on POWER9 only works on accelerators and no longer on real > memory. Hence this test is broken so remove it. > > Signed-off-by: Michael Neuling Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/00c946a06ec8414ad2

Re: powerpc/fsl/dts: fix the i2c-mux compatible for t104xqds

2018-05-21 Thread Michael Ellerman
On Thu, 2017-08-03 at 12:59:34 UTC, Peter Rosin wrote: > The sanctioned compatible is "nxp,pca9547". > > Signed-off-by: Peter Rosin Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/e4f2419fac381c5a7659834169dbe7 cheers

Re: powepc: Clear PCR on boot

2018-05-21 Thread Michael Ellerman
On Fri, 2018-05-18 at 01:37:42 UTC, Michael Neuling wrote: > Clear the PCR on boot to ensure we are not running in a compat mode. > > We've seen this cause problems when a crash (and kdump) occurs while > running compat mode guests. The kdump kernel then runs with the PCR > set and causes problems

[PATCH] powerpc/xmon: Update paca fields dumped in xmon

2018-05-21 Thread Michael Ellerman
The set of paca fields we dump in xmon has gotten somewhat out of date. Update to add some recently added fields. Signed-off-by: Michael Ellerman --- arch/powerpc/xmon/xmon.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index