From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
mingo@redhat.com, luto@kernel.org, konrad.wilk@oracle.com,
dwmw@amazon.co.uk, tglx@linutronix.de,
Srinivas REDDY Eeda <srinivas.eeda@oracle.com>,
bp@suse.de, daniel@iogearbox.net, yamada.masahiro@socionext.com,
michal.lkml@markovi.net, hpa@zytor.com
Subject: Re: [PATCH 1/3] retpolines: Only enable retpoline when compiler support it
Date: Wed, 31 Oct 2018 12:58:27 +0800 [thread overview]
Message-ID: <ac84aa90-2c20-a380-eb1b-be317b409cf8@oracle.com> (raw)
In-Reply-To: <20181030083210.GA1459@hirez.programming.kicks-ass.net>
On 2018/10/30 16:32, Peter Zijlstra wrote:
> On Mon, Oct 29, 2018 at 11:55:04PM -0700, Zhenzhong Duan 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.
>
> So what happens when we select CONFIG_RETPOLINE but do not have
> RETPOLINE_SUPPORT ? From a quick reading we'll silently build a
> !retpoline kernel. I would expect a build failure.
CONFIG_RETPOLINE is only defined when CONFIG_RETPOLINE_SUPPORT is
selected. See below chunk.
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -221,9 +221,10 @@ KBUILD_CFLAGS += -Wno-sign-compare
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# Avoid indirect branches in kernel to deal with Spectre
-ifdef CONFIG_RETPOLINE
+ifdef CONFIG_RETPOLINE_SUPPORT
ifneq ($(RETPOLINE_CFLAGS),)
- KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
+ KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DCONFIG_RETPOLINE
+ KBUILD_AFLAGS += -DCONFIG_RETPOLINE
endif
endif
Thanks
Zhenzhong
next prev parent reply other threads:[~2018-10-31 4:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 6:55 Zhenzhong Duan
2018-10-30 8:32 ` Peter Zijlstra
2018-10-31 4:58 ` Zhenzhong Duan [this message]
2018-10-30 9:39 ` Masahiro Yamada
2018-10-30 10:09 ` Peter Zijlstra
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=ac84aa90-2c20-a380-eb1b-be317b409cf8@oracle.com \
--to=zhenzhong.duan@oracle.com \
--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=peterz@infradead.org \
--cc=srinivas.eeda@oracle.com \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.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
all inboxes | Powered by JetHome®