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

2020-03-06 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 v3 8/9] crypto/nx: Remove 'pid' in vas_tx_win_attr struct

2020-03-06 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 v3 7/9] crypto/nx: Enable and setup GZIP compresstion type

2020-03-06 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 v3 6/9] crypto/NX: Make enable code generic to add new GZIP compression type

2020-03-06 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 v3 5/9] crypto/nx: Rename nx-842-powernv file name to nx-common-powernv

2020-03-06 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 v3 4/9] crypto/nx: Initialize coproc entry with kzalloc

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

2020-03-06 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| 290 arch/powerpc/platforms/powernv/vas-window.c | 6

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

2020-03-06 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 v3 1/9] powerpc/vas: Initialize window attributes for GZIP coprocessor type

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

2020-03-06 Thread Haren Myneni
that VAS can support in future. Example: Fast thread wakeup feature from VAS - Rebased to 5.6-rc3 V3: - Fix sparse warnings (patches 3&6) Haren Myneni (9): powerpc/vas: Initialize window attributes for GZIP coprocessor type powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API powerpc

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

2020-03-06 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 V7 14/14] powerpc/vas: Free send window in VAS instance after credits returned

2020-03-06 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 V7 12/14] powerpc/vas: Return credits after handling fault

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

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

2020-03-06 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 V7 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

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

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

2020-03-06 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 V7 07/14] powerpc/vas: Register NX with fault window ID and IRQ port value

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

2020-03-06 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 V7 05/14] powerpc/vas: Setup fault window per VAS instance

2020-03-06 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 V7 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

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

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

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

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

2020-03-06 Thread Haren Myneni
nd CCW[0] bit to find valid CRB in fault FIFO (Patch6). - Return fault address to user space in BE and other changes as suggested by Michael Neuling. (patch9) - Rebased to 5.6-rc4 V7: - Fix sparse warnings (patches 6,9 and 10) Haren Myneni (14): powerpc/xive

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

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

2020-03-04 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 V6 12/14] powerpc/vas: Return credits after handling fault

2020-03-04 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 V6 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-03-04 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 114 + 1 file changed, 114 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 85e4280..c79fdbd 100644 --- a/arch/powerpc

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

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

2020-03-04 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 V6 08/14] powerpc/vas: Take reference to PID and mm for user space windows

2020-03-04 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 V6 07/14] powerpc/vas: Register NX with fault window ID and IRQ port value

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

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

2020-03-04 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 V6 04/14] powerpc/vas: Alloc and setup IRQ and trigger port address

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

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

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

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

2020-03-04 Thread Haren Myneni
nd CCW[0] bit to find valid CRB in fault FIFO (Patch6). - Return fault address to user space in BE and other changes as suggested by Michael Neuling. (patch9) - Rebased to 5.6-rc4 Haren Myneni (14): powerpc/xive: Define xive_native_alloc_irq_on_chip() powerpc/xive

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

2020-02-29 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 V2 8/9] crypto/nx: Remove 'pid' in vas_tx_win_attr struct

2020-02-29 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 V2 7/9] crypto/nx: Enable and setup GZIP compression type

2020-02-29 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 V2 6/9] crypto/nx: Make enable code generic to add new GZIP compression type

2020-02-29 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. The actual functionality is not changed. Signed-off-by: Haren Myneni --- drivers/crypto/nx/nx-common-powernv.c | 159

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

2020-02-29 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 V2 4/9] crypto/nx: Initialize coproc entry with kzalloc

2020-02-29 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 V3 3/9] powerpc/vas: Add VAS user space API

2020-02-29 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| 290 arch/powerpc/platforms/powernv/vas-window.c | 6

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

2020-02-29 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 V2 1/9] powerpc/vas: Initialize window attributes for GZIP coprocessor type

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

2020-02-29 Thread Haren Myneni
that VAS can support in future. Example: Fast thread wakeup feature from VAS - Rebased to 5.6-rc3 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

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

2020-02-09 Thread Haren Myneni
On Fri, 2020-02-07 at 16:57 +1100, Michael Neuling wrote: > > /* > > + * Process CRBs that we receive on the fault window. > > + */ > > +irqreturn_t vas_fault_handler(int irq, void *data) > > +{ > > + struct vas_instance *vinst = data; > > + struct coprocessor_request_block buf, *crb; > > +

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

2020-02-09 Thread Haren Myneni
Mikey, Thanks for your review comments. On Fri, 2020-02-07 at 16:46 +1100, Michael Neuling wrote: > On Wed, 2020-01-22 at 00:17 -0800, Haren Myneni wrote: > > For each fault CRB, update fault address in CRB (fault_storage_addr) > > and translation error status in CSB so that user

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

2020-01-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 V5 13/14] powerpc/vas: Display process stuck message

2020-01-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 V5 12/14] powerpc/VAS: Return credits after handling fault

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

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

2020-01-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 V5 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2020-01-22 Thread Haren Myneni
Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 116 + 1 file changed, 116 insertions(+) diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index 5c2cada..2cfab0c 100644 --- a/arch/powerpc

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

2020-01-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 V5 07/14] powerpc/vas: Register NX with fault window ID and IRQ port value

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

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

2020-01-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 +- arch

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

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

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

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

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

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

2020-01-21 Thread Haren Myneni
instance. It eliminates skiboot dependency as suggested by Oliver. V5: - Do not update CSB if the process is exiting (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_fau

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

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

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

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

2019-12-19 Thread Haren Myneni
On Tue, 2019-12-17 at 17:33 +0800, Herbert Xu wrote: > On Sun, Dec 15, 2019 at 05:05:19AM -0800, Haren Myneni wrote: > > > > On power9, userspace can send GZIP compression requests directly to NX > > once kernel establishes NX channel / window. This patch provides GZIP >

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

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

2019-12-18 Thread Haren Myneni
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 init_vas_instance(struct platform_device > > *pdev

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

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

<    1   2   3   4   5   6   7   >