[dpdk-stable] patch 'crypto/qat: fix Arm build with special memcpy' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:05:07 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/55fa4d96382b429a660a3c515906354e6c24259e

Thanks.

Luca Boccassi

---
>From 55fa4d96382b429a660a3c515906354e6c24259e Mon Sep 17 00:00:00 2001
From: Feifei Wang <feifei.wang2 at arm.com>
Date: Fri, 21 May 2021 10:00:04 +0800
Subject: [PATCH] crypto/qat: fix Arm build with special memcpy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit c316efc3cf90fba1b673373669096ad6a3e39cc4 ]

In Arm platform, when "RTE_ARCH_ARM64_MEMCPY" is set as true, gcc will
report variable uninitialized warning:

../drivers/crypto/qat/qat_sym_session.c: In function ‘partial_hash_compute’:
../lib/eal/include/generic/rte_byteorder.h:241:24: warning:
‘<U35a0>’ may be used uninitialized in this function
	[-Wmaybe-uninitialized]
	241 | #define rte_bswap32(x) __builtin_bswap32(x)
	...

This is because "digest" will be initialized by "rte_memcpy" function
rather than "memcpy" if "RTE_ARCH_ARM64_MEMCPY" is set as true.
Furthermore, 'rte_memcpy' will initialize 'digest' with two steps
by invoking rte_mov_x functions. For example:

partial_hash_sha1 -> rte_memcpy -> rte_memcpy_ge16_lt_128 ->
step 1: rte_mov16(dst,src )
step 2: rte_mov16(dst - 16 + n, src - 16 + n)

However, gcc compiler cannot identify this multi-step initialization,
then it will report warning.

To fix this, use "memset" to initialize "digest".

Fixes: cd7fc8a84b48 ("eal/arm64: optimize memcpy")

Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Acked-by: Adam Dybkowski <adamx.dybkowski at intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 23d059bf84..6e2193fb69 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1190,6 +1190,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 	uint64_t *hash_state_out_be64;
 	int i;
 
+	/* Initialize to avoid gcc warning */
+	memset(digest, 0, sizeof(digest));
+
 	digest_size = qat_hash_get_digest_size(hash_alg);
 	if (digest_size <= 0)
 		return -EFAULT;
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:40.417666831 +0100
+++ 0072-crypto-qat-fix-Arm-build-with-special-memcpy.patch	2021-07-12 13:41:36.630125527 +0100
@@ -1 +1 @@
-From c316efc3cf90fba1b673373669096ad6a3e39cc4 Mon Sep 17 00:00:00 2001
+From 55fa4d96382b429a660a3c515906354e6c24259e Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit c316efc3cf90fba1b673373669096ad6a3e39cc4 ]
+
@@ -34 +35,0 @@
-Cc: stable at dpdk.org
@@ -45 +46 @@
-index 231b1640da..e22dd3600c 100644
+index 23d059bf84..6e2193fb69 100644
@@ -48 +49 @@
-@@ -1196,6 +1196,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
+@@ -1190,6 +1190,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,


More information about the stable mailing list