[PATCH] crypto: Fix return value check in aead_crypt()

2020-11-06 Thread Wang Qing
Fix passing zero to 'PTR_ERR' warning Signed-off-by: Wang Qing --- drivers/crypto/caam/caamalg_qi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c index 66f60d7..add60e8 --- a/drivers/crypto/caam/caamalg_qi.

[PATCH 02/32] crypto: qat - loader: fix status check in qat_hal_put_rel_rd_xfer()

2020-11-06 Thread Jack Xu
The return value of qat_hal_rd_ae_csr() is always a CSR value and never a status and should not be stored in the status variable of qat_hal_put_rel_rd_xfer(). This removes the assignment as qat_hal_rd_ae_csr() is not expected to fail. A more comprehensive handling of the theoretical corner case wh

[PATCH 05/32] crypto: qat - loader: remove unnecessary parenthesis

2020-11-06 Thread Jack Xu
Remove unnecessary parenthesis across the firmware loader. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_hal.c | 6 +++--- drivers/crypto/qat/qat_common/qat_uclo.c | 16 -

[PATCH 00/32] crypto: qat - rework firmware loader in preparation for qat_4xxx

2020-11-06 Thread Jack Xu
Rework firmware loader in QAT driver in preparation for the support of the qat_4xxx driver. Patch #1 add support for the mof format in the firmware loader Patches from #2 to #7 introduce some general fixes Patches from #8 to #30 rework and refactor the firmware loader to support the new features

[PATCH 01/32] crypto: qat - support for mof format in fw loader

2020-11-06 Thread Jack Xu
From: Giovanni Cabiddu Implement infrastructure for the Multiple Object File (MOF) format in the firmware loader. This will allow to load a specific firmware image contained inside an MOF file. This patch is based on earlier work done by Pingchao Yang. Signed-off-by: Giovanni Cabiddu Reviewed-

[PATCH 06/32] crypto: qat - loader: introduce additional parenthesis

2020-11-06 Thread Jack Xu
Introduce additional parenthesis to resolve a warninga reported by checkpatch. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/icp_qat_hal.h | 14 +++--- drivers/crypto/qat/qat_commo

[PATCH 11/32] crypto: qat - loader: refactor AE start

2020-11-06 Thread Jack Xu
Change the API and the behaviour of the qat_hal_start() function. With this change, the function starts under the hood all acceleration engines (AEs) and there is no longer need to call it for each engine. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Re

[PATCH 10/32] crypto: qat - loader: change micro word data mask

2020-11-06 Thread Jack Xu
Change micro word data mask since the Acceleration Engine (AE) instruction codes have been changed in the new generation QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_uclo

[PATCH 13/32] crypto: qat - loader: move defines to header files

2020-11-06 Thread Jack Xu
Move the definition of ICP_QAT_AE_OFFSET, ICP_QAT_CAP_OFFSET, LOCAL_TO_XFER_REG_OFFSET and ICP_QAT_EP_OFFSET from qat_hal.c to icp_qat_hal.h to avoid the definition of generation specific constants in qat_hal.c. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziem

[PATCH 12/32] crypto: qat - loader: remove global CSRs helpers

2020-11-06 Thread Jack Xu
Include the offset of GLOBAL_CSR directly into the enum hal_global_csr and remove the macros SET_GLB_CSR/GET_GLB_CSR to simplify the global CSR access. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/q

[PATCH 09/32] crypto: qat - loader: change type for ctx_mask

2020-11-06 Thread Jack Xu
Change type for ctx_mask from unsigned char to unsigned long to avoid type casting. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/adf_common_drv.h | 8 drivers/crypto/qat/qat_com

[PATCH 19/32] crypto: qat - loader: add support for lm2 and lm3

2020-11-06 Thread Jack Xu
Add support for local memory lm2 and lm3 which is introduced in the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../crypto/qat/qat_common/adf_common_drv.h| 2 + .../qat/qat_common

[PATCH 03/32] crypto: qat - loader: fix CSR access

2020-11-06 Thread Jack Xu
Do not mask the AE number with the AE mask when accessing the AE local CSRs. Bit 12 of the local CSR address is the start of AE number so just take out the AE mask here. Signed-off-by: Jack Xu Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/icp_qat_hal.h | 6 ++ 1 file chang

[PATCH 07/32] crypto: qat - loader: rename qat_uclo_del_uof_obj()

2020-11-06 Thread Jack Xu
Rename the function qat_uclo_del_uof_obj() in qat_uclo_del_obj() since it frees the memory allocated for all firmware objects. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/adf_accel_engin

[PATCH 04/32] crypto: qat - loader: fix error message

2020-11-06 Thread Jack Xu
Change message in error path of qat_uclo_check_image_compat() to report an incompatible firmware image that contains a neighbor register table. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_commo

[PATCH 20/32] crypto: qat - loader: add local memory size to chip info

2020-11-06 Thread Jack Xu
Add the local memory size to the chip info since the size of this memory will be different in the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/icp_qat_fw_l

[PATCH 08/32] crypto: qat - loader: add support for relative FW ucode loading

2020-11-06 Thread Jack Xu
Improve the way micro instructions (FW code) are uploaded to Accelerator Engines (AEs). If code starts at PC zero (absolute addressing), read uwords with no relative address. Otherwise, use relative addressing to the page region. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off

[PATCH 22/32] crypto: qat - loader: add clock enable CSR to chip info

2020-11-06 Thread Jack Xu
Add global clock enable CSR to the chip info since the CSR offset will be different in the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../crypto/qat/qat_common/icp_qat_fw_loader_handl

[PATCH 21/32] crypto: qat - loader: add reset CSR and mask to chip info

2020-11-06 Thread Jack Xu
Add reset CSR offset and mask to chip info since they are different in new QAT devices. This also simplifies the reset/clrReset functions by using the reset mask. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../qat/q

[PATCH 23/32] crypto: qat - loader: add wake up event to chip info

2020-11-06 Thread Jack Xu
Add the wake up event to chip info since this value will be different in the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/icp_qat_fw_loader_handle.h | 1 +

[PATCH 15/32] crypto: qat - loader: refactor long expressions

2020-11-06 Thread Jack Xu
Replace long expressions with local variables in the functions qat_uclo_wr_uimage_page(), qat_uclo_init_globals() and qat_uclo_init_umem_seg() to improve readability. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drive

[PATCH 16/32] crypto: qat - loader: introduce chip info structure

2020-11-06 Thread Jack Xu
Introduce the chip info structure which contains device specific information. The initialization path has been split between common and hardware specific in order to facilitate the introduction of the next generation hardware. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by

[PATCH 14/32] crypto: qat - loader: refactor qat_uclo_set_ae_mode()

2020-11-06 Thread Jack Xu
Refactor qat_uclo_set_ae_mode() by moving the logic that sets the AE modes to a separate function, qat_hal_set_modes(). Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_uclo.c | 69 ++

[PATCH 17/32] crypto: qat - loader: replace check based on DID

2020-11-06 Thread Jack Xu
Modify condition in qat_uclo_wr_mimage() to use a capability of the device (sram_visible), rather than the device ID, so the check is not specific to devices of the same type. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu -

[PATCH 18/32] crypto: qat - loader: add next neighbor to chip_info

2020-11-06 Thread Jack Xu
Introduce the next neighbor (NN) capability in chip_info as NN registers are not supported in certain SKUs of QAT. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../crypto/qat/qat_common/icp_qat_fw_loader_handle.h | 1

[PATCH 30/32] crypto: qat - loader: add support for shared ustore

2020-11-06 Thread Jack Xu
Add support for shared ustore mode support. This is required by the next generation of QAT devices to share the same fw image across engines. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../qat/qat_common/icp_qat_fw_

[PATCH 32/32] crypto: qat - loader: add gen4 firmware loader

2020-11-06 Thread Jack Xu
Add support for the QAT gen4 devices in the firmware loader. Signed-off-by: Jack Xu Reviewed-by: Giovanni Cabiddu --- .../crypto/qat/qat_common/adf_accel_devices.h | 2 + drivers/crypto/qat/qat_common/icp_qat_hal.h | 12 ++- drivers/crypto/qat/qat_common/icp_qat_uclo.h | 2 + drivers/crypt

[PATCH 25/32] crypto: qat - loader: add check for null pointer

2020-11-06 Thread Jack Xu
Add null pointer check when freeing the memory for firmware. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba --- drivers/crypto/qat/qat_common/qat_uclo.c | 28 ++-- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/driver

[PATCH 31/32] crypto: qat - loader: add support for broadcasting mode

2020-11-06 Thread Jack Xu
Add support for broadcasting mode in firmware loader to enable the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../qat/qat_common/icp_qat_fw_loader_handle.h | 1 + drivers/crypto/qat/

[PATCH 26/32] crypto: qat - loader: use ae_mask

2020-11-06 Thread Jack Xu
Use ae_mask to decide which Accelerator Engine (AE) to target in AE related operations, instead of a sequential loop, to skip AEs that are fused out. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat

[PATCH 24/32] crypto: qat - loader: add misc control CSR to chip info

2020-11-06 Thread Jack Xu
Add misc control CSR to chip info since the CSR offset will be different in the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../crypto/qat/qat_common/icp_qat_fw_loader_handle.h | 1 +

[PATCH 28/32] crypto: qat - loader: add FCU CSRs to chip info

2020-11-06 Thread Jack Xu
Add firmware control unit (FCU) CSRs to chip info so the firmware authentication code is common between all devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../qat/qat_common/icp_qat_fw_loader_handle.h | 6 +++

[PATCH 29/32] crypto: qat - loader: allow to target specific AEs

2020-11-06 Thread Jack Xu
Introduce new API, qat_uclo_set_cfg_ae_mask(), to allow the load of the firmware image to a subset of Acceleration Engines (AEs). This is required by the next generation of QAT devices to be able to load different firmware images to the device. Signed-off-by: Jack Xu Reviewed-by: Giovanni Cabiddu

[PATCH 27/32] crypto: qat - loader: add CSS3K support

2020-11-06 Thread Jack Xu
Add support for CSS3K, which uses RSA3K as image signature algorithm, to support the next generation of QAT devices. Signed-off-by: Jack Xu Co-developed-by: Wojciech Ziemba Signed-off-by: Wojciech Ziemba Reviewed-by: Giovanni Cabiddu --- .../qat/qat_common/icp_qat_fw_loader_handle.h | 1 + d

[PATCH] crypto: arm64/chacha - simplify tail block handling

2020-11-06 Thread Ard Biesheuvel
Based on lessons learnt from optimizing the 32-bit version of this driver, we can simplify the arm64 version considerably, by reordering the final two stores when the last block is not a multiple of 64 bytes. This removes the need to use permutation instructions to calculate the elements that are c

Re: [PATCH v5 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-11-06 Thread Josef Bacik
On 11/3/20 1:05 AM, Nick Terrell wrote: From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/btrfs/zstd.c | 48 1 file changed, 28 inserti

Re: [GIT PULL][PATCH v5 0/9] Update to zstd-1.4.6

2020-11-06 Thread Josef Bacik
On 11/3/20 1:05 AM, Nick Terrell wrote: From: Nick Terrell Please pull from g...@github.com:terrelln/linux.git tags/v5-zstd-1.4.6 to get these changes. Alternatively the patchset is included. Where did we come down on the code formatting question? Personally I'm of the mind that as lo

Re: [PATCH v5 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-11-06 Thread Nick Terrell
> On Nov 6, 2020, at 9:10 AM, Josef Bacik wrote: > > On 11/3/20 1:05 AM, Nick Terrell wrote: >> From: Nick Terrell >> Move away from the compatibility wrapper to the zstd-1.4.6 API. This >> code is functionally equivalent. >> Signed-off-by: Nick Terrell >> --- >> fs/btrfs/zstd.c | 48 +++

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-06 Thread Christoph Hellwig
You just keep resedning this crap, don't you? Haven't you been told multiple times to provide a proper kernel API by now? On Mon, Nov 02, 2020 at 10:05:27PM -0800, Nick Terrell wrote: > From: Nick Terrell > > Adds zstd_compat.h which provides the necessary functions from the > current zstd.h AP

Re: [GIT PULL][PATCH v5 0/9] Update to zstd-1.4.6

2020-11-06 Thread Nick Terrell
> On Nov 6, 2020, at 9:15 AM, Josef Bacik wrote: > > On 11/3/20 1:05 AM, Nick Terrell wrote: >> From: Nick Terrell >> Please pull from >> g...@github.com:terrelln/linux.git tags/v5-zstd-1.4.6 >> to get these changes. Alternatively the patchset is included. > > Where did we come down on the co

[PATCH v7] mm/zswap: move to use crypto_acomp API for hardware acceleration

2020-11-06 Thread Barry Song
Right now, all new ZIP drivers are adapted to crypto_acomp APIs rather than legacy crypto_comp APIs. Tradiontal ZIP drivers like lz4,lzo etc have been also wrapped into acomp via scomp backend. But zswap.c is still using the old APIs. That means zswap won't be able to work on any new ZIP drivers in