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

2020-04-17 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 v6 0/9] crypto/nx: Enable GZIP engine and provide userpace API

2020-04-17 Thread Haren Myneni
coprocessor type (Michael Ellerman) (patches 3&7) Haren Myneni (9): powerpc/vas: Initialize window attributes for GZIP coprocessor type powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API powerpc/vas: Add VAS user space API crypto/nx: Initialize coproc entry with kzalloc crypto/nx: Rename nx-

[PATCH v11 14/14] powerpc: Use mm_context vas_windows counter to issue CP_ABORT

2020-04-16 Thread Haren Myneni
windows. We are adding VAS userspace support along with this fix. So no need to include this fix in stable releases. Fixes: 9d2a4d71332c ("powerpc: Define set_thread_uses_vas()") Signed-off-by: Haren Myneni Reported-by: Nicholas Piggin Suggested-by: Milton Miller Suggested-by: Nicho

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

2020-04-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 v11 12/14] powerpc/vas: Display process stuck message

2020-04-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 messages in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 30

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

2020-04-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 v11 10/14] powerpc/vas: Print CRB and FIFO values

2020-04-16 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

[PATCH v11 09/14] powerpc/vas: Return credits after handling fault

2020-04-16 Thread Haren Myneni
. If credits are not available, returns RMA_Busy for send window and RMA_Reject for fault window. NX expects OS to return credit for send window after processing fault CRB. Also credit has to be returned for fault window after handling the fault. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

[PATCH v11 07/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-04-16 Thread Haren Myneni
each CRB, determine the corresponding send window using pswid (from CRB) and process fault CRB. Then invalidate the entry and return credit. Processing fault CRB and return credit is described in subsequent patches. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc

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

2020-04-16 Thread Haren Myneni
applications, child thread may not be available. So if the task is not running, send signal to tgid. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 126 - 1 file changed, 125 insertions(+), 1 deletion

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

2020-04-16 Thread Haren Myneni
signal will be sent to thread group leader (tgid). Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 50 ++--- arch/powerpc/platforms/powernv/vas.h| 9 +- 3 files changed, 55

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

2020-04-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 v11 04/14] powerpc/vas: Setup fault window per VAS instance

2020-04-16 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch/powerpc/platforms/powernv/vas-fault.c | 77 + arch/powerpc/platforms/powernv/vas-window.c | 4 +- arch/powerpc/platforms/powernv/vas.c| 20 arch/powerpc/platforms/powernv/vas.h

[PATCH v11 03/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-04-16 Thread Haren Myneni
. Signed-off-by: Haren Myneni Reviewed-by: Cédric Le Goater --- arch/powerpc/platforms/powernv/vas.c | 44 +++- arch/powerpc/platforms/powernv/vas.h | 2 ++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch

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

2020-04-16 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..965b1f3 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc

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

2020-04-16 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 Reviewed-by: Cédric Le Goater --- arch/powerpc/include/asm/xive.h | 9 - arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files

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

2020-04-15 Thread Haren Myneni
isplay message during window close (patch12) - Moved set_thread_uses_vas() to vas_win_open() (patch14) Haren Myneni (14): powerpc/xive: Define xive_native_alloc_irq_on_chip() powerpc/vas: Define nx_fault_stamp in coprocessor_request_block powerpc/vas: Alloc and setup IRQ and trigger p

[PATCH v10 14/14] powerpc: Use mm_context vas_windows counter to issue CP_ABORT

2020-04-14 Thread Haren Myneni
(Thanks Michael for your review. Here is the updated patch with your comments and from Nick - Moved mm_context_add/remove_coproc() to add/remove_vas_window()) >From 521f86710f3605dc575f13634fd7520087993ffb Mon Sep 17 00:00:00 2001 From: Haren Myneni Date: Wed, 1 Apr 2020 23:12:12 -0500 Subj

[PATCH v10 14/14] powerpc: Use mm_context vas_windows counter to issue CP_ABORT

2020-04-02 Thread Haren Myneni
, issue CP_ABORT during context switch. It means clear the foreign real address mapping only if the process / thread uses COPY/PASTE. Then disable it for that process if windows are not open. Signed-off-by: Haren Myneni Reported-by: Nicholas Piggin Suggested-by: Milton Miller Suggested

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

2020-04-02 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 v10 12/14] powerpc/vas: Display process stuck message

2020-04-02 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 v10 11/14] powerpc/vas: Do not use default credits for receive window

2020-04-02 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 v10 10/14] powerpc/vas: Print CRB and FIFO values

2020-04-02 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

[PATCH v10 09/14] powerpc/vas: Return credits after handling fault

2020-04-02 Thread Haren Myneni
. If credits are not available, returns RMA_Busy for send window and RMA_Reject for fault window. NX expects OS to return credit for send window after processing fault CRB. Also credit has to be returned for fault window after handling the fault. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

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

2020-04-02 Thread Haren Myneni
applications, child thread may not be available. So if the task is not running, send signal to tgid. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 126 - 1 file changed, 125 insertions(+), 1 deletion

[PATCH v10 07/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-04-02 Thread Haren Myneni
each CRB, determine the corresponding send window using pswid (from CRB) and process fault CRB. Then invalidate the entry and return credit. Processing fault CRB and return credit is described in subsequent patches. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc

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

2020-04-02 Thread Haren Myneni
, SEGV signal will be sent to thread group leader (tgid). Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-debug.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 50 ++--- arch/powerpc/platforms/powernv/vas.h| 9 +- 3 files changed, 55

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

2020-04-02 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 v10 04/14] powerpc/vas: Setup fault window per VAS instance

2020-04-02 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch/powerpc/platforms/powernv/vas-fault.c | 77 + arch/powerpc/platforms/powernv/vas-window.c | 4 +- arch/powerpc/platforms/powernv/vas.c| 20 arch/powerpc/platforms/powernv/vas.h

[PATCH v10 03/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-04-02 Thread Haren Myneni
. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas.c | 44 +++- arch/powerpc/platforms/powernv/vas.h | 2 ++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv

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

2020-04-02 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..965b1f3 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc

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

2020-04-02 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 Reviewed-by: Cédric Le Goater --- arch/powerpc/include/asm/xive.h | 9 - arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files

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

2020-04-02 Thread Haren Myneni
atch to enable and disable CP_ABORT execution using mm_context->vas_windows counter. - Remove 'if (txwin)' line which is covered with 'else' before (patch6) Haren Myneni (14): powerpc/xive: Define xive_native_alloc_irq_on_chip() powerpc/vas: Define nx_fault_stamp in coprocessor_reques

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

2020-04-01 Thread Haren Myneni
send window in nx_delete_coprocs(). Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/crypto/nx/nx-common-powernv.c | 161 +- 1 file changed, 101 insertions(+), 60 deletions(-) diff --git a/drivers/crypto/nx/nx-common-powernv.c b/drivers/crypto/nx/nx

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

2020-04-01 Thread Haren Myneni
. Then if child thread is not running, SEGV signal will be sent to thread group leader (tgid). 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/vas.h

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

2020-04-01 Thread Haren Myneni
. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- Documentation/powerpc/index.rst | 1 + Documentation/powerpc/vas-api.rst | 292 ++ 2 files changed, 293 insertions(+) create mode 100644 Documentation/powerpc/vas-api.rst diff --git

[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

[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 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

[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

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

2020-04-01 Thread Haren Myneni
obe() Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- 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-

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

2020-04-01 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 11 ++ arch/powerpc/platforms/powernv/Makefile | 2 +- arch/powerpc/platforms/powernv/vas-api.c| 257 arch/powerpc/platforms/powernv/vas-window.c | 6

[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

[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 0/9] crypto/nx: Enable GZIP engine and provide userpace API

2020-04-01 Thread Haren Myneni
VAS API documentation in patch and other changes as Daniel Axtens suggested V5: - Added "NX Fault handling" section in VAS API documentation as Nick suggested. - Dcoumentation: mmap size should be PAGE_SIZE as Daniel Axtens pointed. Haren Myneni (9): powerpc/vas: Initialize

[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

[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 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

[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

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

2020-04-01 Thread Haren Myneni
. If credits are not available, returns RMA_Busy for send window and RMA_Reject for fault window. NX expects OS to return credit for send window after processing fault CRB. Also credit has to be returned for fault window after handling the fault. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

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

2020-04-01 Thread Haren Myneni
applications, child thread may not be available. So if the task is not running, send signal to tgid. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 126 - 1 file changed, 125 insertions(+), 1 deletion

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

2020-04-01 Thread Haren Myneni
each CRB, determine the corresponding send window using pswid (from CRB) and process fault CRB. Then invalidate the entry and return credit. Processing fault CRB and return credit is described in subsequent patches. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc

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

2020-04-01 Thread Haren Myneni
signal will be sent to thread group leader (tgd). 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/vas.h| 9 - 3 files changed, 57

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

2020-04-01 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 v9 04/13] powerpc/vas: Setup fault window per VAS instance

2020-04-01 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch/powerpc/platforms/powernv/vas-fault.c | 77 + arch/powerpc/platforms/powernv/vas-window.c | 4 +- arch/powerpc/platforms/powernv/vas.c| 20 arch/powerpc/platforms/powernv/vas.h

[PATCH v9 03/13] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-04-01 Thread Haren Myneni
. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas.c | 44 +++- arch/powerpc/platforms/powernv/vas.h | 2 ++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv

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

2020-04-01 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/include/asm/icswx.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9872f85..965b1f3 100644 --- a/arch/powerpc/include/asm/icswx.h +++ b/arch/powerpc

[PATCH v9 01/13] powerpc/xive: Define xive_native_alloc_irq_on_chip()

2020-04-01 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 Reviewed-by: Cédric Le Goater --- arch/powerpc/include/asm/xive.h | 9 - arch/powerpc/sysdev/xive/native.c | 6 +++--- 2 files

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

2020-04-01 Thread Haren Myneni
PID reference" patch before setting VAS fault handler patch - Removed mutex_lock/unlock (patch7) - Other cleanup changes Haren Myneni (13): powerpc/xive: Define xive_native_alloc_irq_on_chip() powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

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

2020-03-24 Thread Haren Myneni
On Tue, 2020-03-24 at 14:41 +1100, Michael Ellerman wrote: > Daniel Axtens writes: > > Michael Ellerman writes: > >> Daniel Axtens writes: > >>> Haren Myneni writes: > >>>> diff --git a/arch/powerpc/platforms/powernv/vas-api.c > >>>>

Re: [PATCH v8 12/14] powerpc/vas: Return credits after handling fault

2020-03-24 Thread Haren Myneni
ow this credit system works. Thought vas_return_credit() is unique function and added as separate patch so that easy to review. > > > > > Signed-off-by: Sukadev Bhattiprolu > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/platforms/powernv/vas-fault.c |

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

2020-03-24 Thread Haren Myneni
On Mon, 2020-03-23 at 12:40 +1000, Nicholas Piggin wrote: > Haren Myneni's on March 19, 2020 4:18 pm: > > > > 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

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

2020-03-24 Thread Haren Myneni
the request, it raises an interrupt on the CPU to > handle the fault. > > > > > > Signed-off-by: Sukadev Bhattiprolu > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/platforms/powernv/vas-fault.c | 90 > > + >

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

2020-03-24 Thread Haren Myneni
On Tue, 2020-03-24 at 15:48 +0100, Cédric Le Goater wrote: > On 3/19/20 7:14 AM, Haren Myneni wrote: > > > > 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

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

2020-03-23 Thread Haren Myneni
On Mon, 2020-03-23 at 10:27 +0100, Cédric Le Goater wrote: > On 3/23/20 10:06 AM, Cédric Le Goater wrote: > > On 3/19/20 7:14 AM, Haren Myneni wrote: > >> > >> Alloc IRQ and get trigger port address for each VAS instance. Kernel > >> register this IRQ per VAS

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

2020-03-23 Thread Haren Myneni
ge fault. User space gets the signal > >> and handles the fault mentioned in CRB by bringing the page in to > >> memory and send NX request again. > >> > >> Signed-off-by: Sukadev Bhattiprolu > >> Signed-off-by: Haren Myneni > >> --- > >>

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

2020-03-22 Thread Haren Myneni
-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- Documentation/powerpc/index.rst | 1 + Documentation/powerpc/vas-api.rst | 249 ++ 2 files changed, 250 insertions(+) create mode 100644 Documentation/powerpc/vas-api.rst diff --git

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

2020-03-22 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-common-powernv.c | 1 - 2 files changed, 2

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

2020-03-22 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-common-powernv.c | 43

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

2020-03-22 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

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

2020-03-22 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 --- drivers/crypto/nx/Makefile|2 +- drivers/crypto/nx/nx-842-powernv.c| 1062

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

2020-03-22 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 v4 3/9] powerpc/vas: Add VAS user space API

2020-03-22 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 11 ++ arch/powerpc/platforms/powernv/Makefile | 2 +- arch/powerpc/platforms/powernv/vas-api.c| 257 arch/powerpc/platforms/powernv/vas-window.c | 6

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

2020-03-22 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/userspace

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

2020-03-22 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 v4 0/9] crypto/nx: Enable GZIP engine and provide userpace API

2020-03-22 Thread Haren Myneni
VAS API documentation in patch and other changes as Daniel Axtens suggested Haren Myneni (9): powerpc/vas: Initialize window attributes for GZIP coprocessor type powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API powerpc/vas: Add VAS user space API crypto/nx: Initialize coproc entry with kzalloc

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

2020-03-22 Thread Haren Myneni
On Mon, 2020-03-23 at 10:06 +1000, Nicholas Piggin wrote: > Haren Myneni's on March 18, 2020 5:27 am: > > On Tue, 2020-03-17 at 16:28 +1100, Michael Ellerman wrote: > >> Haren Myneni writes: > >> > For each fault CRB, update fault address in CRB (fault_storage_addr

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

2020-03-22 Thread Haren Myneni
the fault mentioned in CRB by bringing the page in to > > memory and send NX request again. > > > > Signed-off-by: Sukadev Bhattiprolu > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/include/asm/icswx.h | 18 +- > > 1 file change

Re: [PATCH v3 9/9] Documentation/powerpc: VAS API

2020-03-22 Thread Haren Myneni
has to establish channel to NX for userspace. This document > > describes user space API that application can use to establish > > communication channel. > > > > Signed-off-by: Sukadev Bhattiprolu > > Signed-off-by: Haren Myneni > > --- > > Documentation/

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

2020-03-22 Thread Haren Myneni
On Fri, 2020-03-20 at 23:18 +1100, Daniel Axtens wrote: > Haren Myneni writes: > > > On power9, userspace can send GZIP compression requests directly to NX > > once kernel establishes NX channel / window with VAS. This patch provides > > user space API which allows

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

2020-03-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

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

2020-03-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 messages in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 28

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

2020-03-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 | 9 + arch/powerpc/platforms/powernv/vas

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

2020-03-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 --- arch/powerpc/platforms/powernv

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

2020-03-19 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

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

2020-03-19 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 115 + 1 file changed, 115 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 1c6d5cc..6eceac5d 100644 --- a/arch/powerpc

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

2020-03-19 Thread Haren Myneni
are pending. If the csb_addr passed in these requests is invalid, kernel will end up sending signal to the wrong task. To prevent reusing the pid, take references to pid and mm when the window is opened and release them during window close. Signed-off-by: Haren Myneni --- arch/powerpc/platforms

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

2020-03-19 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 v8 06/14] powerpc/vas: Setup thread IRQ handler per VAS instance

2020-03-19 Thread Haren Myneni
-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 90 + arch/powerpc/platforms/powernv/vas-window.c | 60 +++ arch/powerpc/platforms/powernv/vas.c| 49 +++- arch/powerpc/platforms/powernv

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

2020-03-19 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets a 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 v8 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

2020-03-19 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 v8 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2020-03-19 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 v8 02/14] powerpc/xive: Define xive_native_alloc_get_irq_info()

2020-03-19 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 v8 01/14] powerpc/xive: Define xive_native_alloc_irq_on_chip()

2020-03-19 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 v8 00/14] powerpc/vas: Page fault handling for user space NX requests

2020-03-19 Thread Haren Myneni
(patch8) - Move barrier before csb.flags store and add WARN_ON_ONCE() checks (patch9) 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/va

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

2020-03-18 Thread Haren Myneni
On Thu, 2020-03-19 at 12:16 +1100, Daniel Axtens wrote: > Haren Myneni writes: > > > On power9, userspace can send GZIP compression requests directly to NX > > once kernel establishes NX channel / window with VAS. This patch provides > > user space API which allows

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

2020-03-17 Thread Haren Myneni
On Tue, 2020-03-17 at 16:28 +1100, Michael Ellerman wrote: > Haren Myneni writes: > > For each fault CRB, update fault address in CRB (fault_storage_addr) > > and translation error status in CSB so that user space can touch the > > fault address and resend the request. If

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

2020-03-17 Thread Haren Myneni
On Tue, 2020-03-17 at 15:09 +1100, Michael Ellerman wrote: > Haren Myneni writes: > > Process close windows after its requests are completed. In multi-thread > > applications, child can open a window but release FD will not be called > > upon its exit. Parent thread will be

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

2020-03-16 Thread Haren Myneni
available in the above link. > > > > Thanks to Bulent Abali for nxz library and tests development. > > > > Changelog: > > V2: > > - Move user space API code to powerpc as suggested. Also this API > > can be extended to any other coprocessor type th

Re: [PATCH 0/5] selftests/powerpc: Add NX-GZIP engine testcase

2020-03-16 Thread Haren Myneni
On Mon, 2020-03-16 at 15:07 -0300, Raphael Moreira Zinsly wrote: > This patch series are intended to test the power8 and power9 Nest > Accelerator (NX) GZIP engine that is being introduced by > https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-March/205659.html > More information about how to

<    1   2   3   4   5   6   7   >