[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac84aa90-2c20-a380-eb1b-be317b409cf8@oracle.com>
Date: Wed, 31 Oct 2018 12:58:27 +0800
From: Zhenzhong Duan <zhenzhong.duan@...cle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Linux-Kernel <linux-kernel@...r.kernel.org>, mingo@...hat.com,
luto@...nel.org, konrad.wilk@...cle.com, dwmw@...zon.co.uk,
tglx@...utronix.de, Srinivas REDDY Eeda <srinivas.eeda@...cle.com>,
bp@...e.de, daniel@...earbox.net, yamada.masahiro@...ionext.com,
michal.lkml@...kovi.net, hpa@...or.com
Subject: Re: [PATCH 1/3] retpolines: Only enable retpoline when compiler
support it
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
Powered by blists - more mailing lists