[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrXtXfD9=H_jqz2DowmEdeUBXOxA5zk4xVNmiK0RzJVZxw@mail.gmail.com>
Date: Thu, 22 Nov 2018 09:26:16 -0800
From: Andy Lutomirski <luto@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...nel.org>, pabeni@...hat.com,
Jens Axboe <axboe@...nel.dk>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrew Lutomirski <luto@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Denys Vlasenko <dvlasenk@...hat.com>,
Brian Gerst <brgerst@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: only use ERMS for user copies for larger sizes
On Thu, Nov 22, 2018 at 8:56 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Thu, Nov 22, 2018 at 2:32 AM Ingo Molnar <mingo@...nel.org> wrote:
> > * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> > >
> > > Random patch (with my "asm goto" hack included) attached, in case
> > > people want to play with it.
> >
> > Doesn't even look all that hacky to me. Any hack in it that I didn't
> > notice? :-)
>
> The code to use asm goto sadly doesn't have any fallback at all for
> the "no asm goto available".
>
> I guess we're getting close to "we require asm goto support", but I
> don't think we're there yet.
commit e501ce957a786ecd076ea0cfb10b114e6e4d0f40
Author: Peter Zijlstra <peterz@...radead.org>
Date: Wed Jan 17 11:42:07 2018 +0100
x86: Force asm-goto
We want to start using asm-goto to guarantee the absence of dynamic
branches (and thus speculation).
A primary prerequisite for this is of course that the compiler
supports asm-goto. This effecively lifts the minimum GCC version to
build an x86 kernel to gcc-4.5.
This is basically the only good outcome from the speculation crap as
far as I'm concerned :)
So I think your patch is viable. Also, with that patch applied,
put_user_ex() should become worse than worthless -- if gcc is any
good, plain old:
if (unsafe_put_user(...) != 0)
goto err;
if (unsafe_put_user(...) != 0)
goto err;
etc.
will generate *better* code than a series of put_user_ex() calls.
Powered by blists - more mailing lists