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: <4AAA72F3.9090103@caviumnetworks.com>
Date:	Fri, 11 Sep 2009 08:55:31 -0700
From:	David Daney <ddaney@...iumnetworks.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	Roland McGrath <roland@...hat.com>
Subject: Re: [PATCH 02/10] x86: Convert BUG() to use unreachable()

Ingo Molnar wrote:
> * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> 
>> On Thu, 10 Sep 2009, H. Peter Anvin wrote:
>>
>>> On 09/10/2009 04:56 PM, David Daney wrote:
>>>> Use the new unreachable() macro instead of for(;;);.  When
>>>> allyesconfig is built with a GCC-4.5 snapshot on i686 the size of the
>>>> text segment is reduced by 3987 bytes (from 6827019 to 6823032).
>>>>
>>>> Signed-off-by: David Daney <ddaney@...iumnetworks.com>
>>>> CC: Thomas Gleixner <tglx@...utronix.de>
>>>> CC: Ingo Molnar <mingo@...hat.com>
>>>> CC: "H. Peter Anvin" <hpa@...or.com>
>>>> CC: x86@...nel.org
>>> Acked-by: H. Peter Anvin <hpa@...or.com>
>>>
>>> ... although of course this clashes with Roland McGrath's 
>>> patchset for the same thing which I applied earlier.  I have to 
>>> say I like unreachable() in lower case better though...
>> I like David's version a bit better, since it takes care of more 
>> architectures, and also because it avoids that butt-ugly special 
>> case for gcc-4.4.1-RH-relase-10 backporting this feature.
>>
>> I realize that the RH backport thing is good for testing now, but 
>> at the same time, it really does look nasty. I wonder if we could 
>> add some config-time compiler feature testing - so that you'd not 
>> have a version test at all, but a CONFIG_BUILTIN_UNREACHABLE.
>>
>> There are other cases where that kind of config-time testing could 
>> be useful, and we could avoid doing various gcc checks dynamically 
>> from within 'make' (along with checking for known-buggy versions 
>> etc).
>>
>> And yeah, it looks better in lower case. That said, I don't care 
>> _that_ much, and people can fight it out.
> 
> Another detail that would be nice to be fixed is to propagate the 
> unreachable() call into the !CONFIG_BUG case as well in 
> asm-generic/bug.h.
> 

Perhaps, although with a pre-GCC-4.5 compiler, it would end up adding 
the endless loop code to BUG() sites for configurations where the user 
has explicitly stated their preference for the code to be as small as 
possible (by turning off CONFIG_BUG).

If that is acceptable, I will prepare another revision of the patch set.

Thanks,
David Daney


> That would kill dozens of !CONFIG_BUG compiler warnings and would 
> make a dont-allow-warnings policy a possibility for random builds.
> 
> 	Ingo

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