Re: [kbuild-all] Re: WARNING: modpost: vmlinux.o(.text+0x1a8edb8): Section mismatch in reference from the function stop_machine() to the function .init.text:intel_rng_hw_init()

From: Nick Desaulniers
Date: Thu Feb 25 2021 - 16:16:16 EST


On Thu, Feb 25, 2021 at 10:34 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Thu, Feb 25, 2021 at 04:17:21PM +0800, Rong Chen wrote:
> >
> >
> > On 2/24/21 10:26 PM, Jürgen Groß wrote:
> > > On 24.02.21 15:20, kernel test robot wrote:
> > > > tree:
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > > master
> > > > head: c03c21ba6f4e95e406a1a7b4c34ef334b977c194
> > > > commit: ab234a260b1f625b26cbefa93ca365b0ae66df33 x86/pv: Rework
> > > > arch_local_irq_restore() to not use popf
> > > > date: 2 weeks ago
> > > > config: x86_64-randconfig-a005-20210223 (attached as .config)
> > > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project
> > > > f14a14dd2564703db02f80c00db8ae492b594f77)
> > > > reproduce (this is a W=1 build):
> > > > wget
> > > > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
> > > > -O ~/bin/make.cross
> > > > chmod +x ~/bin/make.cross
> > > > # install x86_64 cross compiling tool for clang build
> > > > # apt-get install binutils-x86-64-linux-gnu
> > > > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab234a260b1f625b26cbefa93ca365b0ae66df33
> > > > git remote add linus
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > > git fetch --no-tags linus master
> > > > git checkout ab234a260b1f625b26cbefa93ca365b0ae66df33
> > > > # save the attached .config to linux build tree
> > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross
> > > > ARCH=x86_64
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > > >
> > > > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> > > >
> > > > > > WARNING: modpost: vmlinux.o(.text+0x1a8edb8): Section
> > > > > > mismatch in reference from the function stop_machine() to
> > > > > > the function .init.text:intel_rng_hw_init()
> > > > The function stop_machine() references
> > > > the function __init intel_rng_hw_init().
> > > > This is often because stop_machine lacks a __init
> > > > annotation or the annotation of intel_rng_hw_init is wrong.
> > >
> > > I'd be very interested to know how the identified patch would be able to
> > > have this effect.

Sorry, this looks like fallout from a recent LLVM change, see also:
https://lore.kernel.org/lkml/CAKwvOd=B=cHpp_XfPTtyVpQyrwQrFZX9SXKw=SJC1VC-VbEwFA@xxxxxxxxxxxxxx/

> >
> > Hi Clang Team,
> >
> > The problem is found by the latest clang, and I can't reproduce it with
> > clang-11,
> > could you take a look?
> >
> > Best Regards,
> > Rong Chen
>
> Hi Rong,
>
> Known issue. LLVM 13 cut over to the new pass manager (NPM) which has
> changed some of the inlining heuristics. I would probably recommend
> cutting over to the "release/12.x" branch for now, which should be more

ehh...we still want coverage of ToT LLVM though, to spot potential
issues like this. I'd take both (clang-12 and 13) if possible; both
are pre-release and still undergoing active development.

> up to date but also stable.
>
> Additionally, Arnd sent a fix for this particular warning here:
> https://lore.kernel.org/lkml/20210225130153.1956990-1-arnd@xxxxxxxxxx/

Looks like it got picked up by akpm@ in -mm?

>
> Cheers,
> Nathan



--
Thanks,
~Nick Desaulniers