Re: [PATCH v3 04/25] kcsan: Add core support for a subset of weak memory modeling

From: Marco Elver
Date: Fri Dec 03 2021 - 18:42:19 EST


On Fri, 3 Dec 2021 at 22:09, Paul E. McKenney <paulmck@xxxxxxxxxx> wrote:
[...]
> A few quick tests located the following:
>
> [ 0.635383] INFO: trying to register non-static key.
> [ 0.635804] The code is fine but needs lockdep annotation, or maybe
> [ 0.636194] you didn't initialize this object before use?
> [ 0.636194] turning off the locking correctness validator.
> [ 0.636194] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.0-rc1+ #3208
[...]
> When running without the new patch series, this splat does not appear.
>
> Do I need a toolchain upgrade? I see the Clang 14.0 in the cover letter,
> but that seems to apply only to non-x86 architectures.
>
> $ clang-11 -v
> Ubuntu clang version 11.1.0-++20210805102428+1fdec59bffc1-1~exp1~20210805203044.169

Good catch! That would be lockdep telling me off for putting test
locks on the stack. :-/

I thought I had tested this with lockdep, but it seems the set of
semi-automated tests I run didn't (yet) generate a config with
KCSAN_WEAK_MEMORY + LOCKDEP.

This should be fixed by:
https://lkml.kernel.org/r/20211203233817.2815340-1-elver@xxxxxxxxxx

Thanks,
-- Marco