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: <4AAFB458.3080406@caviumnetworks.com>
Date:	Tue, 15 Sep 2009 08:35:52 -0700
From:	David Daney <ddaney@...iumnetworks.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	Brian Gerst <brgerst@...il.com>, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 11/11] Use unreachable() in asm-generic/bug.h for  !CONFIG_BUG
 case.

Linus Torvalds wrote:
> 
> On Mon, 14 Sep 2009, David Daney wrote:
>> The existing code just falls through to whatever happens to follow the BUG().
> 
> Brian was talking BUG_ON().
> 
> And the existing !CONFIG_BUG BUG_ON() is actually set up so that gcc will 
> just optimize it away entirely (yet give the same compile-time warnings as 
> the "real" BUG_ON() does).
> 
> Changing it to "if (cond) unreachable()" is likely to generate _more_ 
> code, which is against the whole point of wanting to disable CONFIG_BUG.
> 

Yes, you are correct.  I said the same thing in the log message for the 
patch.

Really it may be too early for this patch to be appropriate for your 
tree.  GCC-4.5 will probably not be released for several more months, 
and it will be several years before a GCC with __builtin_unreachable() 
is being used by the majority of people compiling kernels.

Ingo had suggested the approach of this patch as a way of eliminating 
many warnings when using !CONFIG_BUG.  I think it clearly makes sense 
for compilers that support __builtin_unreachable(), but clearly it is 
not an unquestionable win if we end up generating larger code.

With this particular patch, I don't really care if you merge it or not. 
  Perhaps I shouldn't have made it part of the set.

The rest of the set I think would make sense for 2.6.32 or 2.6.33.

David Daney
--
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