Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1380339
| From | Josh Poimboeuf <jpoimboe@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) |
| Date | 2016-04-16 00:30 +0200 |
| Message-ID | <rokps-1JE-7@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <rnRns-3WP-25@gated-at.bofh.it> <rnRQu-4b1-1@gated-at.bofh.it> <rnSWe-5pD-3@gated-at.bofh.it> <ro4NI-6nI-1@gated-at.bofh.it> <rocie-3Ln-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Apr 15, 2016 at 08:47:45AM -0500, Josh Poimboeuf wrote:
> On Fri, Apr 15, 2016 at 07:45:19AM +0200, Ingo Molnar wrote:
> >
> > * Denys Vlasenko <dvlasenk@redhat.com> wrote:
> >
> > > > In fact, the following patch seems to fix it:
> > > >
> > > > diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
> > > > index bf66ea6..56b9e81 100644
> > > > --- a/include/scsi/scsi_transport_fc.h
> > > > +++ b/include/scsi/scsi_transport_fc.h
> > > > @@ -796,7 +796,7 @@ fc_remote_port_chkready(struct fc_rport *rport)
> > > > return result;
> > > > }
> > > >
> > > > -static inline u64 wwn_to_u64(u8 *wwn)
> > > > +static __always_inline u64 wwn_to_u64(u8 *wwn)
> > > > {
> > > > return get_unaligned_be64(wwn);
> > > > }
> > >
> > > It is not a guarantee.
> >
> > Of course it's a workaround - but is there any deterministic way to turn off this
> > GCC bug (by activating some GCC command line switch), or do we have to live with
> > objtool warning about this GCC?
>
> 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.
--
Josh
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-13 05:40 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-13 14:20 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-13 14:40 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-13 17:20 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-13 19:00 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-13 19:20 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-14 17:30 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-14 18:00 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-14 19:10 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Ingo Molnar <mingo@kernel.org> - 2016-04-15 07:50 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-15 15:50 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-16 00:30 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Ingo Molnar <mingo@kernel.org> - 2016-04-16 11:10 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-18 15:40 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Arnd Bergmann <arnd@arndb.de> - 2016-04-18 16:10 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-18 16:20 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Arnd Bergmann <arnd@arndb.de> - 2016-04-18 16:30 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Ingo Molnar <mingo@kernel.org> - 2016-04-19 11:00 +0200
[PATCH] scsi: fc: force inlining of wwn conversion functions Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-19 16:00 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Quinn Tran <quinn.tran@qlogic.com> - 2016-04-23 01:20 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-25 18:10 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-26 04:50 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-26 05:40 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Arnd Bergmann <arnd@arndb.de> - 2016-04-26 09:30 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Christoph Hellwig <hch@infradead.org> - 2016-04-26 10:40 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Arnd Bergmann <arnd@arndb.de> - 2016-04-26 12:10 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-26 15:10 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Arnd Bergmann <arnd@arndb.de> - 2016-04-26 18:00 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-27 00:40 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-27 02:50 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Martin Jambor <mjambor@suse.cz> - 2016-04-27 13:10 +0200
Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Arnd Bergmann <arnd@arndb.de> - 2016-04-27 23:40 +0200
[PATCH, RFT] byteswap: try to avoid __builtin_constant_p gcc bug Arnd Bergmann <arnd@arndb.de> - 2016-04-28 00:10 +0200
Re: [PATCH, RFT] byteswap: try to avoid __builtin_constant_p gcc bug Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-28 00:20 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Arnd Bergmann <arnd@arndb.de> - 2016-04-16 09:50 +0200
Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-18 15:30 +0200
csiph-web