Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1380276

Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646

From James Bottomley <James.Bottomley@HansenPartnership.com>
Newsgroups linux.kernel
Subject Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646
Date 2016-04-15 23:20 +0200
Message-ID <rojjK-119-39@gated-at.bofh.it> (permalink)
References <ro9kn-1wo-41@gated-at.bofh.it> <rodei-4xC-17@gated-at.bofh.it> <roh8e-7AR-19@gated-at.bofh.it> <rohhU-7Wy-23@gated-at.bofh.it> <roidX-gm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2016-04-15 at 15:02 -0500, Josh Poimboeuf wrote:
> On Fri, Apr 15, 2016 at 12:05:26PM -0700, James Bottomley wrote:
> > On Fri, 2016-04-15 at 20:56 +0200, Denys Vlasenko wrote:
> > > and now *many* users of qla2x00 and new-ish gcc are going to
> > > very much notice it, as their kernels will start crashing
> > > reliably.
> > > 
> > > The commits can be reverted, sure, but they per se do not contain
> > > anything unusual. They, together with not very typical construct
> > > in qla2x00_get_host_fabric_name, one
> > > which boils down to "swab64p(constant_array_of_8_bytes)",
> > > just happen to nudge gcc in a right way to finally trigger the
> > > bug.
> > > 
> > > So I came with another idea how to forestall the imminent deluge
> > > of
> > > qla2x00 oops reports - this patch.
> > 
> > There are actually a raft of checkers that run the upstream code
> > which
> > aren't seeing any problem; likely because the code is harder to
> > trigger
> > than you think.  So, lets wait until the resolution of the other
> > thread
> > before we panic, especially since we're only at -rc3.
> 
> Regardless of the outcome of the gcc bug, it seems kind of silly to
> byteswap a constant value of 0xffffffffffffffff.
> 
> 	uint8_t node_name[WWN_SIZE] = { 0xFF, 0xFF, 0xFF, 0xFF, \
> 		0xFF, 0xFF, 0xFF, 0xFF};
> 	u64 fabric_name = wwn_to_u64(node_name);
> 
> Similar to what Denys suggested, it can just be:
> 
> 	u64 fabric_name = -1;
> or
> 	u64 fabric_name = 0xffffffffffffffff;
> 
> Wouldn't that be an improvement to the code regardless?

"Improvement" would be in the eye of the beholder.  Semantically it
would be wrong because we're initialising a CPU local representation of
a big endian structure, so we *should* use the conversion.

James

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-15 12:40 +0200
  Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-15 16:50 +0200
    Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-15 21:00 +0200
      Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-15 21:10 +0200
        Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-15 22:10 +0200
          Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-15 23:20 +0200
        Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 Denys Vlasenko <dvlasenk@redhat.com> - 2016-04-15 23:20 +0200
          Re: [PATCH] qla2xxx: rewrite code to avoid hitting gcc bug 70646 James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-04-15 23:30 +0200

csiph-web