mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Andi Kleen <andi@firstfloor.org>,
	Andy Whitcroft <apw@shadowen.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	akpm@linux-foundation.org, Rusty Russell <rusty@rustcorp.com.au>,
	Glauber de Oliveira Costa <gcosta@redhat.com>,
	Jan Beulich <jbeulich@novell.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	pinskia@gcc.gnu.org
Subject: Re: [PATCH] pop previous section in alternative.c
Date: Thu, 10 Apr 2008 10:36:42 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.00.0804101031421.3143@woody.linux-foundation.org> (raw)
In-Reply-To: <47FE493C.2010709@zytor.com>



On Thu, 10 Apr 2008, H. Peter Anvin wrote:

> Steven Rostedt wrote:
> > 
> > Looking at the output below, shows that testing .sections in between
> > #APP and #NO_APP would in fact catch this bug.
> > 
> 
> Of course, The Right Thing[TM] would be for gcc to emit .pushsection ...
> .popsection around #APP ... #NO_APP.

No, that would not help anything. It would still be open to bugs in the 
asm, ie if there was a unpaired "pushsection" there, making gcc emit the 
section directives around it would just cause a _different_ bug.

So I don't think gcc does the wrong thing per se. It was clearly a bug in 
our inline asm, and the blame is solidly on us. 

Obviously, it would have been really nice if something like the assembler 
had caught it with some simple sanity-test (ie I think the .size thing 
would be a good sanity check _regardless_), so in that sense it's our bug 
that might have been avoided with soem sanity testing, but on the other 
hand, I can well understand that gas didn't do it - since it would matter 
only for totally buggy code that was never emitted by the compiler.

Gas historically used to not do any sanity-checking what-so-ever, and was 
very much meant to be just for compiler output (which is why #APP exists 
in the first place - to mark places that aren't pure compiler input). It's 
actually improved immensely in that area and now is useful as a 
traditional human-usable assembler with lots of support like macros etc.

			Linus

  parent reply	other threads:[~2008-04-10 17:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 23:04 Steven Rostedt
2008-04-09 23:51 ` Steven Rostedt
2008-04-10  0:20   ` H. Peter Anvin
2008-04-10  8:47     ` Andi Kleen
2008-04-10  9:46       ` Andy Whitcroft
2008-04-10 14:11         ` Steven Rostedt
2008-04-10 14:41           ` Andi Kleen
2008-04-10 14:43             ` Steven Rostedt
2008-04-10 14:46             ` Linus Torvalds
2008-04-10 14:55               ` Steven Rostedt
2008-04-10 18:40                 ` Sam Ravnborg
2008-04-10 15:05               ` Andi Kleen
2008-04-10 15:18                 ` Linus Torvalds
2008-04-10 16:07                   ` H. Peter Anvin
2008-04-10 16:20                     ` Steven Rostedt
2008-04-10 17:07                       ` H. Peter Anvin
2008-04-10 17:32                         ` Andrew Pinski
2008-04-10 17:53                           ` H. Peter Anvin
2008-04-10 17:36                         ` Linus Torvalds [this message]
2008-04-10 17:52                           ` H. Peter Anvin
2008-04-13 15:27                 ` Maciej W. Rozycki
2008-04-10 16:10               ` H. Peter Anvin
2008-04-10  7:00   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.00.0804101031421.3143@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=apw@shadowen.org \
    --cc=gcosta@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=pinskia@gcc.gnu.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®