lkml.org 
[lkml]   [2011]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c
From
On Wed, Jun 15, 2011 at 3:33 AM, Andrew Lutomirski <luto@mit.edu> wrote:
> On Tue, Jun 14, 2011 at 5:31 PM, Ingo Molnar <mingo@elte.hu> wrote:
>>
>> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
>>
>>> On Tue, Jun 14, 2011 at 2:16 PM, Ingo Molnar <mingo@elte.hu> wrote:
>>> >
>>> > I think correctness trumps code size and turning BUG() and BUG_ON()
>>> > into a NOP is just crazy ...
>>>
>>> Umm. It's even CRAZIER to turn it into a "compiler generates random code".
>>
>> Sigh, i assumed it got turned into an infinite loop - that is what
>> i've done in a prior patch.
>>
>> You are right, unreachable() is bogus and you'd also be right to
>> suggest that i should not comment on patches after 11pm ;-)
>
> What we want is a magic GCC trick that says "don't warn about code
> paths that go through here but generate the same code as you would
> without this annotation."  I don't think such a thing exists.
>
No, I don't think we need such kind of thing. I think, we should less
rely on GCC. Here, we need to reconsider the use of BUG. When
vsyscall_nr is default, it hits BUG. Here is the code comment:

" * If we get here, then vsyscall_nr indicates that int 0xcc
* happened at an address in the vsyscall page that doesn't
* contain int 0xcc. That can't happen. "

If that can't happen, I think we can treat it as a FAULT. So, rather
than calling BUG we can ground it into EFAULT. Does it break ABI
compatibility?

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

\
 
 \ /
  Last update: 2011-06-15 08:01    [W:0.046 / U:4.820 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site