diff options
| author | WANG Chao <chao.wang@ucloud.cn> | 2018-12-10 11:37:25 -0500 |
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2019-01-09 04:35:56 -0500 |
| commit | e4f358916d528d479c3c12bd2fd03f2d5a576380 (patch) | |
| tree | 5b1a4b2fee733f2c3b30798a1827443079bc0619 | |
| parent | 90802938f7e88045ace123e105e22e8c3e7f9c7e (diff) | |
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 <chao.wang@ucloud.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Kees Cook <keescook@chromium.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: linux-kbuild@vger.kernel.org
Cc: srinivas.eeda@oracle.com
Cc: stable <stable@vger.kernel.org>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
| -rw-r--r-- | arch/x86/kernel/cpu/bugs.c | 2 | ||||
| -rw-r--r-- | include/linux/compiler-gcc.h | 2 | ||||
| -rw-r--r-- | include/linux/module.h | 2 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 8654b8b0c848..1de0f4170178 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c | |||
| @@ -215,7 +215,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = | |||
| 215 | static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = | 215 | static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = |
| 216 | SPECTRE_V2_USER_NONE; | 216 | SPECTRE_V2_USER_NONE; |
| 217 | 217 | ||
| 218 | #ifdef RETPOLINE | 218 | #ifdef CONFIG_RETPOLINE |
| 219 | static bool spectre_v2_bad_module; | 219 | static bool spectre_v2_bad_module; |
| 220 | 220 | ||
| 221 | bool retpoline_module_ok(bool has_retpoline) | 221 | bool retpoline_module_ok(bool has_retpoline) |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 5776da43da97..dd8268f5f5f0 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | */ | 68 | */ |
| 69 | #define uninitialized_var(x) x = x | 69 | #define uninitialized_var(x) x = x |
| 70 | 70 | ||
| 71 | #ifdef RETPOLINE | 71 | #ifdef CONFIG_RETPOLINE |
| 72 | #define __noretpoline __attribute__((__indirect_branch__("keep"))) | 72 | #define __noretpoline __attribute__((__indirect_branch__("keep"))) |
| 73 | #endif | 73 | #endif |
| 74 | 74 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 9a21fe3509af..8fa38d3e7538 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -828,7 +828,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, | |||
| 828 | static inline void module_bug_cleanup(struct module *mod) {} | 828 | static inline void module_bug_cleanup(struct module *mod) {} |
| 829 | #endif /* CONFIG_GENERIC_BUG */ | 829 | #endif /* CONFIG_GENERIC_BUG */ |
| 830 | 830 | ||
| 831 | #ifdef RETPOLINE | 831 | #ifdef CONFIG_RETPOLINE |
| 832 | extern bool retpoline_module_ok(bool has_retpoline); | 832 | extern bool retpoline_module_ok(bool has_retpoline); |
| 833 | #else | 833 | #else |
| 834 | static inline bool retpoline_module_ok(bool has_retpoline) | 834 | static inline bool retpoline_module_ok(bool has_retpoline) |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0de2fb236640..26bf886bd168 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -2185,7 +2185,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) | |||
| 2185 | /* Cannot check for assembler */ | 2185 | /* Cannot check for assembler */ |
| 2186 | static void add_retpoline(struct buffer *b) | 2186 | static void add_retpoline(struct buffer *b) |
| 2187 | { | 2187 | { |
| 2188 | buf_printf(b, "\n#ifdef RETPOLINE\n"); | 2188 | buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); |
| 2189 | buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); | 2189 | buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); |
| 2190 | buf_printf(b, "#endif\n"); | 2190 | buf_printf(b, "#endif\n"); |
| 2191 | } | 2191 | } |
