Commit eff4345e authored by Omar Sandoval's avatar Omar Sandoval Committed by Linus Torvalds

crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir

This is preparation for allowing CRASH_CORE to be enabled for any
architecture.

swapper_pg_dir is always either an array or a macro expanding to NULL.
In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take
the address of the given symbol:

	#define VMCOREINFO_SYMBOL(name) \
		vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)

Instead, use VMCOREINFO_SYMBOL_ARRAY(), which uses the value:

	#define VMCOREINFO_SYMBOL_ARRAY(name) \
		vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name)

This is the same thing for the array case but isn't an error for the macro
case.

Link: http://lkml.kernel.org/r/c05f9781ec204f40fc96f95086e7b6de6a3eb2c3.1532563124.git.osandov@fb.comSigned-off-by: default avatarOmar Sandoval <osandov@fb.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bf991c22
...@@ -401,7 +401,7 @@ static int __init crash_save_vmcoreinfo_init(void) ...@@ -401,7 +401,7 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_SYMBOL(init_uts_ns); VMCOREINFO_SYMBOL(init_uts_ns);
VMCOREINFO_SYMBOL(node_online_map); VMCOREINFO_SYMBOL(node_online_map);
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
VMCOREINFO_SYMBOL(swapper_pg_dir); VMCOREINFO_SYMBOL_ARRAY(swapper_pg_dir);
#endif #endif
VMCOREINFO_SYMBOL(_stext); VMCOREINFO_SYMBOL(_stext);
VMCOREINFO_SYMBOL(vmap_area_list); VMCOREINFO_SYMBOL(vmap_area_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment