[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200425183701.GE17645@gate.crashing.org>
Date: Sat, 25 Apr 2020 13:37:01 -0500
From: Segher Boessenkool <segher@...nel.crashing.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Arvind Sankar <nivedita@...m.mit.edu>,
Jakub Jelinek <jakub@...hat.com>, jgross@...e.com,
x86@...nel.org, Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
linuxppc-dev@...ts.ozlabs.org, Michael Matz <matz@...e.de>,
Nick Desaulniers <ndesaulniers@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Sergei Trofimovich <slyfox@...too.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Ingo Molnar <mingo@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Andy Lutomirski <luto@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Frédéric Pierret (fepitre)
<frederic.pierret@...es-os.org>,
Thomas Gleixner <tglx@...utronix.de>,
Martin Liška <mliska@...e.cz>,
boris.ostrovsky@...cle.com
Subject: Re: [PATCH] x86: Fix early boot crash on gcc-10, next try
On Sat, Apr 25, 2020 at 07:31:40PM +0200, Borislav Petkov wrote:
> > There's also the one in init/main.c which is used by multiple
> > architectures. On x86 at least, the call to arch_call_rest_init at the
> > end of start_kernel does not get tail-call optimized by gcc-10, but I
> > don't see anything that actually prevents that from happening. We should
> > add the asm("") there as well I think, unless the compiler guys see
> > something about this function that will always prevent the optimization?
>
> Hmm, that's what I was afraid of - having to sprinkle this around. Yah, let's
> wait for compiler guys to have a look here and then maybe I'll convert that
> thing to a macro called
>
> compiler_prevent_tail_call_opt()
>
> or so, so that it can be sprinkled around. ;-\
That is a lot more typing then
asm("");
but more seriously, you probably should explain why you do not want a
tail call *anyway*, and in such a comment you can say that is what the
asm is for.
I don't see anything that prevents the tailcall in current code either,
fwiw.
Segher
Powered by blists - more mailing lists