On Thu, Aug 15, 2024 at 9:42 AM Uros Bizjak <ubizjak@xxxxxxxxx> wrote: > > On Thu, Aug 15, 2024 at 1:38 AM Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote: > > > > Hi all, > > > > After merging the mm tree, today's linux-next build (powerpc > > ppc64_defconfig) failed like this: > > > > In file included from include/linux/kcsan-checks.h:13, > > from include/linux/instrumented.h:12, > > from include/asm-generic/bitops/instrumented-atomic.h:14, > > from arch/powerpc/include/asm/bitops.h:321, > > from include/linux/bitops.h:68, > > from arch/powerpc/include/asm/mce.h:12, > > from arch/powerpc/include/asm/paca.h:32, > > from arch/powerpc/include/asm/percpu.h:30, > > from include/linux/err.h:9, > > from arch/powerpc/include/asm/ptrace.h:22, > > from arch/powerpc/kernel/vdso/sigtramp64.S:14: > > include/linux/compiler_attributes.h:55: warning: "__always_inline" redefined > > 55 | #define __always_inline inline __attribute__((__always_inline__)) > > | > > In file included from include/linux/stddef.h:5, > > from include/linux/string.h:9, > > from arch/powerpc/include/asm/paca.h:16: > > include/uapi/linux/stddef.h:8: note: this is the location of the previous definition > > 8 | #define __always_inline inline > > | > > include/linux/compiler_attributes.h:91:20: error: missing binary operator before token "(" > > 91 | #if __has_attribute(__copy__) > > | ^ > > include/linux/compiler_attributes.h:104:20: error: missing binary operator before token "(" > > 104 | #if __has_attribute(__counted_by__) > > | ^ > > include/linux/compiler_attributes.h:107: warning: "__counted_by" redefined > > 107 | # define __counted_by(member) > > | > > include/uapi/linux/stddef.h:55: note: this is the location of the previous definition > > 55 | #define __counted_by(m) > > | > > include/linux/compiler_attributes.h:116:20: error: missing binary operator before token "(" > > 116 | #if __has_attribute(__diagnose_as_builtin__) > > | ^ > > include/linux/compiler_attributes.h:139:20: error: missing binary operator before token "(" > > 139 | #if __has_attribute(__designated_init__) > > | ^ > > include/linux/compiler_attributes.h:150:20: error: missing binary operator before token "(" > > 150 | #if __has_attribute(__error__) > > | ^ > > include/linux/compiler_attributes.h:161:20: error: missing binary operator before token "(" > > 161 | #if __has_attribute(__externally_visible__) > > | ^ > > include/linux/compiler_attributes.h:198:20: error: missing binary operator before token "(" > > 198 | #if __has_attribute(__no_caller_saved_registers__) > > | ^ > > include/linux/compiler_attributes.h:209:20: error: missing binary operator before token "(" > > 209 | #if __has_attribute(__noclone__) > > | ^ > > include/linux/compiler_attributes.h:226:20: error: missing binary operator before token "(" > > 226 | #if __has_attribute(__fallthrough__) > > | ^ > > include/linux/compiler_attributes.h:252:20: error: missing binary operator before token "(" > > 252 | #if __has_attribute(__nonstring__) > > | ^ > > include/linux/compiler_attributes.h:264:20: error: missing binary operator before token "(" > > 264 | #if __has_attribute(__no_profile_instrument_function__) > > | ^ > > include/linux/compiler_attributes.h:283:20: error: missing binary operator before token "(" > > 283 | #if __has_attribute(__no_stack_protector__) > > | ^ > > include/linux/compiler_attributes.h:294:20: error: missing binary operator before token "(" > > 294 | #if __has_attribute(__overloadable__) > > | ^ > > include/linux/compiler_attributes.h:313:20: error: missing binary operator before token "(" > > 313 | #if __has_attribute(__pass_dynamic_object_size__) > > | ^ > > include/linux/compiler_attributes.h:318:20: error: missing binary operator before token "(" > > 318 | #if __has_attribute(__pass_object_size__) > > | ^ > > include/linux/compiler_attributes.h:342:20: error: missing binary operator before token "(" > > 342 | #if __has_attribute(__uninitialized__) > > | ^ > > include/linux/compiler_attributes.h:388:20: error: missing binary operator before token "(" > > 388 | #if __has_attribute(__warning__) > > | ^ > > include/linux/compiler_attributes.h:405:20: error: missing binary operator before token "(" > > 405 | #if __has_attribute(disable_sanitizer_instrumentation) > > | ^ > > > > Caused by commit > > > > 8e53757638ec ("err.h: add ERR_PTR_PCPU(), PTR_ERR_PCPU() and IS_ERR_PCPU() functions") > > > > Does include/linux/err.h really need to include asm/percpu.h? __percpu is > > defined in compiler_types.h which is included in every c code compile. > > Currently it is not needed, but with the proposed patch [1] > > [1] https://lore.kernel.org/lkml/20240812115945.484051-4-ubizjak@xxxxxxxxx/ > > that repurposes __percpu to also include percpu named address > qualifier, it will be needed, because per_cpu_qual will be defined in > include/asm-generic/percpu.h. > > I looked a bit at the error and noticed that the error happens when > building VDSO sigtramp64.S that includes: > > #include <asm/ptrace.h> /* XXX for __SIGNAL_FRAMESIZE */ > > The crash happens through this include, so perhaps XXX above marks > some expected problem with the include that my change was unlucky > enough to trigger? OTOH, powerpc percpu.h includes paca.h that further includes linux/string.h. AFAICS, nothing in paca.h requires linux/string.h (which includes many other headers), so perhaps removing "#include linux/string.h" from paca.h makes the header "light enough" to be included in err.h.through percpu.h. Uros.