From: WANG Chao Date: Mon, 10 Dec 2018 16:37:25 +0000 (+0800) Subject: x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE X-Git-Tag: v4.1.12-124.31.3~289 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0b04fd96dee240d9d4f9f675221e9b159e5c4749;p=users%2Fjedix%2Flinux-maple.git x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE Commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the remaining pieces. [ bp: Massage commit message. ] Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao Signed-off-by: Borislav Petkov Reviewed-by: Zhenzhong Duan Reviewed-by: Masahiro Yamada Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Daniel Borkmann Cc: David Woodhouse Cc: Geert Uytterhoeven Cc: Jessica Yu Cc: Jiri Kosina Cc: Kees Cook Cc: Konrad Rzeszutek Wilk Cc: Luc Van Oostenryck Cc: Michal Marek Cc: Miguel Ojeda Cc: Peter Zijlstra Cc: Tim Chen Cc: Vasily Gorbik Cc: linux-kbuild@vger.kernel.org Cc: srinivas.eeda@oracle.com Cc: stable Cc: x86-ml Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn (cherry picked from commit e4f358916d528d479c3c12bd2fd03f2d5a576380) Orabug: 29211617 Signed-off-by: Alejandro Jimenez Reviewed-by: Boris Ostrovsky Signed-off-by: Brian Maly Conflicts: arch/x86/kernel/cpu/bugs.c include/linux/compiler-gcc.h include/linux/module.h UEK4 either implements the changes in different files or it does not have the patches that introduce the lines changed by this cherry-picked commit. Signed-off-by: Brian Maly --- diff --git a/arch/x86/kernel/cpu/spec_ctrl.c b/arch/x86/kernel/cpu/spec_ctrl.c index bbc18f59da463..58472598e22db 100644 --- a/arch/x86/kernel/cpu/spec_ctrl.c +++ b/arch/x86/kernel/cpu/spec_ctrl.c @@ -237,7 +237,7 @@ static int __init debugfs_spec_ctrl(void) } late_initcall(debugfs_spec_ctrl); -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE /* * RETPOLINE does not protect against indirect speculation * in firmware code. Enable IBRS to protect firmware execution. diff --git a/kernel/module.c b/kernel/module.c index fb8953dd95117..e06c4e4a5d76f 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -63,7 +63,7 @@ #include #include "module-internal.h" -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE #include #endif @@ -2724,7 +2724,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags) if (!get_modinfo(info, "intree")) add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE if (!get_modinfo(info, "retpoline")) { if (retpoline_modules_only) return -ENOEXEC; diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index a767c895aa6cc..85132eb02a643 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2142,7 +2142,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) /* Cannot check for assembler */ static void add_retpoline(struct buffer *b) { - buf_printf(b, "\n#ifdef RETPOLINE\n"); + buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); buf_printf(b, "#endif\n"); }