All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
@ 2018-12-10 16:37 WANG Chao
  2018-12-12  8:14 ` Zhenzhong Duan
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: WANG Chao @ 2018-12-10 16:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: stable, Peter Zijlstra, Zhenzhong Duan, Thomas Gleixner,
	David Woodhouse, Borislav Petkov, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.

Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
---
 arch/x86/kernel/cpu/bugs.c   | 2 +-
 include/linux/compiler-gcc.h | 2 +-
 include/linux/module.h       | 2 +-
 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 500278f5308e..e8abe3f6c10e 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init =
 static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
 	SPECTRE_V2_USER_NONE;
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 static bool spectre_v2_bad_module;
 
 bool retpoline_module_ok(bool has_retpoline)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 2010493e1040..977ddf2774f9 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -68,7 +68,7 @@
  */
 #define uninitialized_var(x) x = x
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 #define __noretpoline __attribute__((__indirect_branch__("keep")))
 #endif
 
diff --git a/include/linux/module.h b/include/linux/module.h
index fce6b4335e36..0c575f51fe57 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
 static inline void module_bug_cleanup(struct module *mod) {}
 #endif	/* CONFIG_GENERIC_BUG */
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 extern bool retpoline_module_ok(bool has_retpoline);
 #else
 static inline bool retpoline_module_ok(bool has_retpoline)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0d998c54564d..5a5b3780456f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2157,7 +2157,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");
 }
-- 
2.19.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-10 16:37 [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE WANG Chao
@ 2018-12-12  8:14 ` Zhenzhong Duan
  2018-12-12 13:10 ` Masahiro Yamada
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Zhenzhong Duan @ 2018-12-12  8:14 UTC (permalink / raw)
  To: WANG Chao, linux-kernel
  Cc: stable, Peter Zijlstra, Thomas Gleixner, David Woodhouse,
	Borislav Petkov, Daniel Borkmann, H . Peter Anvin,
	Konrad Rzeszutek Wilk, Andy Lutomirski, Masahiro Yamada,
	Michal Marek, srinivas.eeda


On 2018/12/11 0:37, WANG Chao wrote:
> Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
>
> Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> ---
>   arch/x86/kernel/cpu/bugs.c   | 2 +-
>   include/linux/compiler-gcc.h | 2 +-
>   include/linux/module.h       | 2 +-
>   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 500278f5308e..e8abe3f6c10e 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init =
>   static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
>   	SPECTRE_V2_USER_NONE;
>   
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>   static bool spectre_v2_bad_module;
>   
>   bool retpoline_module_ok(bool has_retpoline)
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 2010493e1040..977ddf2774f9 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -68,7 +68,7 @@
>    */
>   #define uninitialized_var(x) x = x
>   
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>   #define __noretpoline __attribute__((__indirect_branch__("keep")))
>   #endif
>   
> diff --git a/include/linux/module.h b/include/linux/module.h
> index fce6b4335e36..0c575f51fe57 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
>   static inline void module_bug_cleanup(struct module *mod) {}
>   #endif	/* CONFIG_GENERIC_BUG */
>   
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>   extern bool retpoline_module_ok(bool has_retpoline);
>   #else
>   static inline bool retpoline_module_ok(bool has_retpoline)
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 0d998c54564d..5a5b3780456f 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2157,7 +2157,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");
>   }

I have no idea why I have missed these chunks. Thank you for fixing.

Reviewed-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-10 16:37 [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE WANG Chao
  2018-12-12  8:14 ` Zhenzhong Duan
@ 2018-12-12 13:10 ` Masahiro Yamada
  2018-12-21  9:33 ` WANG Chao
  2019-01-09 10:04 ` [tip:x86/urgent] x86, modpost: Replace last remnants of " tip-bot for WANG Chao
  3 siblings, 0 replies; 9+ messages in thread
From: Masahiro Yamada @ 2018-12-12 13:10 UTC (permalink / raw)
  To: chao.wang
  Cc: Linux Kernel Mailing List, stable, Peter Zijlstra (Intel),
	zhenzhong.duan, Thomas Gleixner, David Woodhouse,
	Borislav Petkov, Daniel Borkmann, H. Peter Anvin, konrad.wilk,
	Andy Lutomirski, Michal Marek, srinivas.eeda

On Tue, Dec 11, 2018 at 2:17 AM WANG Chao <chao.wang@ucloud.cn> wrote:
>
> Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
>
> Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> ---



Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-10 16:37 [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE WANG Chao
  2018-12-12  8:14 ` Zhenzhong Duan
  2018-12-12 13:10 ` Masahiro Yamada
@ 2018-12-21  9:33 ` WANG Chao
  2018-12-21 10:47   ` Borislav Petkov
  2019-01-09 10:04 ` [tip:x86/urgent] x86, modpost: Replace last remnants of " tip-bot for WANG Chao
  3 siblings, 1 reply; 9+ messages in thread
From: WANG Chao @ 2018-12-21  9:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: stable, Peter Zijlstra, Zhenzhong Duan, Thomas Gleixner,
	David Woodhouse, Borislav Petkov, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

On 12/11/18 at 12:37P, WANG Chao wrote:
> Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
> 
> Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> Signed-off-by: WANG Chao <chao.wang@ucloud.cn>

ping ...

> ---
>  arch/x86/kernel/cpu/bugs.c   | 2 +-
>  include/linux/compiler-gcc.h | 2 +-
>  include/linux/module.h       | 2 +-
>  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 500278f5308e..e8abe3f6c10e 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init =
>  static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
>  	SPECTRE_V2_USER_NONE;
>  
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>  static bool spectre_v2_bad_module;
>  
>  bool retpoline_module_ok(bool has_retpoline)
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 2010493e1040..977ddf2774f9 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -68,7 +68,7 @@
>   */
>  #define uninitialized_var(x) x = x
>  
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>  #define __noretpoline __attribute__((__indirect_branch__("keep")))
>  #endif
>  
> diff --git a/include/linux/module.h b/include/linux/module.h
> index fce6b4335e36..0c575f51fe57 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
>  static inline void module_bug_cleanup(struct module *mod) {}
>  #endif	/* CONFIG_GENERIC_BUG */
>  
> -#ifdef RETPOLINE
> +#ifdef CONFIG_RETPOLINE
>  extern bool retpoline_module_ok(bool has_retpoline);
>  #else
>  static inline bool retpoline_module_ok(bool has_retpoline)
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 0d998c54564d..5a5b3780456f 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2157,7 +2157,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");
>  }
> -- 
> 2.19.2
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-21  9:33 ` WANG Chao
@ 2018-12-21 10:47   ` Borislav Petkov
  2018-12-21 11:00     ` WANG Chao
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Borislav Petkov @ 2018-12-21 10:47 UTC (permalink / raw)
  To: WANG Chao
  Cc: linux-kernel, stable, Peter Zijlstra, Zhenzhong Duan,
	Thomas Gleixner, David Woodhouse, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
> On 12/11/18 at 12:37P, WANG Chao wrote:
> > Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> > on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
> > 
> > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> > Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> 
> ping ...

This one somehow slipped through the cracks... :-\

Ok, let's see: this could be relevant for the case when a module built
with a compiler which doesn't support retpolines, gets loaded on a
system which is built with retpolines.

Which is pretty seldom as the majority of setups out there should have
a retpoline-enabled compiler. And should not allow loading external
modules anyway, but that's a different story.

So, this close to the merge window, I'm inclined to delay this one after
it and have it take the x86/urgent fixes path. Unless someone screams
and says that patch breaks his system. I haven't seen any reports about
it so far so...

Thx.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-21 10:47   ` Borislav Petkov
@ 2018-12-21 11:00     ` WANG Chao
  2018-12-21 15:48     ` David Laight
  2019-01-09  3:48     ` WANG Chao
  2 siblings, 0 replies; 9+ messages in thread
From: WANG Chao @ 2018-12-21 11:00 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-kernel, stable, Peter Zijlstra, Zhenzhong Duan,
	Thomas Gleixner, David Woodhouse, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

On 12/21/18 at 11:47P, Borislav Petkov wrote:
> On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
> > On 12/11/18 at 12:37P, WANG Chao wrote:
> > > Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> > > on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
> > > 
> > > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> > > Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> > 
> > ping ...
> 
> This one somehow slipped through the cracks... :-\
> 
> Ok, let's see: this could be relevant for the case when a module built
> with a compiler which doesn't support retpolines, gets loaded on a
> system which is built with retpolines.

You're right.

> 
> Which is pretty seldom as the majority of setups out there should have
> a retpoline-enabled compiler. And should not allow loading external
> modules anyway, but that's a different story.
> 
> So, this close to the merge window, I'm inclined to delay this one after
> it and have it take the x86/urgent fixes path. Unless someone screams
> and says that patch breaks his system. I haven't seen any reports about
> it so far so...

OK. Thanks.

WANG Chao

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-21 10:47   ` Borislav Petkov
  2018-12-21 11:00     ` WANG Chao
@ 2018-12-21 15:48     ` David Laight
  2019-01-09  3:48     ` WANG Chao
  2 siblings, 0 replies; 9+ messages in thread
From: David Laight @ 2018-12-21 15:48 UTC (permalink / raw)
  To: 'Borislav Petkov', WANG Chao
  Cc: linux-kernel, stable, Peter Zijlstra, Zhenzhong Duan,
	Thomas Gleixner, David Woodhouse, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

From: Borislav Petkov
> Sent: 21 December 2018 10:47
> On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
> > On 12/11/18 at 12:37P, WANG Chao wrote:
> > > Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> > > on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
> > >
> > > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> > > Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> >
> > ping ...
> 
> This one somehow slipped through the cracks... :-\
> 
> Ok, let's see: this could be relevant for the case when a module built
> with a compiler which doesn't support retpolines, gets loaded on a
> system which is built with retpolines.

Isn't the real problem someone taking a kernel from (say) kernel.org
that is compiled for retpolines and then trying to compile an additional
module on a system that has an old compiler?

> Which is pretty seldom as the majority of setups out there should have
> a retpoline-enabled compiler. And should not allow loading external
> modules anyway, but that's a different story.

Most of an external module is likely to be a big '.o' file that (I expect)
has to be compiled without retpolines in order to be linkable into old
kernels.
(Either that or it doesn't matter at all because it is just a change
to the generated code.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE
  2018-12-21 10:47   ` Borislav Petkov
  2018-12-21 11:00     ` WANG Chao
  2018-12-21 15:48     ` David Laight
@ 2019-01-09  3:48     ` WANG Chao
  2 siblings, 0 replies; 9+ messages in thread
From: WANG Chao @ 2019-01-09  3:48 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-kernel, stable, Peter Zijlstra, Zhenzhong Duan,
	Thomas Gleixner, David Woodhouse, Daniel Borkmann,
	H . Peter Anvin, Konrad Rzeszutek Wilk, Andy Lutomirski,
	Masahiro Yamada, Michal Marek, srinivas.eeda

On 12/21/18 at 11:47P, Borislav Petkov wrote:
> On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
> > On 12/11/18 at 12:37P, WANG Chao wrote:
> > > Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend
> > > on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
> > > 
> > > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
> > > Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> > 
> > ping ...
> 
> This one somehow slipped through the cracks... :-\
> 
> Ok, let's see: this could be relevant for the case when a module built
> with a compiler which doesn't support retpolines, gets loaded on a
> system which is built with retpolines.
> 
> Which is pretty seldom as the majority of setups out there should have
> a retpoline-enabled compiler. And should not allow loading external
> modules anyway, but that's a different story.
> 
> So, this close to the merge window, I'm inclined to delay this one after
> it and have it take the x86/urgent fixes path. Unless someone screams
> and says that patch breaks his system. I haven't seen any reports about
> it so far so...

Hi, Boris.

Please pick up this one in x86/urgent.

Thanks
Chao

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:x86/urgent] x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE
  2018-12-10 16:37 [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE WANG Chao
                   ` (2 preceding siblings ...)
  2018-12-21  9:33 ` WANG Chao
@ 2019-01-09 10:04 ` tip-bot for WANG Chao
  3 siblings, 0 replies; 9+ messages in thread
From: tip-bot for WANG Chao @ 2019-01-09 10:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: keescook, chao.wang, jeyu, jkosina, hpa, luc.vanoostenryck,
	zhenzhong.duan, akpm, michal.lkml, arnd, mingo,
	miguel.ojeda.sandonis, dwmw, x86, luto, ak, yamada.masahiro,
	tglx, linux-kernel, gor, bp, daniel, tim.c.chen, stable, peterz,
	geert, konrad.wilk

Commit-ID:  e4f358916d528d479c3c12bd2fd03f2d5a576380
Gitweb:     https://git.kernel.org/tip/e4f358916d528d479c3c12bd2fd03f2d5a576380
Author:     WANG Chao <chao.wang@ucloud.cn>
AuthorDate: Tue, 11 Dec 2018 00:37:25 +0800
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Wed, 9 Jan 2019 10:35:56 +0100

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
---
 arch/x86/kernel/cpu/bugs.c   | 2 +-
 include/linux/compiler-gcc.h | 2 +-
 include/linux/module.h       | 2 +-
 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 =
 static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
 	SPECTRE_V2_USER_NONE;
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 static bool spectre_v2_bad_module;
 
 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 @@
  */
 #define uninitialized_var(x) x = x
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 #define __noretpoline __attribute__((__indirect_branch__("keep")))
 #endif
 
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,
 static inline void module_bug_cleanup(struct module *mod) {}
 #endif	/* CONFIG_GENERIC_BUG */
 
-#ifdef RETPOLINE
+#ifdef CONFIG_RETPOLINE
 extern bool retpoline_module_ok(bool has_retpoline);
 #else
 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)
 /* 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");
 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-09 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 16:37 [PATCH] treewide: replace RETPOLINE with CONFIG_RETPOLINE WANG Chao
2018-12-12  8:14 ` Zhenzhong Duan
2018-12-12 13:10 ` Masahiro Yamada
2018-12-21  9:33 ` WANG Chao
2018-12-21 10:47   ` Borislav Petkov
2018-12-21 11:00     ` WANG Chao
2018-12-21 15:48     ` David Laight
2019-01-09  3:48     ` WANG Chao
2019-01-09 10:04 ` [tip:x86/urgent] x86, modpost: Replace last remnants of " tip-bot for WANG Chao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.