[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211027123429.GE174730@worktop.programming.kicks-ass.net>
Date: Wed, 27 Oct 2021 14:34:29 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Paul Heidekrüger <paul.heidekrueger@...tum.de>
Cc: paulmck@...nel.org, will@...nel.org, boqun.feng@...il.com,
stern@...land.harvard.edu, parri.andrea@...il.com,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
elver@...gle.com, charalampos.mainas@...il.com,
pramod.bhatotia@...tum.de
Subject: Re: Potentially Broken Address Dependency via test_bit() When
Compiling With Clang
On Wed, Oct 27, 2021 at 02:17:48PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 27, 2021 at 12:19:48PM +0200, Paul Heidekrüger wrote:
> I would personally not consider this a dependend load. The result
> depends on two loads, but there is no actual ordering between them.
>
> r1 = *x
> r2 = *y
> b = 1 & (r1 >> r2);
>
> (more or less)
melver pointed out on IRC that I missed the whole BIT_WORD(nr) thing.
And with that restored this should indeed be an address dependency.
Still, I wasn't actually expecting test_bit() to be one. Nice find.
Powered by blists - more mailing lists