Re: [PATCH] crypto/nx: Initialize 842 high and normal RxFIFO control registers

2018-06-01 Thread Haren Myneni
On 06/01/2018 12:41 AM, Stewart Smith wrote: > Haren Myneni writes: >> NX increments readOffset by FIFO size in receive FIFO control register >> when CRB is read. But the index in RxFIFO has to match with the >> corresponding entry in FIFO maintained by VAS in kernel

[PATCH] powerpc: paste - Mask XERSO bit in CR

2018-04-26 Thread Haren Myneni
NX can set 3rd bit in CR register for XER[SO] (Summation overflow) which is not used for paste return value. So. mask this bit to get proper return status. Signed-off-by: Haren Myneni <ha...@us.ibm.com> diff --git a/arch/powerpc/platforms/powernv/copy-paste.h b/arch/powerpc/pla

[PATCH] crypto/nx: Initialize 842 high and normal RxFIFO control registers

2018-04-21 Thread Haren Myneni
and normal FIFOs. Signed-off-by: Haren Myneni <ha...@us.ibm.com> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h index d886a5b..ff61e4b 100644 --- a/arch/powerpc/include/asm/opal-api.h +++ b/arch/powerpc/include/asm/opal-api.h @@ -206,7 +206,8 @@ #

Re: crash after NX error

2019-06-04 Thread Haren Myneni
; > So, it looks like there could be a problem in the error path, plausibly > fixed by this patch: > > commit 656ecc16e8fc2ab44b3d70e3fcc197a7020d0ca5 > Author: Haren Myneni > Date: Wed Jun 13 00:32:40 2018 -0700 > > crypto/nx: Initialize 842 high and nor

crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-15 Thread Haren Myneni
System gets checkstop if RxFIFO overruns with more requests than the maximum possible number of CRBs in FIFO at the same time. So find max CRBs from FIFO size and set it to receive window credits. CC: sta...@vger.kernel.org # v4.14+ Signed-off-by:Haren Myneni diff --git

Re: crash after NX error

2019-06-10 Thread Haren Myneni
>> [c01c9d98be30] c000b584 ppc_clone+0x8/0xc >> --- Exception: c00 (System Call) at 7afe9daf87f4 >> SP (7fffca606880) is in userspace >> >> So, it looks like there could be a problem in the error path, plausibly >> fixed by this patch: >> >>

Re: [EXTERNAL] Re: crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-18 Thread Haren Myneni
On 06/18/2019 05:35 AM, Michael Ellerman wrote: > Haren Myneni writes: >> >> System gets checkstop if RxFIFO overruns with more requests than the >> maximum possible number of CRBs in FIFO at the same time. So find max >> CRBs from FIFO size and set it to receive w

[PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-18 Thread Haren Myneni
System gets checkstop if RxFIFO overruns with more requests than the maximum possible number of CRBs in FIFO at the same time. The max number of requests per window is controlled by window credits. So find max CRBs from FIFO size and set it to receive window credits. Fixes: b0d6c9bab5e4

[PATCH V2 04/13] powerpc/vas: Setup fault window per VAS instance

2019-12-08 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch

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

2019-12-08 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

[PATCH V2 11/13] powerpc/vas: Return credits after handling fault

2019-12-08 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas

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

2019-12-08 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

[PATCH V2 03/13] powerpc/vas: Read interrupts and vas-port device tree properties

2019-12-08 Thread Haren Myneni
Read interrupts and vas-port device tree properties per each VAS instance. NX generates an interrupt when it sees page fault on the request buffer. Interrupts property is used to setup IRQ for handing the fault and set port value for each user space send window. Signed-off-by: Haren Myneni

[PATCH V2 09/13] powerpc/vas: Print CRB and FIFO values

2019-12-08 Thread Haren Myneni
Dump FIFO entry values 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

[PATCH V2 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-12-08 Thread Haren Myneni
s as suggested by Christoph Hellwig Haren Myneni (13): powerpc/vas: Describe vas-port and interrupts properties powerpc/vas: Define nx_fault_stamp in coprocessor_request_block powerpc/vas: Read interrupts and vas-port device tree properties powerpc/vas: Setup fault window per VAS instance

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

2019-12-08 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 130 + 1 file changed, 130 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index e1e34c6..88a211b 100644 --- a/arch/powerpc

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

2019-12-08 Thread Haren Myneni
to its parent. To prevent reusing the pid until the window closed, take reference to pid and task mm. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 44 ++--- arch/powerpc/platforms/powernv

[PATCH V2 05/13] powerpc/vas: Setup thread IRQ handler per VAS instance

2019-12-08 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 83 + arch/powerpc/platforms/powernv/vas-window.c | 60 + arch/powerpc/platforms/powernv/vas.c| 15 +- arch/powerpc/platforms/powernv/vas.h

[PATCH V2 06/13] powerpc/vas: Register NX with fault window ID and IRQ port value

2019-12-08 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15

[PATCH V2 02/13] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-12-08 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..b233d1e 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc/include

[PATCH V2 01/13] powerpc/vas: Describe vas-port and interrupts properties

2019-12-08 Thread Haren Myneni
Signed-off-by: Haren Myneni --- Documentation/devicetree/bindings/powerpc/ibm,vas.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/powerpc/ibm,vas.txt b/Documentation/devicetree/bindings/powerpc/ibm,vas.txt index bf11d2f..12de08b 100644

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

2019-12-08 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 message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26

RE: [PATCH 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2019-12-06 Thread Haren Myneni
>  > +static void notify_process(pid_t pid, u64 fault_addr)> +{> + int rc;> + struct kernel_siginfo info;> +> + memset(, 0, sizeof(info));> +> + info.si_signo = SIGSEGV;> + info.si_errno = EFAULT;> + info.si_code = SEGV_MAPERR;> +> + info.si_addr = (void *)fault_addr;> + rcu_read_lock();> + rc =

[PATCH 01/10] powerpc/vas: Define vas_win_paste_addr()

2019-12-15 Thread Haren Myneni
into their address space and then use copy and paste instructions to submit the CRBs to the NX engine. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 5 + arch/powerpc/platforms/powernv/vas-window.c | 10 ++ 2 files

[PATCH 04/10] crypto/nx: Initialize coproc entry with kzalloc

2019-12-15 Thread Haren Myneni
obe() Signed-off-by: Haren Myneni --- drivers/crypto/nx/nx-842-powernv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c index c037a24..8e63326 100644 --- a/drivers/crypto/nx/nx-842-powernv.c +++ b/driv

[PATCH 00/10] crypto/nx: Enable GZIP engine and provide userpace API

2019-12-15 Thread Haren Myneni
system to make sure no regression and tested GZIP compression on power9 with tests available in the above link. Thanks to Bulent Abali for nxz library and tests development. Haren Myneni (10): powerpc/vas: Define vas_win_paste_addr() powerpc/vas: Initialize window attributes for GZIP

[PATCH 08/10] crypto/NX: Add NX GZIP user space API

2019-12-15 Thread Haren Myneni
/paste instructions and pasting the CRBs to the virtual address (aka paste_address) returned by mmap(). Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- drivers/crypto/nx/Makefile| 2 +- drivers/crypto/nx/nx-842-powernv.h| 2 + drivers/crypto/nx/nx-commom

[PATCH 10/10] Documentation/powerpc: VAS API

2019-12-15 Thread Haren Myneni
-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- Documentation/powerpc/index.rst | 1 + Documentation/powerpc/vas-api.rst | 246 ++ 2 files changed, 247 insertions(+) create mode 100644 Documentation/powerpc/vas-api.rst diff --git

[PATCH 09/10] powerpc/vas: Remove 'pid' in vas_tx_win_attr struct

2019-12-15 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 --- arch/powerpc/include/asm/vas.h| 1 - drivers/crypto/nx/nx-commom-powernv.c | 1 - 2 files changed, 2

[PATCH 02/10] powerpc/vas: Initialize window attributes for GZIP compression

2019-12-15 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 05/10] crypto/nx: Organize powernv 842 code to add new GZIP compression type

2019-12-15 Thread Haren Myneni
Move common code for 842 and GZIP such as initializtion, read device tree entries and allocation of receive and send (kernel usage) windows to nx-common-powernv.c and keep 842 specific code in nx-842-powernv.c Signed-off-by: Haren Myneni --- drivers/crypto/nx/Makefile| 2

[PATCH 03/10] powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API

2019-12-15 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 userspace to send requests to NX directly with copy/paste instructions. Signed-off-by: Haren Myneni --- Documentation/ioctl/ioctl

[PATCH 06/10] crypto/NX: Make code generic to add new GZIP compression

2019-12-15 Thread Haren Myneni
Make code generic so that extend it to support new GZIP compression type. Changed nx842 reference to nx and moved some code to new functions. The actual functionality is not changed. Signed-off-by: Haren Myneni --- drivers/crypto/nx/nx-commom-powernv.c | 160

[PATCH 07/10] crypto/nx: Enable and setup GZIP compresstion type

2019-12-15 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 --- drivers/crypto/nx/nx-commom-powernv.c | 20 +++- 1

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

2019-12-16 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 message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26

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

2019-12-16 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

[PATCH V3 03/13] powerpc/vas: Read interrupts and vas-port device tree properties

2019-12-16 Thread Haren Myneni
Read interrupts and vas-port device tree properties per each VAS instance. NX generates an interrupt when it sees page fault on the request buffer. Interrupts property is used to setup IRQ for handing the fault and set port value for each user space send window. Signed-off-by: Haren Myneni

[PATCH V3 02/13] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-12-16 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..b233d1e 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc/include

[PATCH V3 09/13] powerpc/vas: Print CRB and FIFO values

2019-12-16 Thread Haren Myneni
Dump FIFO entry values 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

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

2019-12-16 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 121 + 1 file changed, 121 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 57f21ea..45bea15c 100644 --- a/arch/powerpc

[PATCH V3 04/13] powerpc/vas: Setup fault window per VAS instance

2019-12-16 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2

[PATCH V3 01/13] powerpc/vas: Describe vas-port and interrupts properties

2019-12-16 Thread Haren Myneni
Signed-off-by: Haren Myneni --- Documentation/devicetree/bindings/powerpc/ibm,vas.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/powerpc/ibm,vas.txt b/Documentation/devicetree/bindings/powerpc/ibm,vas.txt index bf11d2f..12de08b 100644

[PATCH V3 11/13] powerpc/VAS: Return credits after handling fault

2019-12-16 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas

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

2019-12-16 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

[PATCH V3 07/13] powerpc/vas: Take reference to PID and mm for userspace windows

2019-12-16 Thread Haren Myneni
to its parent. To prevent reusing the pid until the window closed, take reference to pid and task mm. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 53 ++--- arch/powerpc/platforms/powernv

[PATCH V3 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-12-16 Thread Haren Myneni
- Code cleanup as suggested by Christoph Hellwig Haren Myneni (13): powerpc/vas: Describe vas-port and interrupts properties powerpc/vas: Define nx_fault_stamp in coprocessor_request_block powerpc/vas: Read interrupts and vas-port device tree properties powerpc/vas: Setup fault window pe

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

2019-12-16 Thread Haren Myneni
On Thu, 2019-12-12 at 05:02 -0800, Christoph Hellwig wrote: > > + if (txwin->user_win) { > > + /* > > +* Window opened by child thread may not be closed when > > +* it exits. So take reference to its pid and release it > > +* when the window is free

[PATCH V3 06/13] powerpc/vas: Register NX with fault window ID and IRQ port value

2019-12-16 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15

[PATCH V3 05/13] powerpc/vas: Setup thread IRQ handler per VAS instance

2019-12-16 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 83 + arch/powerpc/platforms/powernv/vas-window.c | 60 + arch/powerpc/platforms/powernv/vas.c| 21 +++- arch/powerpc/platforms/powernv/vas.h

Re: [PATCH V2 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-12-11 Thread Haren Myneni
On Mon, 2019-12-09 at 02:38 -0600, Segher Boessenkool wrote: > Hi! > > On Mon, Dec 09, 2019 at 06:37:09AM +0100, Christophe Leroy wrote: > > What do you mean by NX ? > > It is the Power9 "Nest Accelerator". The patch series should ideally > mention that right at the start, yeah. Thanks, NX

[PATCH V2 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-12-11 Thread Haren Myneni
space requests. No page faults on kernel request buffer. Changelog: V2: - Use threaded IRQ instead of own kernel thread handler - Use pswid insted of user space CSB address to find valid CRB - Removed unused macros and other changes as suggested by Christoph Hellwig Haren Myneni (

[RFC PATCH 02/13] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-10-18 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..4015ed4 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch

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

2019-10-19 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB. If the actual fault is in CSB, send signal to process with SIGSEGV. Process can send new request by touching the fault address. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

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

2019-10-19 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 ---

[RFC PATCH 11/13] powerpc/vas: Return credits after handling fault

2019-10-19 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas

[RFC PATCH 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-10-18 Thread Haren Myneni
rn credits for send and fault windows after handling faults. Patch13: Fix closing send window after all credits are returned. This issue happens only for user space requests. No page faults on kernel request buffer. Haren Myneni (13): Revert "powerpc/powernv: re

[RFC PATCH 01/13] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

2019-10-18 Thread Haren Myneni
This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb. User space send windows (NX GZIP compression) need vas_win_paste_addr() to mmap window paste address and vas_win_id() to get window ID when window address is given. vas_win_id() is introduced in original commit 61f3cca8cda97

[RFC PATCH 04/13] powerpc/vas: Setup fault window per VAS instance

2019-10-18 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2

[RFC PATCH 03/13] powerpc/vas: Setup IRQ mapping and register port for each window

2019-10-18 Thread Haren Myneni
. So for kernel requests, ignore if interrupts property is not available. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- .../devicetree/bindings/powerpc/ibm,vas.txt| 5 ++ arch/powerpc/platforms/powernv/vas-window.c| 12 arch/powerpc/platforms/powernv

[RFC PATCH 09/13] powerpc/vas: Add and use tgid in vas_window to close window

2019-10-19 Thread Haren Myneni
to the parent. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 14 -- arch/powerpc/platforms/powernv/vas-window.c | 6 +- arch/powerpc/platforms/powernv/vas.h| 6 ++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch

[RFC PATCH 08/13] powerpc/vas: Print CRB and FIFO values

2019-10-19 Thread Haren Myneni
Dump FIFO values 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 | 40 ++ 1 file changed, 40 insertions(+) diff --git a/arch/powerpc/platforms

[RFC PATCH 13/13] powerpc/vas: Free send window after credits returned

2019-10-19 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

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

2019-10-19 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 message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26

[RFC PATCH 05/13] powerpc/vas: Setup fault handler per VAS instance

2019-10-19 Thread Haren Myneni
Fault handler is created as kernel thread for each VAS instance and invoked whenever NX generates page fault. This thread reads CRBs from fault FIFO and process them. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 53

[RFC PATCH 06/13] powerpc/vas: Read and process fault CRBs

2019-10-19 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 84 + arch/powerpc/platforms/powernv/vas-window.c | 51 ++ arch/powerpc/platforms/powernv/vas.h| 3 ++ 3 files changed, 138 insertions(+) diff

[PATCH 00/14] powerpc/vas: Page fault handling for user space NX requests

2019-11-26 Thread Haren Myneni
happens only for user space requests. No page faults on kernel request buffer. Haren Myneni (14): powerpc/vas: Describe vas-port and interrupts properties Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions" powerpc/vas: D

[PATCH 05/14] powerpc/vas: Setup fault window per VAS instance

2019-11-26 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2

[PATCH 07/14] powerpc/vas: Read and process fault CRBs

2019-11-26 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 81 + arch/powerpc/platforms/powernv/vas-window.c | 51 ++ arch/powerpc/platforms/powernv/vas.h| 3 ++ 3 files changed, 135 insertions(+) diff

[PATCH 12/14] powerpc/VAS: Return credits after handling fault

2019-11-26 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 9 + arch/powerpc/platforms/powernv/vas

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

2019-11-26 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

[PATCH 01/14] powerpc/vas: Describe vas-port and interrupts properties

2019-11-26 Thread Haren Myneni
[PATCH 01/14] powerpc/vas: Describe vas-port and interrupts properties Signed-off-by: Haren Myneni --- Documentation/devicetree/bindings/powerpc/ibm,vas.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/powerpc/ibm,vas.txt b/Documentation/devicetree

[PATCH 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-11-26 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..c071471 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch

[PATCH 06/14] powerpc/vas: Setup fault handler per VAS instance

2019-11-26 Thread Haren Myneni
Fault handler is created as kernel thread for each VAS instance and invoked whenever NX generates page fault. This thread reads CRBs from fault FIFO and process them. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 54

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

2019-11-26 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

[PATCH 02/14] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

2019-11-26 Thread Haren Myneni
This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb. User space send windows (NX GZIP compression) need vas_win_paste_addr() to mmap window paste address and vas_win_id() to get window ID when window address is given. Added vas_win_id() and vas_win_paste_addr() with: commit

[PATCH 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2019-11-26 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 121 - 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 7a8b2b5..dd27649 100644

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

2019-11-26 Thread Haren Myneni
to its parent. To prevent reusing the pid until the window closed, take reference to pid and task mm. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 44 ++--- arch/powerpc/platforms/powernv

[PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window

2019-11-26 Thread Haren Myneni
. So for kernel requests, ignore if interrupts property is not available. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 14 ++ arch/powerpc/platforms/powernv/vas.c| 68 ++--- arch/powerpc

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

2019-11-26 Thread Haren Myneni
Dump FIFO values 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 | 40 ++ 1 file changed, 40 insertions(+) diff --git a/arch/powerpc/platforms

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

2019-11-26 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 message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26

RE: [PATCH 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:30:55 AM: > > > +#define crb_csb_addr(c) __be64_to_cpu(c->csb_addr) > > +#define crb_nx_fault_addr(c) __be64_to_cpu > (c->stamp.nx.fault_storage_addr) > > +#define crb_nx_flags(c) c->stamp.nx.flags > > +#define crb_nx_fault_status(c)

RE: [PATCH 02/14] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:28:10 AM: > > On Tue, Nov 26, 2019 at 05:03:27PM -0800, Haren Myneni wrote: > > > > This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb. > > > > User space send windows (NX GZIP compression) need vas_w

RE: [PATCH 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:46:09 AM: > > > > +static void notify_process(pid_t pid, u64 fault_addr) > > +{ > > + int rc; > > + struct kernel_siginfo info; > > + > > + memset(, 0, sizeof(info)); > > + > > + info.si_signo = SIGSEGV; > > + info.si_errno = EFAULT; > > +

Re: [PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window

2019-12-19 Thread Haren Myneni
On Wed, 2019-12-18 at 15:13 -0800, Haren Myneni wrote: > On Wed, 2019-12-18 at 18:18 +1100, Oliver O'Halloran wrote: > > On Wed, Nov 27, 2019 at 12:07 PM Haren Myneni > > wrote: > > > > > > *snip* > > > > > > @@ -36,7 +62,18 @@ static int in

[PATCH V4 05/14] powerpc/vas: Setup fault window per VAS instance

2019-12-22 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2

[PATCH V4 10/14] powerpc/vas: Print CRB and FIFO values

2019-12-22 Thread Haren Myneni
Dump FIFO entry values 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

[PATCH V4 01/14] powerpc/xive: Define xive_native_alloc_irq_on_chip()

2019-12-22 Thread Haren Myneni
This function allocates IRQ on a specific chip. VAS needs per chip IRQ allocation and will have IRQ handler per VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/xive.h | 9 - arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files changed, 11 insertions(+), 4

[PATCH V4 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2019-12-22 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 120 + 1 file changed, 120 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 5c2cada..1d31d8d 100644 --- a/arch/powerpc

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

2019-12-22 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

[PATCH V4 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2019-12-22 Thread Haren Myneni
Alloc IRQ and get trigger port address for each VAS instance. Kernel register this IRQ per VAS instance and sets this port for each send window. NX interrupts the kernel when it sees page fault. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas.c | 34

[PATCH V4 12/14] powerpc/VAS: Return credits after handling fault

2019-12-22 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas

[PATCH V4 00/14] powerpc/vas: Page fault handling for user space NX requests

2019-12-22 Thread Haren Myneni
instance. It eliminates skiboot dependency as suggested by Oliver. Haren Myneni (14): powerpc/xive: Define xive_native_alloc_irq_on_chip() powerpc/xive: Define xive_native_alloc_get_irq_info() powerpc/vas: Define nx_fault_stamp in coprocessor_request_block powerpc/vas: Alloc and setup IRQ and trig

[PATCH V4 07/14] powerpc/vas: Register NX with fault window ID and IRQ port value

2019-12-22 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15

[PATCH V4 08/14] powerpc/vas: Take reference to PID and mm for userspace windows

2019-12-22 Thread Haren Myneni
to its parent. To prevent reusing the pid until the window closed, take reference to pid and task mm. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 53 ++--- arch/powerpc/platforms/powernv

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

2019-12-22 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

[PATCH V4 06/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2019-12-22 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 85 + arch/powerpc/platforms/powernv/vas-window.c | 60 arch/powerpc/platforms/powernv/vas.c| 21 ++- arch/powerpc/platforms/powernv/vas.h

[PATCH V4 13/14] powerpc/vas: Display process stuck message

2019-12-22 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 message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 27

[PATCH V4 02/14] powerpc/xive: Define xive_native_alloc_get_irq_info()

2019-12-22 Thread Haren Myneni
pnv_ocxl_alloc_xive_irq() in ocxl.c allocates IRQ and gets trigger port address. VAS also needs this function, but based on chip ID. So moved this common function to xive/native.c. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/xive.h | 2 ++ arch/powerpc/platforms/powernv

[PATCH V4 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-12-22 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..b233d1e 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc/include

Re: [PATCH V3 01/13] powerpc/vas: Describe vas-port and interrupts properties

2019-12-18 Thread Haren Myneni
On Wed, 2019-12-18 at 16:18 -0600, Rob Herring wrote: > On Mon, Dec 16, 2019 at 09:48:40PM -0800, Haren Myneni wrote: > > > > Commit message? > > > Signed-off-by: Haren Myneni > > Your author and S-o-b emails don't match. Thanks, Oliver suggested IRQ assign in

<    1   2   3   4   5   6   7   >