Re: [PATCH 4.19 088/323] locking/lockdep: Avoid RCU-induced noinstr fail

From: Salvatore Bonaccorso
Date: Sun Nov 28 2021 - 07:02:53 EST


Hi,

On Sun, Nov 28, 2021 at 10:46:13AM +0100, Salvatore Bonaccorso wrote:
> Hi,
>
> On Wed, Nov 24, 2021 at 12:54:38PM +0100, Greg Kroah-Hartman wrote:
> > From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> >
> > [ Upstream commit ce0b9c805dd66d5e49fd53ec5415ae398f4c56e6 ]
> >
> > vmlinux.o: warning: objtool: look_up_lock_class()+0xc7: call to rcu_read_lock_any_held() leaves .noinstr.text section
>
> For 4.19.218 at least this commit seems to cause a build failure for
> cpupower, if warnings are treated as errors, I have not seen the same
> for the 5.10.80 build:
>
> gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -DVERSION=\"4.19\" -DPACKAGE=\"cpupower\" -DPACKAGE_BUGREPORT=\"Debian\ \(reportbug\ linux-cpupower\)\" -D_GNU_SOURCE -pipe -DNLS -Wall -Wchar-subscripts -Wpointer-arith
> -Wsign-compare -Wno-pointer-sign -Wdeclaration-after-statement -Wshadow -Os -fomit-frame-pointer -fPIC -o /home/build/linux-4.19.218/debian/build/build-tools/tools/power/cpupower/lib/cpupower.o -c lib/cpupower.c
> In file included from lockdep.c:28:
> ../../../kernel/locking/lockdep.c: In function ‘look_up_lock_class’:
> ../../../kernel/locking/lockdep.c:694:2: error: implicit declaration of function ‘hlist_for_each_entry_rcu_notrace’; did you mean ‘hlist_for_each_entry_continue’? [-Werror=implicit-function-declaration]
> hlist_for_each_entry_rcu_notrace(class, hash_head, hash_entry) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hlist_for_each_entry_continue
> ../../../kernel/locking/lockdep.c:694:53: error: ‘hash_entry’ undeclared (first use in this function); did you mean ‘hash_ptr’?
> hlist_for_each_entry_rcu_notrace(class, hash_head, hash_entry) {
> ^~~~~~~~~~
> hash_ptr
> ../../../kernel/locking/lockdep.c:694:53: note: each undeclared identifier is reported only once for each function it appears in
> ../../../kernel/locking/lockdep.c:694:64: error: expected ‘;’ before ‘{’ token
> hlist_for_each_entry_rcu_notrace(class, hash_head, hash_entry) {
> ^~
> ;
> ../../../kernel/locking/lockdep.c:706:1: warning: control reaches end of non-void function [-Wreturn-type]
> }
> ^
> cc1: some warnings being treated as errors
> make[5]: *** [/home/build/linux-4.19.218/tools/build/Makefile.build:97: /home/build/linux-4.19.218/debian/build/build-tools/tools/lib/lockdep/lockdep.o] Error 1
> make[4]: *** [Makefile:121: /home/build/linux-4.19.218/debian/build/build-tools/tools/lib/lockdep/liblockdep-in.o] Error 2
> make[4]: Leaving directory '/home/build/linux-4.19.218/tools/lib/lockdep'
> make[3]: *** [/home/build/linux-4.19.218/debian/rules.d/tools/lib/lockdep/Makefile:16: all] Error 2
> make[3]: Leaving directory '/home/build/linux-4.19.218/debian/build/build-tools/tools/lib/lockdep'
> make[2]: *** [debian/rules.real:795: build-liblockdep] Error 2
> make[2]: *** Waiting for unfinished jobs....
>
> I was not yet able to look further on it.

Might actually be a distro specific issue, needs some further
investigation.

Regards,
Salvatore