[PATCH 06/13] powerpc/vas: Take reference to PID and mm for user space windows

2020-04-01 Thread Haren Myneni
When process opens a window, its pid and tgid will be saved in the vas_window struct. This window will be closed when the process exits. The kernel handles NX faults by updating CSB or send SEGV signal to pid of the process if the userspace csb addr is invalid. In multi-thread applications, a wi

[PATCH v9 07/13] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-04-01 Thread Haren Myneni
When NX encounters translation error on CRB and any request buffer, raises an interrupt on the CPU to handle the fault. It can raise one interrupt for multiple faults. Expects OS to handle these faults and return credits for fault window after processing faults. Setup thread IRQ handler and IRQ

[PATCH v9 08/13] powerpc/vas: Update CSB and notify process for fault CRBs

2020-04-01 Thread Haren Myneni
Applications polls on CSB for the status update after requests are issued. NX process these requests and update the CSB with the status. If it encounters translation error, pastes CRB in fault FIFO and raises an interrupt. The kernel handles fault by reading CRB from fault FIFO and process the fa

[PATCH v9 09/13] powerpc/vas: Return credits after handling fault

2020-04-01 Thread Haren Myneni
NX uses credit mechanism to control the number of requests issued on a specific window at any point of time. Only send windows and fault window are used credits. When the request is issued on a given window, a credit is taken. This credit will be returned after that request is processed. If credi

[PATCH v9 10/13] powerpc/vas: Print CRB and FIFO values

2020-04-01 Thread Haren Myneni
Dump FIFO entries if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 41 ++ 1 file changed, 41 insertions(+) diff --git a/arch/powerpc/platforms

[PATCH v9 11/13] powerpc/vas: Do not use default credits for receive window

2020-04-01 Thread Haren Myneni
System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas

[PATCH v9 12/13] powerpc/vas: Display process stuck message

2020-04-01 Thread Haren Myneni
Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug messages in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 28 ++

[PATCH v9 13/13] powerpc/vas: Free send window in VAS instance after credits returned

2020-04-01 Thread Haren Myneni
NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/

Re: [PATCH v2] powerpc/pseries: Fix MCE handling on pseries

2020-04-01 Thread Ganesh
On 3/20/20 4:31 PM, Ganesh Goudar wrote: MCE handling on pSeries platform fails as recent rework to use common code for pSeries and PowerNV in machine check error handling tries to access per-cpu variables in realmode. The per-cpu variables may be outside the RMO region on pSeries platform and n

[PATCH v2] sched/core: fix illegal RCU from offline CPUs

2020-04-01 Thread Qian Cai
From: Peter Zijlstra In the CPU-offline process, it calls mmdrop() after idle entry and the subsequent call to cpuhp_report_idle_dead(). Once execution passes the call to rcu_report_dead(), RCU is ignoring the CPU, which results in lockdep complaining when mmdrop() uses RCU from either memcg or d

[PATCH v5 0/9] crypto/nx: Enable GZIP engine and provide userpace API

2020-04-01 Thread Haren Myneni
Power9 processor supports Virtual Accelerator Switchboard (VAS) which allows kernel and userspace to send compression requests to Nest Accelerator (NX) directly. The NX unit comprises of 2 842 compression engines and 1 GZIP engine. Linux kernel already has 842 compression support on kernel. This

[PATCH v5 1/9] powerpc/vas: Initialize window attributes for GZIP coprocessor type

2020-04-01 Thread Haren Myneni
Initialize send and receive window attributes for GZIP high and normal priority types. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas-window.c

[PATCH v5 2/9] powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API

2020-04-01 Thread Haren Myneni
Define the VAS_TX_WIN_OPEN ioctl interface for NX GZIP access from user space. This interface is used to open GZIP send window and mmap region which can be used by user space to send requests to NX directly with copy/paste instructions. Signed-off-by: Haren Myneni --- Documentation/userspace-a

[PATCH v5 3/9] powerpc/vas: Add VAS user space API

2020-04-01 Thread Haren Myneni
On power9, user space can send GZIP compression requests directly to NX once kernel establishes NX channel / window with VAS. This patch provides user space API which allows user space to establish channel using open VAS_TX_WIN_OPEN ioctl, mmap and close operations. Each window corresponds to fi

[PATCH v5 4/9] crypto/nx: Initialize coproc entry with kzalloc

2020-04-01 Thread Haren Myneni
coproc entry is initialized during NX probe on power9, but not on P8. nx842_delete_coprocs() is used for both and frees receive window if it is allocated. Getting crash for rmmod on P8 since coproc->vas.rxwin is not initialized. This patch replaces kmalloc with kzalloc in nx842_powernv_probe()

[PATCH v5 5/9] crypto/nx: Rename nx-842-powernv file name to nx-common-powernv

2020-04-01 Thread Haren Myneni
Rename nx-842-powernv.c to nx-common-powernv.c to add code for setup and enable new GZIP compression type. The actual functionality is not changed in this patch. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/crypto/nx/Makefile|2 +- drivers/crypto/nx/nx-842-powe

[PATCH 6/9] crypto/nx: Make enable code generic to add new GZIP compression type

2020-04-01 Thread Haren Myneni
Make setup and enable code generic to support new GZIP compression type. Changed nx842 reference to nx and moved some code to new functions. Functionality is not changed except sparse warning fix - setting NULL instead of 0 for per_cpu send window in nx_delete_coprocs(). Signed-off-by: Haren Myn

[PATCH v5 7/9] crypto/nx: Enable and setup GZIP compression type

2020-04-01 Thread Haren Myneni
Changes to probe GZIP device-tree nodes, open RX windows and setup GZIP compression type. No plans to provide GZIP usage in kernel right now, but this patch enables GZIP for user space usage. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/crypto/nx/nx-common-powernv.c | 43 +

[PATCH v5 8/9] crypto/nx: Remove 'pid' in vas_tx_win_attr struct

2020-04-01 Thread Haren Myneni
When window is opened, pid reference is taken for user space windows. Not needed for kernel windows. So remove 'pid' in vas_tx_win_attr struct. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- arch/powerpc/include/asm/vas.h| 1 - drivers/crypto/nx/nx-common-powernv.c | 1 - 2 file

[PATCH v5 9/9] Documentation/powerpc: VAS API

2020-04-01 Thread Haren Myneni
Power9 introduced Virtual Accelerator Switchboard (VAS) which allows user space to communicate with Nest Accelerator (NX) directly. But kernel has to establish channel to NX for user space. This document describes user space API that application can use to establish communication channel. Signed

[PATCH v9 06/13] powerpc/vas: Take reference to PID and mm for user space windows

2020-04-01 Thread Haren Myneni
(sorry reposting. version string missed) When process opens a window, its pid and tgid will be saved in the vas_window struct. This window will be closed when the process exits. The kernel handles NX faults by updating CSB or send SEGV signal to pid of the process if the user space csb addr is inv

[PATCH v5 6/9] crypto/nx: Make enable code generic to add new GZIP compression type

2020-04-01 Thread Haren Myneni
(Sorry for reposting. version number is missed in subject) Make setup and enable code generic to support new GZIP compression type. Changed nx842 reference to nx and moved some code to new functions. Functionality is not changed except sparse warning fix - setting NULL instead of 0 for per_cpu sen

Re: [PATCH v2 1/1] vfio-pci/nvlink2: Allow fallback to ibm,mmio-atsd[0]

2020-04-01 Thread Alex Williamson
On Tue, 31 Mar 2020 15:12:46 +1100 Sam Bobroff wrote: > Older versions of skiboot only provide a single value in the device > tree property "ibm,mmio-atsd", even when multiple Address Translation > Shoot Down (ATSD) registers are present. This prevents NVLink2 devices > (other than the first) fro

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

2020-04-01 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:48 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg Kroah-

RE: [PATCH v4 01/25] powerpc/powernv: Add OPAL calls for LPC memory alloc/release

2020-04-01 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:48 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg Kroah-Ha

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

2020-04-01 Thread Stephen Rothwell
Hi all, On Fri, 6 Mar 2020 10:21:58 +1100 Stephen Rothwell wrote: > > Today's linux-next merge of the net-next tree got a conflict in: > > fs/sysfs/group.c > > between commit: > > 9255782f7061 ("sysfs: Wrap __compat_only_sysfs_link_entry_to_kobj function > to change the symlink name") >

Re: [PATCH v4 03/16] powerpc: Use a datatype for instructions

2020-04-01 Thread Jordan Niethe
On Wed, Apr 1, 2020 at 9:32 PM Balamuruhan S wrote: > > On Fri, 2020-03-20 at 16:17 +1100, Jordan Niethe wrote: > > Currently unsigned ints are used to represent instructions on powerpc. > > This has worked well as instructions have always been 4 byte words. > > However, a future ISA version will

Re: [PATCH v3 1/1] ppc/crash: Reset spinlocks during crash

2020-04-01 Thread Leonardo Bras
Hello Peter, On Wed, 2020-04-01 at 11:26 +0200, Peter Zijlstra wrote: > You might want to add a note to your asm/spinlock.h that you rely on > spin_unlock() unconditionally clearing a lock. > > This isn't naturally true for all lock implementations. Consider ticket > locks, doing a surplus unloc

Re: [PATCH v4 13/25] nvdimm/ocxl: Read the capability registers & wait for device ready

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch reads timeouts & firmware version from the controller, and > uses those timeouts to wait for the controller to report that it is ready > before handing the memory over to libnvdimm. > > Signed-off-by: Alastair D'Silva > --- >

Re: [PATCH v4 15/25] nvdimm/ocxl: Register a character device for userspace to interact with

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:53 PM Alastair D'Silva wrote: > > This patch introduces a character device (/dev/ocxlpmemX) which further > patches will use to interact with userspace, such as error logs, > controller stats and card debug functionality. This was asked earlier, but I'll reiterate, I do

Re: [PATCH v4 08/25] ocxl: Emit a log message showing how much LPC memory was detected

2020-04-01 Thread Joe Perches
On Wed, 2020-04-01 at 01:49 -0700, Dan Williams wrote: > On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva > wrote: > > This patch emits a message showing how much LPC memory & special purpose > > memory was detected on an OCXL device. [] > > diff --git a/drivers/misc/ocxl/config.c b/drivers/misc

Re: [PATCH v4 19/25] nvdimm/ocxl: Forward events to userspace

2020-04-01 Thread Dan Williams
On Tue, Mar 31, 2020 at 1:59 AM Alastair D'Silva wrote: > > Some of the interrupts that the card generates are better handled > by the userspace daemon, in particular: > Controller Hardware/Firmware Fatal > Controller Dump Available > Error Log available > > This patch allows a userspace applicati

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-01 Thread Dan Williams
On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: > > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit big-endian integers which are then stored in 'struct > papr_scm_priv' and subsequently partially e

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

2020-04-01 Thread Michael Ellerman
"Alastair D'Silva" writes: >> -Original Message- >> From: Dan Williams >> >> On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva >> wrote: >> > >> > This series adds support for OpenCAPI Persistent Memory devices on >> > bare metal (arch/powernv), exposing them as nvdimms so that we can >

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

2020-04-01 Thread Oliver O'Halloran
On Thu, Apr 2, 2020 at 2:42 PM Michael Ellerman wrote: > > "Alastair D'Silva" writes: > >> -Original Message- > >> From: Dan Williams > >> > >> On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva > >> wrote: > >> > > >> > *snip* > >> Are OPAL calls similar to ACPI DSMs? I.e. methods for t

Re: [RFC PATCH 3/4] powerpc ppc-opcode: move ppc instuction encoding from test_emulate_step

2020-04-01 Thread Michael Ellerman
"Naveen N. Rao" writes: > Balamuruhan S wrote: >> Few ppc instructions are encoded in test_emulate_step.c, consolidate them to >> ppc-opcode.h, fix redefintion errors in bpf_jit caused due to this >> consolidation. >> Reuse the macros from ppc-opcode.h ... >> diff --git a/arch/powerpc/net/bpf_jit

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

2020-04-01 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:48 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg Kroah-Ha

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

2020-04-01 Thread Alastair D'Silva
> -Original Message- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:49 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat ; > Andrew Donnellan ; Arnd Bergmann > ; Greg Kroah-Ha

Re: [PATCH v2 1/1] ppc/crash: Skip spinlocks during crash

2020-04-01 Thread kbuild test robot
Hi Leonardo, Thank you for the patch! Yet something to improve: [auto build test ERROR on tip/locking/core] [also build test ERROR on powerpc/next paulus-powerpc/kvm-ppc-next v5.6 next-20200401] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system

[powerpc:merge] BUILD SUCCESS d0c12846a3a24cd6d68b608c866712bc7e471634

2020-04-01 Thread kbuild test robot
fig pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200401 x86_64 randconfig-a002-20200401 x86_64 randconfig-a003-20200401 i386 randconfig-a001-20200401 i386 randconfig-a002-202

[powerpc:next-test] BUILD SUCCESS 824a2d10fcf429689cd20d7d36eeb24697466c9b

2020-04-01 Thread kbuild test robot
pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200401 x86_64 randconfig-a002-20200401 x86_64 randconfig-a003-20200401 i386 randconfig-a001-20200401 i386 randconfig-a002-20200401 i386

Re: [PATCH V2 3/5] selftests/powerpc: Add NX-GZIP engine compress testcase

2020-04-01 Thread Daniel Axtens
Raphael Moreira Zinsly writes: > Add a compression testcase for the powerpc NX-GZIP engine. > > Signed-off-by: Bulent Abali > Signed-off-by: Raphael Moreira Zinsly > --- > .../selftests/powerpc/nx-gzip/Makefile| 21 + > .../selftests/powerpc/nx-gzip/gzfht_test.c| 489 +

Re: [PATCH v4 06/25] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2020-04-01 Thread Andrew Donnellan
On 1/4/20 7:48 pm, Dan Williams wrote: On Sun, Mar 29, 2020 at 10:53 PM Alastair D'Silva wrote: OpenCAPI LPC memory is allocated per link, but each link supports multiple AFUs, and each AFU can have LPC memory assigned to it. Is there an OpenCAPI primer to decode these objects and their asso

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

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > 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 devic

<    1   2