All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Mike Rapoport <rppt@linux.ibm.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] memblock: fix section mismatch warning again
Date: Tue, 16 Mar 2021 18:46:03 +0100	[thread overview]
Message-ID: <f47fe1eb-aecf-d12c-ae30-76331227f9dc@redhat.com> (raw)
In-Reply-To: <20210316171347.14084-1-rppt@kernel.org>

On 16.03.21 18:13, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
> 
> Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked
> memblock_bottom_up() and memblock_set_bottom_up() as __init, but they could
> be referenced from non-init functions like memblock_find_in_range_node() on
> architectures that enable CONFIG_ARCH_KEEP_MEMBLOCK.
> 
> For such builds kernel test robot reports:
> 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.
> 
> Replace __init annotations with __init_memblock annotations so that the
> appropriate section will be selected depending on
> CONFIG_ARCH_KEEP_MEMBLOCK.
> 
> Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp@intel.com
> Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning")
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 
> @Andrew, please let me know if you'd prefer this merged via memblock tree.
> 
>   include/linux/memblock.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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;
>   }
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


WARNING: multiple messages have this Message-ID (diff)
From: David Hildenbrand <david@redhat.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] memblock: fix section mismatch warning again
Date: Tue, 16 Mar 2021 18:46:03 +0100	[thread overview]
Message-ID: <f47fe1eb-aecf-d12c-ae30-76331227f9dc@redhat.com> (raw)
In-Reply-To: <20210316171347.14084-1-rppt@kernel.org>

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

On 16.03.21 18:13, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
> 
> Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked
> memblock_bottom_up() and memblock_set_bottom_up() as __init, but they could
> be referenced from non-init functions like memblock_find_in_range_node() on
> architectures that enable CONFIG_ARCH_KEEP_MEMBLOCK.
> 
> For such builds kernel test robot reports:
> 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.
> 
> Replace __init annotations with __init_memblock annotations so that the
> appropriate section will be selected depending on
> CONFIG_ARCH_KEEP_MEMBLOCK.
> 
> Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp(a)intel.com
> Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning")
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 
> @Andrew, please let me know if you'd prefer this merged via memblock tree.
> 
>   include/linux/memblock.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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;
>   }
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb

  reply	other threads:[~2021-03-16 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 17:13 [PATCH] memblock: fix section mismatch warning again Mike Rapoport
2021-03-16 17:13 ` Mike Rapoport
2021-03-16 17:46 ` David Hildenbrand [this message]
2021-03-16 17:46   ` David Hildenbrand
2021-03-16 18:01 ` Nick Desaulniers
2021-03-16 18:01   ` Nick Desaulniers
2021-03-16 18:01   ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f47fe1eb-aecf-d12c-ae30-76331227f9dc@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=ndesaulniers@google.com \
    --cc=rppt@kernel.org \
    --cc=rppt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.