[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CBD57A5@AcuExch.aculab.com>
Date: Wed, 18 Nov 2015 15:21:19 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Will Deacon' <will.deacon@....com>
CC: Arnd Bergmann <arnd@...db.de>,
Catalin Marinas <catalin.marinas@....com>,
"kernel-build-reports@...ts.linaro.org"
<kernel-build-reports@...ts.linaro.org>,
"olof@...om.net" <olof@...om.net>,
David Miller <davem@...emloft.net>,
"eric.dumazet@...il.com" <eric.dumazet@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-next@...r.kernel.org" <linux-next@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: RE: next build: 235 warnings 3 failures (next/next-20151117)
From: Will Deacon
> Sent: 18 November 2015 12:28
> On Wed, Nov 18, 2015 at 12:11:25PM +0000, David Laight wrote:
> > From: Will Deacon
> > > Sent: 18 November 2015 10:14
> > > On Tue, Nov 17, 2015 at 08:17:17PM +0100, Arnd Bergmann wrote:
> > > > On Tuesday 17 November 2015 17:12:37 Will Deacon wrote:
> > > > > On Tue, Nov 17, 2015 at 06:03:40PM +0100, Arnd Bergmann wrote:
> > > > > > On Tuesday 17 November 2015 16:44:53 Will Deacon wrote:
> > > > > > > > 8<----
> > > > > > > > Subject: ARM64: make smp_load_acquire() work with const arguments
> > > > > > > >
> > > > > > > > smp_load_acquire() uses typeof() to declare a local variable for temporarily
> > > > > > > > storing the output of the memory access. This fails when the argument is
> > > > > > > > constant, because the assembler complains about using a constant register
> > > > > > > > as output:
> > > > > > > >
> > > > > > > > arch/arm64/include/asm/barrier.h:71:3: error: read-only variable '___p1'
> > > > > > > > used as 'asm' output
> > > > > > >
> > > > > > > Do you know the usage in the kernel causing this warning?
> > > > > >
> > > > > > A newly introduced function in include/net/sock.h:
> > > > > >
> > > > > > static inline int sk_state_load(const struct sock *sk)
> > > > > > {
> > > > > > return smp_load_acquire(&sk->sk_state);
> > > > > > }
> > > > >
> > > > > Hmm, maybe we could play a similar trick to READ_ONCE by declaring an
> > > > > anonymous union and writing through the non-const member?
> > > >
> > > > Yes, I think that would work, if you think we need to care about the
> > > > case where we read into a structure.
> > > >
> > > > Can you come up with a patch for that?
> > >
> > > Done:
> > >
> > > http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/386094.html
> >
> > That patch forces a memory write-read and returns uninitialised stack
> > for short reads.
>
> Really? The disassembly looks fine to me. Do you have a concrete example
> of where you think it goes wrong, please?
>
> > Who knows what happens on big-endian systems.
>
> The same thing as READ_ONCE? I'll test it there to make sure, but I
> don't see a problem.
Ah, god, it is absolutely horrid. But probably right :-(
Do all the lda variants zero extend to 64 bits ?
If so maybe you could use a single 64 bit variable for the result of the read
and then cast it to typeof(*p) to get the required sign extension for
small integer types.
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists