|
Message-ID: <CA+55aFy-imLQ9WeA880qR_DqKTpCiH2-3ou6_NScBGOKGE=-fQ@mail.gmail.com> Date: Tue, 6 Mar 2018 14:24:53 -0800 From: Linus Torvalds <torvalds@...ux-foundation.org> To: Arnd Bergmann <arnd@...db.de> Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>, Daniel Micay <danielmicay@...il.com>, Ingo Molnar <mingo@...nel.org>, Kees Cook <keescook@...omium.org>, Dave Hansen <dave.hansen@...ux.intel.com>, Alexander Popov <alex.popov@...ux.com>, Kernel Hardening <kernel-hardening@...ts.openwall.com>, PaX Team <pageexec@...email.hu>, Brad Spengler <spender@...ecurity.net>, Andy Lutomirski <luto@...nel.org>, Tycho Andersen <tycho@...ho.ws>, Laura Abbott <labbott@...hat.com>, Mark Rutland <mark.rutland@....com>, Borislav Petkov <bp@...en8.de>, Richard Sandiford <richard.sandiford@....com>, Thomas Gleixner <tglx@...utronix.de>, "H . Peter Anvin" <hpa@...or.com>, Peter Zijlstra <a.p.zijlstra@...llo.nl>, "Dmitry V . Levin" <ldv@...linux.org>, Emese Revfy <re.emese@...il.com>, Jonathan Corbet <corbet@....net>, Andrey Ryabinin <aryabinin@...tuozzo.com>, "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>, Thomas Garnier <thgarnie@...gle.com>, Andrew Morton <akpm@...ux-foundation.org>, Alexei Starovoitov <ast@...nel.org>, Josef Bacik <jbacik@...com>, Masami Hiramatsu <mhiramat@...nel.org>, Nicholas Piggin <npiggin@...il.com>, Al Viro <viro@...iv.linux.org.uk>, "David S . Miller" <davem@...emloft.net>, Ding Tianhong <dingtianhong@...wei.com>, David Woodhouse <dwmw@...zon.co.uk>, Josh Poimboeuf <jpoimboe@...hat.com>, Steven Rostedt <rostedt@...dmis.org>, Dominik Brodowski <linux@...inikbrodowski.net>, Juergen Gross <jgross@...e.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Dan Williams <dan.j.williams@...el.com>, Mathias Krause <minipli@...glemail.com>, Vikas Shivappa <vikas.shivappa@...ux.intel.com>, Kyle Huey <me@...ehuey.com>, Dmitry Safonov <dsafonov@...tuozzo.com>, Will Deacon <will.deacon@....com>, X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org> Subject: Re: [PATCH RFC v9 4/7] x86/entry: Erase kernel stack in syscall_trace_enter() On Tue, Mar 6, 2018 at 2:09 PM, Arnd Bergmann <arnd@...db.de> wrote: > On Tue, Mar 6, 2018 at 10:29 PM, Linus Torvalds > <torvalds@...ux-foundation.org> wrote: >> >> Yes, it can obviously generate some extra code for the "pass pointer >> to uninitialized scalar around to be initialized", where it can now >> make that stack slot be initialized to zero - so it can generate extra >> code. But disabling an optimization? >> >> What did you have in mind? > > The type of optimization that causes my earlier example That's not a valid "optimization". It doesn't make correct code run faster. It just makes incorrect code result in incorrect results. See my previous email about _why_ it does it, but the point remains: the "optimization" is not actually an optimization. It's just "garbage in, garbage out". Speed doesn't matter for garbage. In fact, see my explanation for _why_ that optimization happens to understand why adding an iniitializer doesn't make it go slower, but simply makes ie well-defined and thus makes the optimization go away. Really, only stupid compiler people think it's an "optimization" to take advantage of undefined behavior. Sure, garbage code generation can run faster, but that's not "optimization". We want to very much avoid those kinds of people, and those kinds of optimizations. It's very much why we disable strict aliasing etc - because the whole optimization is purely based on taking advantage of undefined behavior. It's shit. Don't call it anything else. Getting rid of that optimization is a *good* thing, not a bad thing. Linus
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.