Re: [PATCH 00/23] kconfig: move compiler capability tests to Kconfig

2018-03-01 Thread Masahiro Yamada
2018-02-22 6:39 GMT+09:00 Ulf Magnusson : > On Wed, Feb 21, 2018 at 09:57:03PM +0900, Masahiro Yamada wrote: >> 2018-02-21 19:52 GMT+09:00 Arnd Bergmann : >> > On Wed, Feb 21, 2018 at 11:20 AM, Masahiro Yamada >> > wrote: >> >> 2018-02-21 18:56 GMT+09:00 Arnd Bergmann : >> >>> On Wed, Feb 21, 2018

[PATCH v3] powerpc/npu-dma.c: Fix deadlock in mmio_invalidate

2018-03-01 Thread Alistair Popple
When sending TLB invalidates to the NPU we need to send extra flushes due to a hardware issue. The original implementation would lock the all the ATSD MMIO registers sequentially before unlocking and relocking each of them sequentially to do the extra flush. This introduced a deadlock as it is pos

[PATCH v4.1 backport 15/15] powerpc/vdso64: Use double word compare on pointers

2018-03-01 Thread Michael Ellerman
From: Anton Blanchard commit 5045ea37377ce8cca6890d32b127ad6770e6dce5 upstream. __kernel_get_syscall_map() and __kernel_clock_getres() use cmpli to check if the passed in pointer is non zero. cmpli maps to a 32 bit compare on binutils, so we ignore the top 32 bits. A simple test case can be cre

[PATCH v4.1 backport 14/15] powerpc/ptrace: Fix out of bounds array access warning

2018-03-01 Thread Michael Ellerman
From: Khem Raj commit 1e407ee3b21f981140491d5b8a36422979ca246f upstream. gcc-6 correctly warns about a out of bounds access arch/powerpc/kernel/ptrace.c:407:24: warning: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Warray-bounds] o

[PATCH v4.1 backport 13/15] powerpc/pseries: include linux/types.h in asm/hvcall.h

2018-03-01 Thread Michael Ellerman
From: Michal Suchanek commit 1b689a95ce7427075f9ac9fb4aea1af530742b7f upstream. Commit 6e032b350cd1 ("powerpc/powernv: Check device-tree for RFI flush settings") uses u64 in asm/hvcall.h without including linux/types.h This breaks hvcall.h users that do not include the header themselves. Fixes

[PATCH v4.1 backport 12/15] powerpc/64s: Allow control of RFI flush via debugfs

2018-03-01 Thread Michael Ellerman
commit 236003e6b5443c45c18e613d2b0d776a9f87540e upstream. Expose the state of the RFI flush (enabled/disabled) via debugfs, and allow it to be enabled/disabled at runtime. eg: $ cat /sys/kernel/debug/powerpc/rfi_flush 1 $ echo 0 > /sys/kernel/debug/powerpc/rfi_flush $ cat /sys/kernel/

[PATCH v4.1 backport 11/15] powerpc/powernv: Check device-tree for RFI flush settings

2018-03-01 Thread Michael Ellerman
From: Oliver O'Halloran commit 6e032b350cd1fdb830f18f8320ef0e13b4e24094 upstream. New device-tree properties are available which tell the hypervisor settings related to the RFI flush. Use them to determine the appropriate flush instruction to use, and whether the flush is required. Signed-off-b

[PATCH v4.1 backport 10/15] powerpc/pseries: Query hypervisor for RFI flush settings

2018-03-01 Thread Michael Ellerman
From: Michael Neuling commit 8989d56878a7735dfdb234707a2fee6faf631085 upstream. A new hypervisor call is available which tells the guest settings related to the RFI flush. Use it to query the appropriate flush instruction(s), and whether the flush is required. Signed-off-by: Michael Neuling Si

[PATCH v4.1 backport 09/15] powerpc/64s: Improve RFI L1-D cache flush fallback

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit bfcd89a1d61a4a6bca3319e2ab70d7c745baf823 upstream. The fallback RFI flush is used when firmware does not provide a way to flush the cache. It's a "displacement flush" that evicts useful data by displacing it with an uninteresting buffer. The flush has to take care t

[PATCH v4.1 backport 06/15] powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit c7305645eb0c1621351cfc104038831ae87c0053 upstream. In the SLB miss handler we may be returning to user or kernel. We need to add a check early on and save the result in the cr4 register, and then we bifurcate the return path based on that. Signed-off-by: Nicholas Pi

[PATCH v4.1 backport 07/15] powerpc/64s: Add support for RFI flush of L1-D cache

2018-03-01 Thread Michael Ellerman
commit aa8a5e0062ac940f7659394f4817c948dc8c0667 upstream. On some CPUs we can prevent the Meltdown vulnerability by flushing the L1-D cache on exit from kernel to user mode, and from hypervisor to guest. This is known to be the case on at least Power7, Power8 and Power9. At this time we do not kn

[PATCH v4.1 backport 05/15] powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit b8e90cb7bc04a509e821e82ab6ed7a8ef11ba333 upstream. In the syscall exit path we may be returning to user or kernel context. We already have a test for that, because we conditionally restore r13. So use that existing test and branch, and bifurcate the return based on t

[PATCH v4.1 backport 08/15] powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti

2018-03-01 Thread Michael Ellerman
commit bc9c9304a45480797e13a8e1df96ffcf44fb62fe upstream. Because there may be some performance overhead of the RFI flush, add kernel command line options to disable it. We add a sensibly named 'no_rfi_flush' option, but we also hijack the x86 option 'nopti'. The RFI flush is not the same as KPTI

[PATCH v4.1 backport 04/15] powerpc/64: Convert fast_exception_return to use RFI_TO_USER/KERNEL

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit a08f828cf47e6c605af21d2cdec68f84e799c318 upstream. Similar to the syscall return path, in fast_exception_return we may be returning to user or kernel context. We already have a test for that, because we conditionally restore r13. So use that existing test and branch,

[PATCH v4.1 backport 02/15] powerpc/64: Add macros for annotating the destination of rfid/hrfid

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit 50e51c13b3822d14ff6df4279423e4b7b2269bc3 upstream. The rfid/hrfid ((Hypervisor) Return From Interrupt) instruction is used for switching from the kernel to userspace, and from the hypervisor to the guest kernel. However it can and is also used for other transitions,

[PATCH v4.1 backport 03/15] powerpc/64s: Simple RFI macro conversions

2018-03-01 Thread Michael Ellerman
From: Nicholas Piggin commit 222f20f140623ef6033491d0103ee0875fe87d35 upstream. This commit does simple conversions of rfi/rfid to the new macros that include the expected destination context. By simple we mean cases where there is a single well known destination context, and it's simply a matte

[PATCH v4.1 backport 01/15] powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper

2018-03-01 Thread Michael Ellerman
From: Michael Neuling commit 191eccb1580939fb0d47deb405b82a85b0379070 upstream. A new hypervisor call has been defined to communicate various characteristics of the CPU to guests. Add definitions for the hcall number, flags and a wrapper function. Signed-off-by: Michael Neuling Signed-off-by:

[PATCH v4.1 backport 00/15] powerpc stable backports for v4.1

2018-03-01 Thread Michael Ellerman
Hi Sasha, This is a backport to v4.1 of the RFI flush series that went upstream recently. There's also a few other commits I noticed had not made it to v4.1. cheers

Re: Hotplug + Reboot is crashing HPT guest with HPT resizing enabled

2018-03-01 Thread David Gibson
On Fri, Feb 23, 2018 at 03:02:40PM +0530, Bharata B Rao wrote: > Hi, > > Rebooting a hash guest after hotplugging memory to it is crashing the > guest. This is seen only when HPT resizing is enabled. I see guest crashing > at multiple places, but this location is fairly commonly seen: > > kernel

Re: [PATCH v4] watchdog: add SPDX identifiers for watchdog subsystem

2018-03-01 Thread Joel Stanley
On Thu, Mar 1, 2018 at 1:31 AM, Marcus Folkesson wrote: > - Add SPDX identifier > - Remove boiler plate license text > - If MODULE_LICENSE and boiler plate does not match, go for boiler plate > license > For this one: > drivers/watchdog/aspeed_wdt.c | 5 +--- Acked-by: Joel Stanley

[PATCH v2] selftests/powerpc: Skip the subpage_prot tests if the syscall is unavailable

2018-03-01 Thread Michael Ellerman
The subpage_prot syscall is only functional when the system is using the Hash MMU. Since commit 5b2b80714796 ("powerpc/mm: Invalidate subpage_prot() system call on radix platforms") it returns ENOENT when the Radix MMU is active. Currently this just makes the test fail. Additionally the syscall is

Re: [PATCH RFC 1/1] powerpc/pseries: fix EEH recovery of IOV devices

2018-03-01 Thread Bjorn Helgaas
On Thu, Feb 22, 2018 at 11:23:35AM +1100, Sam Bobroff wrote: > Currently EEH recovery will fail on pSeries platforms for > passed-through physical devices that support IOV, when CONFIG_PCI_IOV > is set and the hypervisor doesn't provide a device tree node > "ibm,open-sriov-vf-bar-info" for the devi

Re: [RFC 1/5] seq_file: introduce seq_open_data helper

2018-03-01 Thread Andreas Dilger
On Mar 1, 2018, at 4:37 PM, Rasmus Villemoes wrote: > > There are quite a few callers of seq_open that could be simplified by > setting the ->private member via the seq_open call instead of fetching > file->private_data afterwards. > > Signed-off-by: Rasmus Villemoes > --- > I've just included

[RFC 3/5] powerpc/pseries: use seq_open_data in hcall_inst_seq_open

2018-03-01 Thread Rasmus Villemoes
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member. Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/pseries/hvCall_inst.c | 9 +--

[RFC 1/5] seq_file: introduce seq_open_data helper

2018-03-01 Thread Rasmus Villemoes
There are quite a few callers of seq_open that could be simplified by setting the ->private member via the seq_open call instead of fetching file->private_data afterwards. Signed-off-by: Rasmus Villemoes --- I've just included a few examples of possible users of this helper, there are many more s

[PATCH] powerpc: boot: add strrchr function

2018-03-01 Thread Rob Herring
libfdt gained a new dependency on strrchr, so copy the implementation from lib/string.c. Most of the string functions are in assembly, but stdio.c already has strnlen, so add strrchr there. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Signed-off-by: Rob Herring --- Please

Re: [PATCH] powerpc: dts: replace 'linux, stdout-path' with 'stdout-path'

2018-03-01 Thread Rob Herring
On Wed, Feb 28, 2018 at 7:33 PM, Michael Ellerman wrote: > Rob Herring writes: > >> 'linux,stdout-path' has been deprecated for some time in favor of >> 'stdout-path'. Now dtc will warn on occurrences of 'linux,stdout-path'. >> Search and replace all the of occurrences with 'stdout-path'. > > Thi

Re: [RFC PATCH 1/6] powerpc: Add security feature flags for Spectre/Meltdown

2018-03-01 Thread Michael Ellerman
Daniel Axtens writes: > Michael Ellerman writes: >> diff --git a/arch/powerpc/include/asm/security_features.h >> b/arch/powerpc/include/asm/security_features.h >> new file mode 100644 >> index ..3b690de8b0e8 >> --- /dev/null >> +++ b/arch/powerpc/include/asm/security_features.h >> @@

Re: [RFC PATCH 1/6] powerpc: Add security feature flags for Spectre/Meltdown

2018-03-01 Thread Michael Ellerman
Segher Boessenkool writes: > Hi! > > On Thu, Mar 01, 2018 at 01:53:11AM +1100, Michael Ellerman wrote: >> +// A speculation barrier should be used for bounds checks (Spectre variant >> 1ull > > s/1ull/1)/ ? Haha, oops. Thanks for spotting it. Result of replacing ASM_CONST(x) with xull. cheer

Re: [PATCH v2] powerpc/npu-dma.c: Fix deadlock in mmio_invalidate

2018-03-01 Thread Michael Ellerman
Alistair Popple writes: >> > diff --git a/arch/powerpc/platforms/powernv/npu-dma.c >> > b/arch/powerpc/platforms/powernv/npu-dma.c >> > index 0a253b64ac5f..2fed4b116e19 100644 >> > --- a/arch/powerpc/platforms/powernv/npu-dma.c >> > +++ b/arch/powerpc/platforms/powernv/npu-dma.c >> > @@ -726,7 +

Re: [PATCH 3/3] powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead

2018-03-01 Thread Nicholas Piggin
On Thu, 1 Mar 2018 00:04:39 +0530 Vaidyanathan Srinivasan wrote: > * Nicholas Piggin [2017-11-18 00:08:07]: > > > When stop is executed with EC=ESL=0, it appears to execute like a > > normal instruction (resuming from NIP when woken by interrupt). So all > > the save/restore handling can be avo

Re: [PATCH 2/3] powerpc/64s/idle: avoid sync for KVM state when waking from idle

2018-03-01 Thread Nicholas Piggin
On Wed, 28 Feb 2018 23:46:23 +0530 Vaidyanathan Srinivasan wrote: > * Nicholas Piggin [2017-11-18 00:08:06]: > > > When waking from a CPU idle instruction (e.g., nap or stop), the sync > > for ordering the KVM secondary thread state can be avoided if there > > wakeup is coming from a kernel con

Re: [PATCH 01/21] powerpc: Remove warning on array size when empty

2018-03-01 Thread Michael Ellerman
Mathieu Malaterre writes: > On Thu, Mar 1, 2018 at 3:55 AM, Michael Ellerman wrote: >> Mathieu Malaterre writes: >> >>> When neither CONFIG_ALTIVEC, nor CONFIG_VSX or CONFIG_PPC64 is defined, the >>> array feature_properties is defined as an empty array, which in turn >>> triggers the following

Re: [RFC REBASED 5/5] powerpc/mm/slice: use the dynamic high slice size to limit bitmap operations

2018-03-01 Thread Nicholas Piggin
On Thu, 1 Mar 2018 08:09:55 +0100 Christophe LEROY wrote: > Le 28/02/2018 à 07:53, Nicholas Piggin a écrit : > > On Tue, 27 Feb 2018 18:11:07 +0530 > > "Aneesh Kumar K.V" wrote: > > > >> Nicholas Piggin writes: > >> > >>> On Tue, 27 Feb 2018 14:31:07 +0530 > >>> "Aneesh Kumar K.V" wrote:

Re: [RFC][PATCH bpf] tools: bpftool: Fix tags for bpf-to-bpf calls

2018-03-01 Thread Naveen N. Rao
Daniel Borkmann wrote: On 02/27/2018 01:13 PM, Sandipan Das wrote: With this patch, it will look like this: 0: (85) call pc+2#bpf_prog_8f85936f29a7790a+3 (Note the +2 is the insn->off already.) 1: (b7) r0 = 1 2: (95) exit 3: (b7) r0 = 2 4: (95) exit where 8f85936f29a7790a is