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]
Date:	Sun, 06 Jan 2008 22:16:04 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Arjan van de Ven <arjan@...radead.org>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	heiko.carstens@...ibm.com, olof@...om.net, mingo@...e.hu,
	mpm@...enic.com
Subject: Re: [patch 5/5] PowerPC: switch to generic WARN_ON / BUG_ON


On Sat, 2008-01-05 at 19:12 -0800, Arjan van de Ven wrote:
> From: Olof Johansson <olof@...om.net>
> 
> Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
> 4K text on a ppc64_defconfig.  The main reason seems to be that prepping
> the arguments to the conditional trap instructions is more work than just
> doing a compare and branch.

I'm a bit annoyed by that one ... for obvious reasons... I wish gcc
could be better here. Also, we can't completely remove the support for
the trap since we use that in asm in various places...

Ben.

> Signed-off-by: Olof Johansson <olof@...om.net>
> Cc: <linux-arch@...r.kernel.org>
> Cc: Scott Wood <scottwood@...escale.com>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: Paul Mackerras <paulus@...ba.org>, 
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
> 
>  include/asm-powerpc/bug.h |   37 -------------------------------------
>  1 file changed, 37 deletions(-)
> 
> Index: linux-2.6.24-rc6/include/asm-powerpc/bug.h
> ===================================================================
> --- linux-2.6.24-rc6.orig/include/asm-powerpc/bug.h
> +++ linux-2.6.24-rc6/include/asm-powerpc/bug.h
> @@ -54,12 +54,6 @@
>  	".previous\n"
>  #endif
>  
> -/*
> - * BUG_ON() and WARN_ON() do their best to cooperate with compile-time
> - * optimisations. However depending on the complexity of the condition
> - * some compiler versions may not produce optimal results.
> - */
> -
>  #define BUG() do {						\
>  	__asm__ __volatile__(					\
>  		"1:	twi 31,0,0\n"				\
> @@ -69,20 +63,6 @@
>  	for(;;) ;						\
>  } while (0)
>  
> -#define BUG_ON(x) do {						\
> -	if (__builtin_constant_p(x)) {				\
> -		if (x)						\
> -			BUG();					\
> -	} else {						\
> -		__asm__ __volatile__(				\
> -		"1:	"PPC_TLNEI"	%4,0\n"			\
> -		_EMIT_BUG_ENTRY					\
> -		: : "i" (__FILE__), "i" (__LINE__), "i" (0),	\
> -		  "i" (sizeof(struct bug_entry)),		\
> -		  "r" ((__force long)(x)));			\
> -	}							\
> -} while (0)
> -
>  #define __WARN() do {						\
>  	__asm__ __volatile__(					\
>  		"1:	twi 31,0,0\n"				\
> @@ -92,23 +72,6 @@
>  		  "i" (sizeof(struct bug_entry)));		\
>  } while (0)
>  
> -#define WARN_ON(x) ({						\
> -	int __ret_warn_on = !!(x);				\
> -	if (__builtin_constant_p(__ret_warn_on)) {		\
> -		if (__ret_warn_on)				\
> -			__WARN();				\
> -	} else {						\
> -		__asm__ __volatile__(				\
> -		"1:	"PPC_TLNEI"	%4,0\n"			\
> -		_EMIT_BUG_ENTRY					\
> -		: : "i" (__FILE__), "i" (__LINE__),		\
> -		  "i" (BUGFLAG_WARNING),			\
> -		  "i" (sizeof(struct bug_entry)),		\
> -		  "r" (__ret_warn_on));				\
> -	}							\
> -	unlikely(__ret_warn_on);				\
> -})
> -
>  #endif /* __ASSEMBLY __ */
>  #endif /* CONFIG_BUG */
>  
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ