x86: kallsyms: disable absolute percpu symbols on !SMP
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 15 Mar 2016 21:58:12 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 23:55:16 +0000 (16:55 -0700)
scripts/kallsyms.c has a special --absolute-percpu command line option
which deals with the zero based per cpu offsets that are used when
building for SMP on x86_64.  This means that the option should only be
passed in that case, so add a Kconfig symbol with the correct predicate,
and use that instead.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/Kconfig
scripts/link-vmlinux.sh

index 22320804fbafdc57b7228b68392199657a7c2f49..b17824a875fa67c212996b2fca4565e03daba7ac 100644 (file)
@@ -1420,6 +1420,10 @@ config KALLSYMS_ALL
 
           Say N unless you really need all symbols.
 
+config KALLSYMS_ABSOLUTE_PERCPU
+       bool
+       default X86_64 && SMP
+
 config PRINTK
        default y
        bool "Enable support for printk" if EXPERT
index ba6c34ea5429535cd303b1aa1d6ebd6ae30dd912..7a08bf9a95766b366d086d266dc3477a6035969c 100755 (executable)
@@ -86,7 +86,7 @@ kallsyms()
                kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
        fi
 
-       if [ -n "${CONFIG_X86_64}" ]; then
+       if [ -n "${CONFIG_KALLSYMS_ABSOLUTE_PERCPU}" ]; then
                kallsymopt="${kallsymopt} --absolute-percpu"
        fi