[PATCH 2/3] crypto: hisilicon/hpre - use the correct variable type

2021-04-10 Thread Hui Tang
The return value of 'le32_to_cpu' is unsigned, so change the variable type from 'int' to 'unsigned int'. Signed-off-by: Hui Tang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/dr

[PATCH 1/3] crypto: hisilicon/hpre - delete the rudundant space after return

2021-04-10 Thread Hui Tang
There are two spaces after return, just keep one. Signed-off-by: Hui Tang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 +- drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/dr

[PATCH 3/3] crypto: hisilicon/hpre - add debug log

2021-04-10 Thread Hui Tang
When the received sqe is abnormal, the error message in the sqe written back by the hardware is printed to help to analyze the abnormal causes. Signed-off-by: Hui Tang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 0/3] crypto: hisilicon/hpre - add debug log

2021-04-10 Thread Hui Tang
This patchset adds the debug log and cleanup code style. Hui Tang (3): crypto: hisilicon/hpre - delete the rudundant space after return crypto: hisilicon/hpre - use the correct variable type crypto: hisilicon/hpre - add debug log drivers/crypto/hisilicon/hpre/hpre_crypto.c | 11 +--

[PATCH] crypto: hisilicon/hpre - fix unmapping invalid dma address

2021-04-10 Thread Hui Tang
Currently, an invalid dma address may be unmapped when calling 'xx_data_clr_all' in error path, so check dma address of sqe in/out whether it has been mapped before calling 'dma_free_coherent' or 'dma_unmap_single'. An abnormal case is as follows: hpre_curve25519_compute_value -> hpre_curv

[PATCH v3] crypto: hisilicon/hpre - delete redundant log and return in advance

2021-04-10 Thread Hui Tang
'hpre_cfg_by_dsm' has checked and printed error path internally. It is not necessary to do it here, so remove it. It should return error immediately when return value of 'hpre_cfg_by_dsm' is non-zero, and no need to execute the remaining sentences. Signed-off-by: Hui Tang --- v1 -> v2: - Ret

[PATCH] crypto: crc32-generic - Use SPDX-License-Identifier

2021-04-10 Thread Christophe JAILLET
Use SPDX-License-Identifier: GPL-2.0-only, instead of hand writing it. This also removes a reference to http://www.xyratex.com which seems to be down. Signed-off-by: Christophe JAILLET --- crypto/crc32_generic.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) dif

[PATCH 00/16] Enable VAS and NX-GZIP support on powerVM

2021-04-10 Thread Haren Myneni
This patch series enables VAS / NX-GZIP on powerVM which allows the user space to do copy/paste with the same existing interface that is available on powerNV. VAS Enablement: - Get all VAS capabilities using H_QUERY_VAS_CAPABILITIES that are available in the hypervisor. These capabilities tell

[PATCH 01/16] powerpc/powernv/vas: Rename register/unregister functions

2021-04-10 Thread Haren Myneni
powerNV and pseries drivers register / unregister to the corresponding VAS code separately. So rename powerNV VAS API register/unregister functions. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 6 +++--- arch/powerpc/platforms/powernv/vas-api.c | 10 +- d

[PATCH 02/16] powerpc/vas: Make VAS API powerpc platform independent

2021-04-10 Thread Haren Myneni
Using the same /dev/crypto/nx-gzip interface for both powerNV and pseries. So this patcb moves VAS API to powerpc platform indepedent directory. The actual functionality is not changed in this patch. Signed-off-by: Haren Myneni --- arch/powerpc/Kconfig | 15 + arch

[PATCH 03/16] powerpc/vas: Create take/drop task reference functions

2021-04-10 Thread Haren Myneni
Take task reference when each window opens and drops during close. This functionality is needed for powerNV and pseries. So this patch defines the existing code as functions in powerpc platform independent vas-api.c Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h |

[PATCH 04/16] powerpc/vas: Move update_csb/dump_crb to platform independent

2021-04-10 Thread Haren Myneni
NX issues an interrupt when sees fault on user space buffer. The kernel processes the fault by updating CSB. This functionality is same for both powerNV and pseries. So this patch moves these functions to vas-api.c and the actual functionality is not changed. Signed-off-by: Haren Myneni --- ar

[PATCH 05/16] powerpc/vas: Define and use common vas_window struct

2021-04-10 Thread Haren Myneni
Same vas_window struct is used on powerNV and pseries. So this patch changes in struct vas_window to support both platforms and also the corresponding modifications in powerNV vas code. On powerNV vas_window is used for both TX and RX windows, whereas only for TX windows on powerVM. So some elem

[PATCH 06/16] powerpc/pseries/vas: Define VAS/NXGZIP HCALLs and structs

2021-04-10 Thread Haren Myneni
This patch adds HCALLs and other definitions. Also define structs that are used in VAS implementation on powerVM. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/hvcall.h| 7 ++ arch/powerpc/include/asm/vas.h | 28 arch/powerpc/platforms/pseries/vas.h | 96

[PATCH 07/16] powerpc/vas: Define QoS credit flag to allocate window

2021-04-10 Thread Haren Myneni
pHyp introduces two different type of credits: Default and Quality of service (QoS). The total number of default credits available on each LPAR depends on CPU resources configured. But these credits can be shared or over-committed across LPARs in shared mode which can result in paste command fai

[PATCH 08/16] powerpc/pseries/VAS: Implement allocate/modify/deallocate HCALLS

2021-04-10 Thread Haren Myneni
This patch adds the following HCALLs which are used to allocate, modify and deallocate VAS windows. H_ALLOCATE_VAS_WINDOW: Allocate VAS window H_DEALLOCATE_VAS_WINDOW: Close VAS window H_MODIFY_VAS_WINDOW: Setup window before using Also adds phyp call (H_QUERY_VAS_CAPABILITIES) to get all VAS c

[PATCH 09/16] powerpc/pseries/vas: Implement to get all capabilities

2021-04-10 Thread Haren Myneni
pHyp provides various VAS capabilities such as GZIP default and QoS capabilities which are used to determine total number of credits available in LPAR, maximum window credits, maximum LPAR credits, whether usermode copy/paste is supported, and etc. So first retrieve overall vas capabilities usin

[PATCH 10/16] powerpc/pseries/vas: Integrate API with open/close windows

2021-04-10 Thread Haren Myneni
This patch adds VAS window allocatioa/close with the corresponding HCALLs. Also changes to integrate with the existing user space VAS API and provide register/unregister functions to NX pseries driver. The driver register function is used to create the user space interface (/dev/crypto/nx-gzip)

[PATCH 11/16] powerpc/pseries/vas: Setup IRQ and fault handling

2021-04-10 Thread Haren Myneni
When NX sees a fault on the user space buffer, generates a fault interrupt and pHyp forwards that interrupt to OS. Then the kernel makes H_GET_NX_FAULT HCALL to retrieve the fault CRB information. This patch adds changes to setup IRQ per each window and handles fault by updating CSB. Signed-off

[PATCH 12/16] powerpc/pseries/vas: sysfs interface to export capabilities

2021-04-10 Thread Haren Myneni
pHyp provides GZIP default and GZIP QoS capabilities which gives the total number of credits are available in LPAR. This patch creates sysfs entries and exports LPAR credits, the currently used and the available credits for each feature. /sys/kernel/vas/VasCaps/VDefGzip: (default GZIP capabiliti

[PATCH 13/16] crypto/nx: Rename nx-842-pseries file name to nx-common-pseries

2021-04-10 Thread Haren Myneni
Rename nx-842-pseries.c to nx-common-pseries.c to add code for 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-pseries.c => nx-common-

[PATCH 14/16] crypto/nx: Register and unregister VAS interface

2021-04-10 Thread Haren Myneni
Changes to create /dev/crypto/nx-gzip interface with VAS register and to remove this interface with VAS unregister. Signed-off-by: Haren Myneni --- drivers/crypto/nx/nx-common-pseries.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/crypto/nx/nx-common-pseries.c b/driver

[PATCH 15/16] crypto/nx: Get NX capabilities for GZIP coprocessor type

2021-04-10 Thread Haren Myneni
phyp provides NX capabilities which gives recommended minimum compression / decompression length and maximum request buffer size in bytes. Changes to get NX overall capabilities which points to the specific features phyp supports. Then retrieve NXGZIP specific capabilities. Signed-off-by: Haren

[PATCH 16/16] crypto/nx: sysfs interface to export NX capabilities

2021-04-10 Thread Haren Myneni
Changes to export the following NXGZIP capabilities through sysfs: /sys/devices/vio/ibm,compression-v1/NxGzCaps: min_compress_len /*Recommended minimum compress length in bytes*/ min_decompress_len /*Recommended minimum decompress length in bytes*/ req_max_processed_len /* Maximum number of byt