Skip to contentSkip to conversation

linux-next: build warning after merge of the rcu tree

DISCUSSION Stephen Rothwell 2 participants 4 messages Jul 26, 2023 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the rcu tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

WARNING: modpost: vmlinux: section mismatch in reference: cmdline_load_proc_show+0x22 (section: .text) -> boot_command_line (section: .init.data)

Introduced by commit

cf9eca90a339 ("fs/proc: Add /proc/cmdline_load for boot loader arguments")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 10 lines · Stephen Rothwell

Hi all,

After merging the rcu tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

WARNING: modpost: vmlinux: section mismatch in reference: cmdline_load_proc_show+0x22 (section: .text) -> boot_command_line (section: .init.data)

Introduced by commit

cf9eca90a339 ("fs/proc: Add /proc/cmdline_load for boot loader arguments")

That __initdata needs to be __ro_after_init, doesn't it? Will fix, thank you!

Thanx, Paul

#2 lore raw
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the rcu tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

Quoted 8 lines
Quoted 5 lines

WARNING: modpost: vmlinux: section mismatch in reference: cmdline_load_proc_show+0x22 (section: .text) -> boot_command_line (section: .init.data)

Introduced by commit

cf9eca90a339 ("fs/proc: Add /proc/cmdline_load for boot loader arguments")

That __initdata needs to be __ro_after_init, doesn't it? Will fix, thank you!

Sigh. Hit "send" too soon. :-/

Does the following incremental diff (to be squashed into the original) help?

Thanx, Paul

------------------------------------------------------------------------

init/main.c +1 -1
index c946ab87783a..981170da0b1c 100644
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);
 void (*__initdata late_time_init)(void);
 
 /* Untouched command line saved by arch-specific code. */
-char __initdata boot_command_line[COMMAND_LINE_SIZE];
+char boot_command_line[COMMAND_LINE_SIZE] __ro_after_init;
 /* Untouched saved command line (eg. for /proc) */
 char *saved_command_line __ro_after_init;
 unsigned int saved_command_line_len __ro_after_init;
#3 lore raw

Hi Paul,

Quoted 12 lines · On Tue, 25 Jul 2023 20:48:13 -0700 "Paul E. McKenney" <[email protected]>…

Does the following incremental diff (to be squashed into the original) help?

Thanx, Paul

------------------------------------------------------------------------

init/main.c +0 -0
index c946ab87783a..981170da0b1c 100644

init/main.c EXPORT_SYMBOL(system_state); · line 141

Quoted 8 lines
init/main.c +1 -1
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);
 void (*__initdata late_time_init)(void);
 
 /* Untouched command line saved by arch-specific code. */
-char __initdata boot_command_line[COMMAND_LINE_SIZE];
+char boot_command_line[COMMAND_LINE_SIZE] __ro_after_init;
 /* Untouched saved command line (eg. for /proc) */
 char *saved_command_line __ro_after_init;
 unsigned int saved_command_line_len __ro_after_init;

I needed the following (only tested x86_64 allmodconfig build):

include/linux/init.h +4 -1
index 9a5973324072..e3ce68988e1b 100644
@@ -112,6 +112,9 @@
 #define __REFCONST       .section       ".ref.rodata", "a"
 
 #ifndef __ASSEMBLY__
+
+#include <linux/cache.h>
+
 /*
  * Used for initialization calls..
  */
@@ -143,7 +146,7 @@ struct file_system_type;
 
 /* Defined in init/main.c */
 extern int do_one_initcall(initcall_t fn);
-extern char __initdata boot_command_line[];
+extern char boot_command_line[] __ro_after_init;
 extern char *saved_command_line;
 extern unsigned int saved_command_line_len;
 extern unsigned int reset_devices;
init/main.c +1 -1
index c946ab87783a..981170da0b1c 100644
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);
 void (*__initdata late_time_init)(void);
 
 /* Untouched command line saved by arch-specific code. */
-char __initdata boot_command_line[COMMAND_LINE_SIZE];
+char boot_command_line[COMMAND_LINE_SIZE] __ro_after_init;
 /* Untouched saved command line (eg. for /proc) */
 char *saved_command_line __ro_after_init;
 unsigned int saved_command_line_len __ro_after_init;
Signature · 2 lines
Cheers,
Stephen Rothwell