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] [day] [month] [year] [list]
Date:	Sat, 27 Feb 2016 12:44:20 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Alexander Kuleshov <kuleshovmail@...il.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/bitops.h: use IS_IMMEDIATE instead of dirrect call
 of __builtin_constant_p


* Alexander Kuleshov <kuleshovmail@...il.com> wrote:

> The arch/x86/include/asm/bitops.h provides IS_IMMEDIATE macro which expands to
> the call of the __builtin_constant_p(). Let's use this macro in the test_bit()
> to be more clear.
> 
> Signed-off-by: Alexander Kuleshov <kuleshovmail@...il.com>
> ---
>  arch/x86/include/asm/bitops.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
> index cfe3b95..8cfbd2b 100644
> --- a/arch/x86/include/asm/bitops.h
> +++ b/arch/x86/include/asm/bitops.h
> @@ -333,7 +333,7 @@ static int test_bit(int nr, const volatile unsigned long *addr);
>  #endif
>  
>  #define test_bit(nr, addr)			\
> -	(__builtin_constant_p((nr))		\
> +	(IS_IMMEDIATE((nr))			\
>  	 ? constant_test_bit((nr), (addr))	\
>  	 : variable_test_bit((nr), (addr)))

Why? In the kernel there's more than 200 uses of __builtin_constant_p(), while 
only 6 uses of IS_IMMEDIATE() ...

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ