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

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:39:16 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699 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 8545be2791..ab12c99716 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1164,6 +1164,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.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.463095664 +0200
+++ 0036-crypto-qat-fix-Arm-build-with-special-memcpy.patch	2021-08-10 15:11:12.986637869 +0200
@@ -1 +1 @@
-From c316efc3cf90fba1b673373669096ad6a3e39cc4 Mon Sep 17 00:00:00 2001
+From a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699 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 8545be2791..ab12c99716 100644
@@ -48 +49 @@
-@@ -1196,6 +1196,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
+@@ -1164,6 +1164,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,


More information about the stable mailing list