From: Peter Zijlstra <peterz@infradead.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: zhenzhong.duan@oracle.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>, Andy Lutomirski <luto@kernel.org>,
konrad.wilk@oracle.com, David Woodhouse <dwmw@amazon.co.uk>,
Thomas Gleixner <tglx@linutronix.de>,
srinivas.eeda@oracle.com, Borislav Petkov <bp@suse.de>,
Daniel Borkmann <daniel@iogearbox.net>,
Michal Marek <michal.lkml@markovi.net>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 1/3] retpolines: Only enable retpoline when compiler support it
Date: Tue, 30 Oct 2018 11:09:54 +0100 [thread overview]
Message-ID: <20181030100954.GF744@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAK7LNAQG62vzFpDC_xoTEh6CuxmRVU7jAtVe7YpVmqou1hEagQ@mail.gmail.com>
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.
next prev parent reply other threads:[~2018-10-30 10:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 6:55 [PATCH 1/3] retpolines: Only enable retpoline when compiler support it Zhenzhong Duan
2018-10-30 8:32 ` Peter Zijlstra
2018-10-31 4:58 ` Zhenzhong Duan
2018-10-30 9:39 ` Masahiro Yamada
2018-10-30 10:09 ` Peter Zijlstra [this message]
2018-10-31 5:55 ` Zhenzhong Duan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181030100954.GF744@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@suse.de \
--cc=daniel@iogearbox.net \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=srinivas.eeda@oracle.com \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.com \
--cc=zhenzhong.duan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).