lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYUDop1Cv1ddrqQf@gondor.apana.org.au>
Date: Fri, 22 Dec 2023 11:33:54 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Gonglei <arei.gonglei@...wei.com>
Cc: linux-crypto@...r.kernel.org, mst@...hat.com,
	virtualization@...ts.linux-foundation.org,
	linux-kernel@...r.kernel.org, lixiao91@...wei.com,
	wangyangxin <wangyangxin1@...wei.com>
Subject: Re: [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings

On Mon, Dec 11, 2023 at 07:42:16PM +0800, Gonglei wrote:
>
>  static inline int virtio_crypto_get_current_node(void)
>  {
> -	int cpu, node;
> +	int node;
>  
> -	cpu = get_cpu();
> -	node = topology_physical_package_id(cpu);
> +	node = topology_physical_package_id(get_cpu());

This looks like a bogus warning.  I think we should do something
like this instead:

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index ae81a7191c1c..0cb43986061b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -191,7 +191,7 @@ DECLARE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info);
 #define cpu_data(cpu)		per_cpu(cpu_info, cpu)
 #else
 #define cpu_info		boot_cpu_data
-#define cpu_data(cpu)		boot_cpu_data
+#define cpu_data(cpu)		((void)cpu, boot_cpu_data)
 #endif
 
 extern const struct seq_operations cpuinfo_op;

Please send this patch to the x86 people.

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ