lkml.org 
[lkml]   [2018]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] retpolines: Only enable retpoline when compiler support it
On Tue, Oct 30, 2018 at 06:39:24PM +0900, Masahiro Yamada wrote:
> Hi,
>
>
>
> On Tue, Oct 30, 2018 at 3:57 PM Zhenzhong Duan
> <zhenzhong.duan@oracle.com> wrote:
> >
> > Since retpoline capable compilers are widely available, make
> > CONFIG_RETPOLINE hard depend on it.
> >
> > Change KBUILD to use CONFIG_RETPOLINE_SUPPORT to avoid conflict with
> > CONFIG_RETPOLINE which is used by kernel.
> >
> > With all that stuff, the check of RETPOLINE is changed to
> > CONFIG_RETPOLINE.
> >
> > This change is based on suggestion in https://lkml.org/lkml/2018/9/18/1016
> >
> > Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Borislav Petkov <bp@suse.de>
> > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > Cc: David Woodhouse <dwmw@amazon.co.uk>
> > Cc: H. Peter Anvin <hpa@zytor.com>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Cc: Andy Lutomirski <luto@kernel.org>
> > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Cc: Michal Marek <michal.lkml@markovi.net>
> > ---
>
>
> Instead of adding another CONFIG option,
> does it make sense to add compiler support checks
> to 'depends on' syntax ?
>
>
> config RETPOLINE
> bool "Avoid speculative indirect branches in kernel"
> depends on $(cc-option,-mindirect-branch=thunk-extern
> -mindirect-branch-register) || \
> $(cc-option,-mretpoline-external-thunk)
> default y
> select STACK_VALIDATION if HAVE_STACK_VALIDATION

That seems to be what we did for stackprotector, which is similar in
that it used to fail the build. So yes, this seems sane.

\
 
 \ /
  Last update: 2018-10-30 11:10    [W:0.070 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site