[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160416090332.GA30613@gmail.com>
Date: Sat, 16 Apr 2016 11:03:32 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Thomas Graf <tgraf@...g.ch>,
Peter Zijlstra <peterz@...radead.org>,
David Rientjes <rientjes@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
linux-scsi <linux-scsi@...r.kernel.org>, jamborm@....gnu.org
Subject: Re: This patch triggers a bad gcc bug (was Re: [PATCH] force
inlining of some byteswap operations)
* Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> > I don't think we know yet if there's a reliable way to turn the bug off.
> >
> > Also, according to the gcc guys, this bug won't always result in a
> > truncated function, and may sometimes just make some inline function
> > call sites disappear:
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646#c14
> >
> > though I haven't been able to confirm that experimentally. But if it's
> > true, that means that objtool won't be able to detect all cases of the
> > bug and some function calls may just silently disappear!
> >
> > There's a lot of activity in the bug now, so hopefully they'll be able
> > to tell us soon if there's a reliable way to avoid it and/or detect it.
> >
> > BTW, Denys posted a workaround patch for the qla2xxxx code:
> >
> > https://lkml.kernel.org/r/1460716583-15673-1-git-send-email-dvlasenk@redhat.com
>
> Martin Jambor wrote a succinct summary of the conditions needed for this
> bug:
>
> "This bug can occur when an inlineable function containing a call to
> __builtin_constant_p, which checks a parameter or a value it
> references and a (possibly indirect) caller of the function actually
> passes a constant, but stores it using a type of a different size."
>
> So to prevent it from happening elsewhere in the kernel, it sounds like
> we'd have to either remove all uses of __builtin_constant_p() or disable
> inlining completely.
>
> There's also no reliable way to detect the bug has occurred, though
> objtool will detect it in cases when the function gets truncated.
So it appears to me that due to the hard to detect nature of the GCC bug the fix
will probably be backported by them, so I think we should be fine with relying on
objtool to detect weird code sequences in the kernel, and should work around
specific instances of the bug.
Thanks,
Ingo
Powered by blists - more mailing lists