linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
@ 2021-03-15 17:23 kernel test robot
  2021-03-16  7:03 ` Mike Rapoport
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-03-15 17:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, clang-built-linux, linux-kernel, David Hildenbrand,
	Mike Rapoport, Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 1847 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1e28eed17697bcf343c6743f0028cc3b5dd88bf0
commit: 34dc2efb39a231280fd6696a59bbe712bf3c5c4a memblock: fix section mismatch warning
date:   2 days ago
config: arm64-randconfig-r013-20210315 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34dc2efb39a231280fd6696a59bbe712bf3c5c4a
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 34dc2efb39a231280fd6696a59bbe712bf3c5c4a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
The function memblock_find_in_range_node() references
the function __init memblock_bottom_up().
This is often because memblock_find_in_range_node lacks a __init
annotation or the annotation of memblock_bottom_up is wrong.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28152 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
  2021-03-15 17:23 WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up() kernel test robot
@ 2021-03-16  7:03 ` Mike Rapoport
  2021-03-16 16:23   ` Nick Desaulniers
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Rapoport @ 2021-03-16  7:03 UTC (permalink / raw)
  To: kernel test robot
  Cc: Arnd Bergmann, kbuild-all, clang-built-linux, linux-kernel,
	David Hildenbrand, Andrew Morton, Linux Memory Management List

On Tue, Mar 16, 2021 at 01:23:08AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   1e28eed17697bcf343c6743f0028cc3b5dd88bf0
> commit: 34dc2efb39a231280fd6696a59bbe712bf3c5c4a memblock: fix section mismatch warning
> date:   2 days ago
> config: arm64-randconfig-r013-20210315 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
> 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 arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34dc2efb39a231280fd6696a59bbe712bf3c5c4a
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 34dc2efb39a231280fd6696a59bbe712bf3c5c4a
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> 
> >> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
> The function memblock_find_in_range_node() references
> the function __init memblock_bottom_up().
> This is often because memblock_find_in_range_node lacks a __init
> annotation or the annotation of memblock_bottom_up is wrong.

I don't have clang-13 setup handy so I could not check, but I think this
should be the fix:

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index d13e3cd938b4..5984fff3f175 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)
 /*
  * Set the allocation direction to bottom-up or top-down.
  */
-static inline __init void memblock_set_bottom_up(bool enable)
+static inline __init_memblock void memblock_set_bottom_up(bool enable)
 {
 	memblock.bottom_up = enable;
 }
@@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool enable)
  * if this is true, that said, memblock will allocate memory
  * in bottom-up direction.
  */
-static inline __init bool memblock_bottom_up(void)
+static inline __init_memblock bool memblock_bottom_up(void)
 {
 	return memblock.bottom_up;
 }

 
-- 
Sincerely yours,
Mike.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
  2021-03-16  7:03 ` Mike Rapoport
@ 2021-03-16 16:23   ` Nick Desaulniers
  2021-03-16 16:34     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Desaulniers @ 2021-03-16 16:23 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: kernel test robot, Arnd Bergmann, kbuild-all, clang-built-linux,
	LKML, David Hildenbrand, Andrew Morton,
	Linux Memory Management List

On Tue, Mar 16, 2021 at 12:04 AM Mike Rapoport <rppt@linux.ibm.com> wrote:
>
> On Tue, Mar 16, 2021 at 01:23:08AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   1e28eed17697bcf343c6743f0028cc3b5dd88bf0
> > commit: 34dc2efb39a231280fd6696a59bbe712bf3c5c4a memblock: fix section mismatch warning
> > date:   2 days ago
> > config: arm64-randconfig-r013-20210315 (attached as .config)
> > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
> > 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 arm64 cross compiling tool for clang build
> >         # apt-get install binutils-aarch64-linux-gnu
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34dc2efb39a231280fd6696a59bbe712bf3c5c4a
> >         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >         git fetch --no-tags linus master
> >         git checkout 34dc2efb39a231280fd6696a59bbe712bf3c5c4a
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >
> > >> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
> > The function memblock_find_in_range_node() references
> > the function __init memblock_bottom_up().
> > This is often because memblock_find_in_range_node lacks a __init
> > annotation or the annotation of memblock_bottom_up is wrong.
>
> I don't have clang-13 setup handy so I could not check, but I think this
> should be the fix:

Thanks for taking another look:
https://lore.kernel.org/lkml/20210225205908.GM1447004@kernel.org/
Do we want to switch the above to the below?

>
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index d13e3cd938b4..5984fff3f175 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)
>  /*
>   * Set the allocation direction to bottom-up or top-down.
>   */
> -static inline __init void memblock_set_bottom_up(bool enable)
> +static inline __init_memblock void memblock_set_bottom_up(bool enable)
>  {
>         memblock.bottom_up = enable;
>  }
> @@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool enable)
>   * if this is true, that said, memblock will allocate memory
>   * in bottom-up direction.
>   */
> -static inline __init bool memblock_bottom_up(void)
> +static inline __init_memblock bool memblock_bottom_up(void)
>  {
>         return memblock.bottom_up;
>  }
>
>
> --
> Sincerely yours,
> Mike.
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/YFBYWjtWJrnGyiVp%40linux.ibm.com.



-- 
Thanks,
~Nick Desaulniers


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
  2021-03-16 16:23   ` Nick Desaulniers
@ 2021-03-16 16:34     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-03-16 16:34 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Mike Rapoport, kernel test robot, kbuild-all, clang-built-linux,
	LKML, David Hildenbrand, Andrew Morton,
	Linux Memory Management List

On Tue, Mar 16, 2021 at 5:23 PM 'Nick Desaulniers' via Clang Built
Linux <clang-built-linux@googlegroups.com> wrote:
> On Tue, Mar 16, 2021 at 12:04 AM Mike Rapoport <rppt@linux.ibm.com> wrote:

> >
> > I don't have clang-13 setup handy so I could not check, but I think this
> > should be the fix:
>
> Thanks for taking another look:
> https://lore.kernel.org/lkml/20210225205908.GM1447004@kernel.org/
> Do we want to switch the above to the below?

The patch above is now in mainline and caused the reported problem.

> > diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> > index d13e3cd938b4..5984fff3f175 100644
> > --- a/include/linux/memblock.h
> > +++ b/include/linux/memblock.h
> > @@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)
> >  /*
> >   * Set the allocation direction to bottom-up or top-down.
> >   */
> > -static inline __init void memblock_set_bottom_up(bool enable)
> > +static inline __init_memblock void memblock_set_bottom_up(bool enable)
> >  {
> >         memblock.bottom_up = enable;
> >  }
> > @@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool enable)
> >   * if this is true, that said, memblock will allocate memory
> >   * in bottom-up direction.
> >   */
> > -static inline __init bool memblock_bottom_up(void)
> > +static inline __init_memblock bool memblock_bottom_up(void)
> >  {
> >         return memblock.bottom_up;
> >  }

I don't see the warning on my machine for some reason, but the patch
does seem correct.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

       Arnd


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-16 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 17:23 WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up() kernel test robot
2021-03-16  7:03 ` Mike Rapoport
2021-03-16 16:23   ` Nick Desaulniers
2021-03-16 16:34     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).