[PATCH V2 1/2] powerpc/vas: Report proper error code for address translation failure

2020-07-10 Thread Haren Myneni
addresses. This patch defines CSB_CC_FAULT_ADDRESS(250) and updates CSB.CC with this proper error code for user space. Signed-off-by: Haren Myneni Changes in V2: - Use CSB_CC_FAULT_ADDRESS instead of CSB_CC_ADDRESS_TRANSLATION to distinguish from other error codes. - Add NX workbook reference in

RE: [PATCH 1/2] powerpc/vas: Report proper error for address translation failure

2020-07-09 Thread Haren Myneni
"Linuxppc-dev" wrote on 07/09/2020 04:22:10 AM: > From: Michael Ellerman > To: Haren Myneni > Cc: tuli...@br.ibm.com, ab...@us.ibm.com, linuxppc- > d...@lists.ozlabs.org, rzin...@linux.ibm.com > Date: 07/09/2020 04:21 AM > Subject: [EXTERNAL] Re: [PATCH 1/2] powe

[PATCH 2/2] selftests/powerpc: Use proper error code to check fault address

2020-07-08 Thread Haren Myneni
the request is not successful. Signed-off-by: Haren Myneni --- tools/testing/selftests/powerpc/nx-gzip/gunz_test.c | 4 ++-- tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/powerpc/nx-gzip

[PATCH 1/2] powerpc/vas: Report proper error for address translation failure

2020-07-08 Thread Haren Myneni
. This patch defines CSB_CC_ADDRESS_TRANSLATION(250) and updates CSB.CC with this proper error code for user space. Signed-off-by: Haren Myneni --- Documentation/powerpc/vas-api.rst | 2 +- arch/powerpc/include/asm/icswx.h | 2 ++ arch/powerpc/platforms/powernv/vas-fault.c | 2

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

2020-04-22 Thread Haren Myneni
Thanks for fixing. Tested with this patch and 7fe021a3f1c9 ("kernel: better document the use_mm/unuse_mm API contract"). Acked-by: Haren Myneni On 4/21/20 11:39 PM, Stephen Rothwell wrote: > Hi all, > > After merging the akpm tree, today's linux-next build (p

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

2020-04-21 Thread Haren Myneni
Stephen, Sorry missed it. Thanks for fixing it. Acked-by: Haren Myneni On 4/21/20 10:41 PM, Stephen Rothwell wrote: > Hi all, > > After merging the powerpc tree, today's linux-next build (powerpc > allyesconfig) failed like this: > > In file included from :32: > ./us

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

2020-04-17 Thread Haren Myneni
-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 a

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

2020-04-17 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.

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

2020-04-17 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 | 46

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

2020-04-17 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 v6 5/9] crypto/nx: Rename nx-842-powernv file name to nx-common-powernv

2020-04-17 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 v6 4/9] crypto/nx: Initialize coproc entry with kzalloc

2020-04-17 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 v6 3/9] powerpc/vas: Add VAS user space API

2020-04-17 Thread Haren Myneni
Thanks to Michael Ellerman for his changes and suggestions to make the ioctl generic to support any coprocessor type. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 12 ++ arch/powerpc/platforms/powernv/Makefile | 2 +- ar

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

2020-04-17 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 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
to support any 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

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

2020-04-15 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-15 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-15 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-15 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-15 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-15 Thread Haren Myneni
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-15 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-15 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-15 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-15 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-15 Thread Haren Myneni
: 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-15 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-15 Thread Haren Myneni
: 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-15 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
instead of pr_debug to display 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 an

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

[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
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
: 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
: 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
ude patch 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_st

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

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

[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
Signed-off-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-wind

[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
paste links in 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:

[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
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
: 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
: 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
king 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
and How 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 is

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

2020-03-24 Thread Haren Myneni
n 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 in

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
ault. 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 a

[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

[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
Signed-off-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-wind

[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
paste links in 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

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

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

2020-03-22 Thread Haren Myneni
ndles 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 c

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

2020-03-22 Thread Haren Myneni
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-18 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-18 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-18 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-18 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-18 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-18 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

<    1   2   3   4   5   6   7   >