* [PATCH] x86/retpoline: Fix forcing me to update my compiler
@ 2018-12-08 12:38 Kirill Marinushkin
2018-12-08 12:42 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Kirill Marinushkin @ 2018-12-08 12:38 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov
Cc: Kirill Marinushkin, Zhenzhong Duan, H . Peter Anvin, x86,
linux-kernel, stable
First problem: I cannot compile the kernel with my version of compiler
~~~~
$ make defconfig
*** Default configuration is based on 'i386_defconfig'
\#
\# configuration written to .config
\#
$ grep CONFIG_RETPOLINE .config
CONFIG_RETPOLINE=y
$ make
arch/x86/Makefile:224: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop.
~~~~
Second problem: when I disable the feature - it cannot take effect,
because the parse-time error happens before `syncconfig`
~~~~
$ scripts/config -d RETPOLINE
$ grep CONFIG_RETPOLINE .config
\# CONFIG_RETPOLINE is not set
$ make
arch/x86/Makefile:224: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop.
~~~~
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
---
arch/x86/Makefile | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index f5d7f4134524..26a2198c59b3 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -220,9 +220,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE
-ifeq ($(RETPOLINE_CFLAGS),)
- $(error You are building kernel with non-retpoline compiler, please update your compiler.)
-endif
KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
endif
--
2.13.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/retpoline: Fix forcing me to update my compiler
2018-12-08 12:38 [PATCH] x86/retpoline: Fix forcing me to update my compiler Kirill Marinushkin
@ 2018-12-08 12:42 ` Borislav Petkov
2018-12-08 13:14 ` Kirill Marinushkin
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2018-12-08 12:42 UTC (permalink / raw)
To: Kirill Marinushkin
Cc: Thomas Gleixner, Ingo Molnar, Zhenzhong Duan, H . Peter Anvin,
x86, linux-kernel, stable
On Sat, Dec 08, 2018 at 01:38:16PM +0100, Kirill Marinushkin wrote:
> First problem: I cannot compile the kernel with my version of compiler
>
> ~~~~
> $ make defconfig
> *** Default configuration is based on 'i386_defconfig'
> \#
> \# configuration written to .config
> \#
> $ grep CONFIG_RETPOLINE .config
> CONFIG_RETPOLINE=y
> $ make
> arch/x86/Makefile:224: *** You are building kernel with non-retpoline
> compiler, please update your compiler.. Stop.
> ~~~~
Does this help?
https://git.kernel.org/tip/25896d073d8a0403b07e6dec56f58e6c33678207
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/retpoline: Fix forcing me to update my compiler
2018-12-08 12:42 ` Borislav Petkov
@ 2018-12-08 13:14 ` Kirill Marinushkin
2018-12-08 13:20 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Kirill Marinushkin @ 2018-12-08 13:14 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, Zhenzhong Duan, H . Peter Anvin,
x86, linux-kernel, stable
>> First problem: I cannot compile the kernel with my version of compiler
>> Second problem: when I disable the feature - it cannot take effect,
>> because the parse-time error happens before `syncconfig`
On 12/08/18 13:42, Borislav Petkov wrote:
> Does this help?
>
> https://git.kernel.org/tip/25896d073d8a0403b07e6dec56f58e6c33678207
>
The patch which you mentioned fixes the second problem: now I can disable
CONFIG_RETPOLINE.
But, the first problem is still here: with defconfig and gcc v6.4.0, kernel
doesn't build, with this message:
~~~~
$ make
scripts/kconfig/conf --syncconfig Kconfig
You are building kernel with non-retpoline compiler.
Please update your compiler.
make: *** [arch/x86/Makefile:311: checkbin] Error 1
~~~~
I don't think that this is a proper behavior. I suggest to allow compilation
Best Regards,
Kirill
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/retpoline: Fix forcing me to update my compiler
2018-12-08 13:14 ` Kirill Marinushkin
@ 2018-12-08 13:20 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2018-12-08 13:20 UTC (permalink / raw)
To: Kirill Marinushkin
Cc: Borislav Petkov, Thomas Gleixner, Ingo Molnar, Zhenzhong Duan,
H . Peter Anvin, x86, linux-kernel, stable
On Sat, Dec 08, 2018 at 02:14:47PM +0100, Kirill Marinushkin wrote:
> >> First problem: I cannot compile the kernel with my version of compiler
>
> >> Second problem: when I disable the feature - it cannot take effect,
> >> because the parse-time error happens before `syncconfig`
>
> On 12/08/18 13:42, Borislav Petkov wrote:
> > Does this help?
> >
> > https://git.kernel.org/tip/25896d073d8a0403b07e6dec56f58e6c33678207
> >
>
> The patch which you mentioned fixes the second problem: now I can disable
> CONFIG_RETPOLINE.
> But, the first problem is still here: with defconfig and gcc v6.4.0, kernel
> doesn't build, with this message:
>
> ~~~~
> $ make
> scripts/kconfig/conf --syncconfig Kconfig
> You are building kernel with non-retpoline compiler.
> Please update your compiler.
> make: *** [arch/x86/Makefile:311: checkbin] Error 1
> ~~~~
>
> I don't think that this is a proper behavior. I suggest to allow compilation
No, you asked for retpoline, and your compiler can not provide that, so
erroring out is the correct behavior. It is worse for you to have an
option enabled and it not being enabled just because your compiler does
not support it. That way you do not have the false sense of security.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-08 13:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-08 12:38 [PATCH] x86/retpoline: Fix forcing me to update my compiler Kirill Marinushkin
2018-12-08 12:42 ` Borislav Petkov
2018-12-08 13:14 ` Kirill Marinushkin
2018-12-08 13:20 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox