| e7507439 | 18-Dec-2025 |
Qi Tao <taoqi10@huawei.com> |
crypto: hisilicon/sec2 - support skcipher/aead fallback for hardware queue unavailable
When all hardware queues are busy and no shareable queue, new processes fail to apply for queues. To avoid affe
crypto: hisilicon/sec2 - support skcipher/aead fallback for hardware queue unavailable
When all hardware queues are busy and no shareable queue, new processes fail to apply for queues. To avoid affecting tasks, support fallback mechanism when hardware queues are unavailable.
Fixes: c16a70c1f253 ("crypto: hisilicon/sec - add new algorithm mode for AEAD") Signed-off-by: Qi Tao <taoqi10@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 21452eaa | 18-Dec-2025 |
Chenghai Huang <huangchenghai2@huawei.com> |
crypto: hisilicon/qm - enhance the configuration of req_type in queue attributes
Originally, when a queue was requested, it could only be configured with the default algorithm type of 0. Now, when m
crypto: hisilicon/qm - enhance the configuration of req_type in queue attributes
Originally, when a queue was requested, it could only be configured with the default algorithm type of 0. Now, when multiple tfms use the same queue, the queue must be selected based on its attributes to meet the requirements of tfm tasks. So the algorithm type attribute of queue need to be distinguished. Just like a queue used for compression in ZIP cannot be used for decompression tasks.
Fixes: 3f1ec97aacf1 ("crypto: hisilicon/qm - Put device finding logic into QM") Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 80736a97 | 13-Sep-2025 |
Weili Qian <qianweili@huawei.com> |
crypto: hisilicon - enable error reporting again
When an error occurs on the device, an interrupt is reported. When the firmware forwards the interrupt to the driver and masks the error. If the driv
crypto: hisilicon - enable error reporting again
When an error occurs on the device, an interrupt is reported. When the firmware forwards the interrupt to the driver and masks the error. If the driver does not enable error reporting when an error does not need to be reset, the device does not report the error to the driver when the error occurs again. Therefore, after the driver obtains the information, the error reporting needs to be enabled again.
Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 56e6f77e | 30-Aug-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: hisilicon/sec2 - Fix false-positive warning of uninitialised qp_ctx
Fix the false-positive warning of qp_ctx being unitialised in sec_request_init. The value of ctx_q_num defaults to 2 and
crypto: hisilicon/sec2 - Fix false-positive warning of uninitialised qp_ctx
Fix the false-positive warning of qp_ctx being unitialised in sec_request_init. The value of ctx_q_num defaults to 2 and is guaranteed to be non-zero.
Thus qp_ctx is always initialised. However, the compiler is not aware of this constraint on ctx_q_num. Restructure the loop so that it is obvious to the compiler that ctx_q_num cannot be zero.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Reviewed-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 41eab2a9 | 21-Aug-2025 |
Qianfeng Rong <rongqianfeng@vivo.com> |
crypto: hisilicon - use kcalloc() instead of kzalloc()
As noted in the kernel documentation [1], open-coded multiplication in allocator arguments is discouraged because it can lead to integer overfl
crypto: hisilicon - use kcalloc() instead of kzalloc()
As noted in the kernel documentation [1], open-coded multiplication in allocator arguments is discouraged because it can lead to integer overflow.
Use devm_kcalloc() to gain built-in overflow protection, making memory allocation safer when calculating allocation size compared to explicit multiplication.
Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments #1 Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 1f9128f1 | 21-Aug-2025 |
Weili Qian <qianweili@huawei.com> |
crypto: hisilicon - check the sva module status while enabling or disabling address prefetch
After enabling address prefetch, check the sva module status. If all previous prefetch requests from the
crypto: hisilicon - check the sva module status while enabling or disabling address prefetch
After enabling address prefetch, check the sva module status. If all previous prefetch requests from the sva module are not completed, then disable the address prefetch to ensure normal execution of new task operations. After disabling address prefetch, check if all requests from the sva module have been completed.
Fixes: a5c164b195a8 ("crypto: hisilicon/qm - support address prefetching") Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| f0ae287c | 10-Jul-2025 |
Wenkai Lin <linwenkai6@hisilicon.com> |
crypto: hisilicon/sec2 - implement full backlog mode for sec
This patch introduces a hierarchical backlog mechanism to cache user data in high-throughput encryption/decryption scenarios, the impleme
crypto: hisilicon/sec2 - implement full backlog mode for sec
This patch introduces a hierarchical backlog mechanism to cache user data in high-throughput encryption/decryption scenarios, the implementation addresses packet loss issues when hardware queues overflow during peak loads.
First, we use sec_alloc_req_id to obtain an exclusive resource from the pre-allocated resource pool of each queue, if no resource is allocated, perform the DMA map operation on the request memory.
When the task is ready, we will attempt to send it to the hardware, if the hardware queue is already full, we cache the request into the backlog list, then return an EBUSY status to the upper layer and instruct the packet-sending thread to pause transmission. Simultaneously, when the hardware completes a task, it triggers the sec callback function, within this function, reattempt to send the requests from the backlog list and wake up the sending thread until the hardware queue becomes fully occupied again.
In addition, it handles such exceptions like the hardware is reset when packets are sent, it will switch to the software computing and release occupied resources.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| f4f353cb | 05-Feb-2025 |
Wenkai Lin <linwenkai6@hisilicon.com> |
crypto: hisilicon/sec2 - fix for sec spec check
During encryption and decryption, user requests must be checked first, if the specifications that are not supported by the hardware are used, the soft
crypto: hisilicon/sec2 - fix for sec spec check
During encryption and decryption, user requests must be checked first, if the specifications that are not supported by the hardware are used, the software computing is used for processing.
Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2") Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| a49cc71e | 05-Feb-2025 |
Wenkai Lin <linwenkai6@hisilicon.com> |
crypto: hisilicon/sec2 - fix for aead authsize alignment
The hardware only supports authentication sizes that are 4-byte aligned. Therefore, the driver switches to software computation in this case.
crypto: hisilicon/sec2 - fix for aead authsize alignment
The hardware only supports authentication sizes that are 4-byte aligned. Therefore, the driver switches to software computation in this case.
Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2") Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| a5a9d959 | 13-Dec-2024 |
Wenkai Lin <linwenkai6@hisilicon.com> |
crypto: hisilicon/sec2 - fix for aead invalid authsize
When the digest alg is HMAC-SHAx or another, the authsize may be less than 4 bytes and mac_len of the BD is set to zero, the hardware considers
crypto: hisilicon/sec2 - fix for aead invalid authsize
When the digest alg is HMAC-SHAx or another, the authsize may be less than 4 bytes and mac_len of the BD is set to zero, the hardware considers it a BD configuration error and reports a ras error, so the sec driver needs to switch to software calculation in this case, this patch add a check for it and remove unnecessary check that has been done by crypto.
Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2") Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| fd337f85 | 13-Dec-2024 |
Wenkai Lin <linwenkai6@hisilicon.com> |
crypto: hisilicon/sec2 - fix for aead icv error
When the AEAD algorithm is used for encryption or decryption, the input authentication length varies, the hardware needs to obtain the input length to
crypto: hisilicon/sec2 - fix for aead icv error
When the AEAD algorithm is used for encryption or decryption, the input authentication length varies, the hardware needs to obtain the input length to pass the integrity check verification. Currently, the driver uses a fixed authentication length,which causes decryption failure, so the length configuration is modified. In addition, the step of setting the auth length is unnecessary, so it was deleted from the setkey function.
Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2") Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| c418ba6b | 26-Oct-2024 |
Weili Qian <qianweili@huawei.com> |
crypto: hisilicon/qm - disable same error report before resetting
If an error indicating that the device needs to be reset is reported, disable the error reporting before device reset is complete, e
crypto: hisilicon/qm - disable same error report before resetting
If an error indicating that the device needs to be reset is reported, disable the error reporting before device reset is complete, enable the error reporting after the reset is complete to prevent the same error from being reported repeatedly.
Fixes: eaebf4c3b103 ("crypto: hisilicon - Unify hardware error init/uninit into QM") Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|