Re: [PATCH] x86: fix early boot crash on gcc-10

From: Sergei Trofimovich
Date: Tue Mar 17 2020 - 14:10:26 EST


On Tue, 17 Mar 2020 12:46:05 +0100
Jakub Jelinek <jakub@xxxxxxxxxx> wrote:

> So, a few comments.
>
> One thing I've noticed in the command line is that
> --param=allow-store-data-races=0
> got dropped. That is fine, the parameter is gone, but it has been replaced
> in https://gcc.gnu.org/PR92046 by the
> -fno-allow-store-data-races
> option. Like the param which defaulted to 0 and has been enabled only with
> -Ofast this option is also -fno-allow-store-data-races by default unless
> -Ofast, but if kernel wanted to be explicit or make sure not to introduce
> them even with -Ofast, I'd say it should:
> # Tell gcc to never replace conditional load with a non-conditional one
> KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
> +KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
> in the toplevel Makefile.

Yeah, I noticed it yesterday as well and sent out exactly the same change:
https://lkml.org/lkml/2020/3/16/1012
I also checked that flag does not change code generation on -O2 for smpboot.c

--

Sergei