[dpdk-stable] [PATCH v4] crypto/qat: fix uninitilized gcc compiler warning

Dybkowski, AdamX adamx.dybkowski at intel.com
Thu May 20 11:06:06 CEST 2021


> -----Original Message-----
> From: Feifei Wang <feifei.wang2 at arm.com>
> Sent: Thursday, 20 May, 2021 10:44
> To: Griffin, John <john.griffin at intel.com>; Trahe, Fiona
> <fiona.trahe at intel.com>; Jain, Deepak K <deepak.k.jain at intel.com>;
> Herbert Guan <herbert.guan at arm.com>; Jerin Jacob
> <jerin.jacob at caviumnetworks.com>
> Cc: dev at dpdk.org; Yigit, Ferruh <ferruh.yigit at intel.com>; Dybkowski,
> AdamX <adamx.dybkowski at intel.com>; nd at arm.com; Feifei Wang
> <feifei.wang2 at arm.com>; stable at dpdk.org; Ruifeng Wang
> <ruifeng.wang at arm.com>
> Subject: [PATCH v4] crypto/qat: fix uninitilized gcc compiler warning
> 
> In Arm platform, when "RTE_ARCH_ARM64_MEMCPY" is set as true, gcc
> will report variable uninitilized 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")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
> ---

Acked-by: Adam Dybkowski <adamx.dybkowski at intel.com>



More information about the stable mailing list