[PATCH v4 24/25] nvdimm/ocxl: Expose the serial number & firmware version in sysfs

2020-03-29 Thread Alastair D'Silva
This patch exposes the serial number & firmware version in sysfs, which will be used by ndctl in userspace to help users identify the device. Signed-off-by: Alastair D'Silva --- drivers/nvdimm/ocxl/main.c | 42 -- 1 file changed, 40 insertions(+), 2

[PATCH v4 20/25] nvdimm/ocxl: Add an IOCTL to request controller health & perf data

2020-03-29 Thread Alastair D'Silva
When health & performance data is requested from the controller, it responds with an error log containing the requested information. This patch allows the request to be issued via an IOCTL, the data can later be collected in userspace via the error log IOCTL introduced in a previous patch.

[PATCH v4 21/25] nvdimm/ocxl: Implement the heartbeat command

2020-03-29 Thread Alastair D'Silva
The heartbeat admin command is a simple admin command that exercises the communication mechanisms within the controller. This patch issues a heartbeat command to the card during init to ensure we can communicate with the card's controller. Signed-off-by: Alastair D'Silva Reviewed-by: Andrew

[PATCH v4 25/25] MAINTAINERS: Add myself & nvdimm/ocxl to ocxl

2020-03-29 Thread Alastair D'Silva
The OpenCAPI Persistent Memory driver will be maintained as part ofi the ppc tree. I'm also adding myself as an author of the driver & contributor to the generic ocxl driver. Signed-off-by: Alastair D'Silva --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS

[PATCH v4 05/25] ocxl: Address kernel doc errors & warnings

2020-03-29 Thread Alastair D'Silva
This patch addresses warnings and errors from the kernel doc scripts for the OpenCAPI driver. It also makes minor tweaks to make the docs more consistent. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan --- drivers/misc/ocxl/config.c| 24

[PATCH v4 07/25] ocxl: Add functions to map/unmap LPC memory

2020-03-29 Thread Alastair D'Silva
Add functions to map/unmap LPC memory Signed-off-by: Alastair D'Silva Acked-by: Frederic Barrat --- drivers/misc/ocxl/core.c | 51 +++ drivers/misc/ocxl/ocxl_internal.h | 3 ++ include/misc/ocxl.h | 21 + 3 files changed, 75

[PATCH v4 04/25] ocxl: Remove unnecessary externs

2020-03-29 Thread Alastair D'Silva
Function declarations don't need externs, remove the existing ones so they are consistent with newer code Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan Acked-by: Frederic Barrat --- arch/powerpc/include/asm/pnv-ocxl.h | 40 ++--- include/misc/ocxl.h

[PATCH v4 14/25] nvdimm/ocxl: Add support for Admin commands

2020-03-29 Thread Alastair D'Silva
Admin commands for these devices are the primary means of interacting with the device controller to provide functionality beyond the load/store capabilities offered via the NPU. For example, SMART data, firmware update, and device error logs are implemented via admin commands. This patch

[PATCH v4 11/25] powerpc: Enable the OpenCAPI Persistent Memory driver for powernv_defconfig

2020-03-29 Thread Alastair D'Silva
This patch enables the OpenCAPI Persistent Memory driver, as well as DAX support, for the 'powernv' defconfig. DAX is not a strict requirement for the functioning of the driver, but it is likely that a user will want to create a DAX device on top of their persistent memory device. Signed-off-by:

[PATCH v4 02/25] mm/memory_hotplug: Allow check_hotplug_memory_addressable to be called from drivers

2020-03-29 Thread Alastair D'Silva
When setting up OpenCAPI connected persistent memory, the range check may not be performed until quite late (or perhaps not at all, if the user does not establish a DAX device). This patch makes the range check callable so we can perform the check while probing the OpenCAPI Persistent Memory

[PATCH v4 03/25] powerpc/powernv: Map & release OpenCAPI LPC memory

2020-03-29 Thread Alastair D'Silva
This patch adds OPAL calls to powernv so that the OpenCAPI driver can map & release LPC (Lowest Point of Coherency) memory. Signed-off-by: Alastair D'Silva Reviewed-by: Andrew Donnellan --- arch/powerpc/include/asm/pnv-ocxl.h | 2 ++ arch/powerpc/platforms/powernv/ocxl.c | 43

[PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-03-29 Thread Alastair D'Silva
This series adds support for OpenCAPI Persistent Memory devices on bare metal (arch/powernv), exposing them as nvdimms so that we can make use of the existing infrastructure. There already exists a driver for the same devices abstracted through PowerVM (arch/pseries):

[PATCH 4/4] powerpc/eeh: Clean up edev cleanup for VFs

2020-03-29 Thread Sam Bobroff
Because the bus notifier calls eeh_rmv_from_parent_pe() (via eeh_remove_device()) when a VF is removed, the call in remove_sriov_vf_pdns() is redundant. So remove the call. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/pci_dn.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-)

[PATCH 3/4] powerpc/eeh: Remove workaround from eeh_add_device_late()

2020-03-29 Thread Sam Bobroff
When EEH device state was released asynchronously by the device release handler, it was possible for an outstanding reference to prevent it's release and it was necessary to work around that if a device was re-discovered at the same PCI location. Now that the state is released synchronously that

[PATCH 1/4] powerpc/eeh: fix pseries_eeh_configure_bridge()

2020-03-29 Thread Sam Bobroff
If a device is hot unplgged during EEH recovery, it's possible for the RTAS call to ibm,configure-pe in pseries_eeh_configure() to return parameter error (-3), however negative return values are not checked for and this leads to an infinite loop. Fix this by correctly bailing out on negative

[PATCH 2/4] powerpc/eeh: Release EEH device state synchronously

2020-03-29 Thread Sam Bobroff
EEH device state is currently removed (by eeh_remove_device()) during the device release handler, which is invoked as the device's reference count drops to zero. This may take some time, or forever, as other threads may hold references. However, the PCI device state is released synchronously by

[PATCH 0/4] powerpc/eeh: Release EEH device state synchronously

2020-03-29 Thread Sam Bobroff
Hi everyone, Here are some fixes and cleanups that have come from other work but that I think stand on their own. Only one patch ("Release EEH device state synchronously", suggested by Oliver O'Halloran) is a significant change: it moves the cleanup of some EEH device data out of the (possibly

Re: linux-next: build failure after merge of the tip tree

2020-03-29 Thread Stephen Rothwell
Hi H.J., On Sun, 29 Mar 2020 20:53:42 -0700 "H.J. Lu" wrote: > > Please see my enclosing email. Is anyone from PPC community reading emails? What you really need is an Ack from the PowerPC people for the fix you suggested and then tha fix should go in the same series that is now causing the

[PATCH] powerpc/fadump: fix race between pstore write and fadump crash trigger

2020-03-29 Thread Sourabh Jain
When we enter into fadump crash path via system reset we fail to update the pstore. On the system reset path we first update the pstore then we go for fadump crash. But the problem here is when all the CPUs try to get the pstore lock to initiate the pstore write, only one CPUs will acquire the

[PATCH V2 7/9] powerpc/ps3: Add check for otheros image size

2020-03-29 Thread Geoff Levand
The ps3's otheros flash loader has a size limit of 16 MiB for the uncompressed image. If that limit will be reached output the flash image file as 'otheros-too-big.bld'. Signed-off-by: Geoff Levand --- arch/powerpc/boot/wrapper | 17 +++-- 1 file changed, 15 insertions(+), 2

Re: [PATCH 7/9] powerpc/ps3: Add check for otheros image size

2020-03-29 Thread Geoff Levand
Hi Geert, On 3/29/20 7:00 AM, Geert Uytterhoeven wrote: >> --- a/arch/powerpc/boot/wrapper >> +++ b/arch/powerpc/boot/wrapper >> >> odir="$(dirname "$ofile.bin")" >> -rm -f "$odir/otheros.bld" >> -gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld" >> + >> +# The ps3's

[PATCH v5 1/6] powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init()

2020-03-29 Thread Jason Yan
Some code refactor in kaslr_legal_offset() and kaslr_early_init(). No functional change. This is a preparation for KASLR fsl_booke64. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

[PATCH v5 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass

2020-03-29 Thread Jason Yan
The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH v5 6/6] powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part

2020-03-29 Thread Jason Yan
Now we support both 32 and 64 bit KASLR for fsl booke. Add document for 64 bit part and rename kaslr-booke32.rst to kaslr-booke.rst. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

[PATCH v5 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized

2020-03-29 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/mm/nohash/kaslr_booke.c | 4

[PATCH v5 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64

2020-03-29 Thread Jason Yan
The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference is that ppc64 needs the kernel to be 64K-aligned. So we can randomize the kernel in this 1G mapping and make it 64K-aligned. This

[PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-03-29 Thread Jason Yan
This is a try to implement KASLR for Freescale BookE64 which is based on my earlier implementation for Freescale BookE32: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718=* The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale

[PATCH v5 2/6] powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper

2020-03-29 Thread Jason Yan
Like the 32bit code, we introduce reloc_kernel_entry() helper to prepare for the KASLR 64bit version. And move the C declaration of this function out of CONFIG_PPC32 and use long instead of int for the parameter 'addr'. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael

[PATCH v2] powerpc/ptrace: Do not return ENOSYS if invalid syscall

2020-03-29 Thread Thadeu Lima de Souza Cascardo
If a tracer sets the syscall number to an invalid one, allow the return value set by the tracer to be returned the tracee. The test for NR_syscalls is already at entry_64.S, and it's at do_syscall_trace_enter only to skip audit and trace. After this, two failures from seccomp_bpf selftests

Re: [PATCH V2 0/3] mm/debug: Add more arch page table helper tests

2020-03-29 Thread Anshuman Khandual
On 03/27/2020 12:30 PM, Christophe Leroy wrote: > > > On 03/27/2020 06:46 AM, Anshuman Khandual wrote: >> >> On 03/26/2020 08:53 PM, Christophe Leroy wrote: >>> >>> >>> Le 26/03/2020 à 03:23, Anshuman Khandual a écrit : On 03/24/2020 10:52 AM, Anshuman Khandual wrote: > This

Re: [PATCH 7/9] powerpc/ps3: Add check for otheros image size

2020-03-29 Thread Geert Uytterhoeven
Hi Geoff, On Fri, Mar 27, 2020 at 9:26 PM Geoff Levand wrote: > The ps3's otheros flash loader has a size limit of 16 MiB for the > uncompressed image. If that limit will be reached output the > flash image file as 'otheros-too-big.bld'. > > Signed-off-by: Geoff Levand Thanks for your patch!

Re: [PATCH 0/2] mm/thp: Rename pmd_mknotpresent() as pmd_mknotvalid()

2020-03-29 Thread Anshuman Khandual
On 03/20/2020 10:24 AM, Anshuman Khandual wrote: > This series renames pmd_mknotpresent() as pmd_mknotvalid(). Before that it > drops an existing pmd_mknotpresent() definition from powerpc platform which > was never required as it defines it's pmdp_invalidate() through subscribing >

Re: [PATCH v2] powerpc/kprobes: Blacklist functions running with MMU disabled on PPC32

2020-03-29 Thread Christophe Leroy
Le 27/03/2020 à 10:07, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. As already done for PPC64, do it for PPC32. Signed-off-by: Christophe Leroy --- v2: - Don't rename

[PATCH 11/12] powerpc/entry32: Blacklist syscall exit points for kprobe.

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode. The very last part of syscall cannot support a trap. Add a symbol syscall_exit_finish to identify that part and blacklist it from kprobe. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 3 +++ 1 file changed, 3

[PATCH 12/12] powerpc/entry32: Blacklist exception exit points for kprobe.

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode. The very last part of exception exits cannot support a trap. Blacklist them from kprobe. While we are at it, remove exc_exit_start symbol which is not used to avoid having to blacklist it. Signed-off-by: Christophe Leroy ---

[PATCH 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kernel/entry_32.S

[PATCH 06/12] powerpc/32s: Make local symbols non visible in hash_low.

2020-03-29 Thread Christophe Leroy
In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be visible. In order to ease blacklisting of functions running with MMU disabled for kprobe, rename the symbols to .Lsymbols in order to hide them as if they were numbered

[PATCH 09/12] powerpc/32: Blacklist functions running with MMU disabled for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/cpu_setup_6xx.S | 2 ++ arch/powerpc/kernel/entry_32.S | 3 +++ arch/powerpc/kernel/fpu.S | 1 +

[PATCH 08/12] powerpc/rtas: Remove machine_check_in_rtas()

2020-03-29 Thread Christophe Leroy
machine_check_in_rtas() is just a trap. Do the trap directly in the machine check exception handler. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 6 -- arch/powerpc/kernel/head_32.S | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git

[PATCH 07/12] powerpc/32s: Blacklist functions running with MMU disabled for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/book3s32/hash_low.S | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/mm/book3s32/hash_low.S

[PATCH 04/12] powerpc/powermac: Blacklist functions running with MMU disabled for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/powermac/cache.S | 2 ++ arch/powerpc/platforms/powermac/sleep.S | 5 - 2 files changed, 6 insertions(+), 1

[PATCH 02/12] powerpc/82xx: Blacklist pq2_restart() for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/82xx/pq2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/82xx/pq2.c

[PATCH 03/12] powerpc/83xx: Blacklist mpc83xx_deep_resume() for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/83xx/suspend-asm.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/83xx/suspend-asm.S

[PATCH 05/12] powerpc/mem: Blacklist flush_dcache_icache_phys() for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/mem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index

[PATCH 01/12] powerpc/52xx: Blacklist functions running with MMU disabled for kprobe

2020-03-29 Thread Christophe Leroy
kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/52xx/lite5200_sleep.S | 2 ++ 1 file changed, 2 insertions(+) diff --git