All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
@ 2021-03-02 19:50 ` Nathan Chancellor
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-03-02 19:50 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev,
	linux-kernel, clang-built-linux, Nathan Chancellor

If fadump_calculate_reserve_size() is not inlined, there is a modpost
warning:

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

fadump_calculate_reserve_size() calls parse_crashkernel(), which is
marked as __init and fadump_calculate_reserve_size() is called from
within fadump_reserve_mem(), which is also marked as __init.

Mark fadump_calculate_reserve_size() as __init to fix the section
mismatch. Additionally, remove the inline keyword as it is not necessary
to inline this function; the compiler is still free to do so if it feels
it is worthwhile since commit 889b3c1245de ("compiler: remove
CONFIG_OPTIMIZE_INLINING entirely").

Fixes: 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter for fadump memory reservation")
Link: https://github.com/ClangBuiltLinux/linux/issues/1300
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

Send while streaming at https://www.twitch.tv/nathanchance :P

 arch/powerpc/kernel/fadump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 8482739d42f3..eddf362caedc 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -292,7 +292,7 @@ static void fadump_show_config(void)
  * that is required for a kernel to boot successfully.
  *
  */
-static inline u64 fadump_calculate_reserve_size(void)
+static __init u64 fadump_calculate_reserve_size(void)
 {
 	u64 base, size, bootmem_min;
 	int ret;

base-commit: 5c88a17e15795226b56d83f579cbb9b7a4864f79
-- 
2.31.0.rc0.75.gec125d1bc1


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

* [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
@ 2021-03-02 19:50 ` Nathan Chancellor
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-03-02 19:50 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Nathan Chancellor, clang-built-linux,
	Paul Mackerras, linuxppc-dev

If fadump_calculate_reserve_size() is not inlined, there is a modpost
warning:

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

fadump_calculate_reserve_size() calls parse_crashkernel(), which is
marked as __init and fadump_calculate_reserve_size() is called from
within fadump_reserve_mem(), which is also marked as __init.

Mark fadump_calculate_reserve_size() as __init to fix the section
mismatch. Additionally, remove the inline keyword as it is not necessary
to inline this function; the compiler is still free to do so if it feels
it is worthwhile since commit 889b3c1245de ("compiler: remove
CONFIG_OPTIMIZE_INLINING entirely").

Fixes: 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter for fadump memory reservation")
Link: https://github.com/ClangBuiltLinux/linux/issues/1300
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

Send while streaming at https://www.twitch.tv/nathanchance :P

 arch/powerpc/kernel/fadump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 8482739d42f3..eddf362caedc 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -292,7 +292,7 @@ static void fadump_show_config(void)
  * that is required for a kernel to boot successfully.
  *
  */
-static inline u64 fadump_calculate_reserve_size(void)
+static __init u64 fadump_calculate_reserve_size(void)
 {
 	u64 base, size, bootmem_min;
 	int ret;

base-commit: 5c88a17e15795226b56d83f579cbb9b7a4864f79
-- 
2.31.0.rc0.75.gec125d1bc1


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

* Re: [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
  2021-03-02 19:50 ` Nathan Chancellor
@ 2021-03-31  1:09   ` Michael Ellerman
  -1 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-03-31  1:09 UTC (permalink / raw)
  To: Michael Ellerman, Nathan Chancellor
  Cc: Paul Mackerras, linuxppc-dev, clang-built-linux, linux-kernel,
	Benjamin Herrenschmidt

On Tue, 2 Mar 2021 12:50:14 -0700, Nathan Chancellor wrote:
> If fadump_calculate_reserve_size() is not inlined, there is a modpost
> warning:
> 
> WARNING: modpost: vmlinux.o(.text+0x5196c): Section mismatch in
> reference from the function fadump_calculate_reserve_size() to the
> function .init.text:parse_crashkernel()
> The function fadump_calculate_reserve_size() references
> the function __init parse_crashkernel().
> This is often because fadump_calculate_reserve_size lacks a __init
> annotation or the annotation of parse_crashkernel is wrong.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
      https://git.kernel.org/powerpc/c/fbced1546eaaab57a32e56c974ea8acf10c6abd8

cheers

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

* Re: [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
@ 2021-03-31  1:09   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-03-31  1:09 UTC (permalink / raw)
  To: Michael Ellerman, Nathan Chancellor
  Cc: linuxppc-dev, Paul Mackerras, linux-kernel, clang-built-linux

On Tue, 2 Mar 2021 12:50:14 -0700, Nathan Chancellor wrote:
> If fadump_calculate_reserve_size() is not inlined, there is a modpost
> warning:
> 
> WARNING: modpost: vmlinux.o(.text+0x5196c): Section mismatch in
> reference from the function fadump_calculate_reserve_size() to the
> function .init.text:parse_crashkernel()
> The function fadump_calculate_reserve_size() references
> the function __init parse_crashkernel().
> This is often because fadump_calculate_reserve_size lacks a __init
> annotation or the annotation of parse_crashkernel is wrong.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/fadump: Mark fadump_calculate_reserve_size as __init
      https://git.kernel.org/powerpc/c/fbced1546eaaab57a32e56c974ea8acf10c6abd8

cheers

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

end of thread, other threads:[~2021-03-31  1:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 19:50 [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init Nathan Chancellor
2021-03-02 19:50 ` Nathan Chancellor
2021-03-31  1:09 ` Michael Ellerman
2021-03-31  1:09   ` Michael Ellerman

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.