Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1466883

Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault
Date 2016-08-21 01:40 +0200
Message-ID <s8o1P-140-3@gated-at.bofh.it> (permalink)
References <s7XuF-1cK-3@gated-at.bofh.it> <s7Zwu-2rP-11@gated-at.bofh.it> <s809c-2Vg-23@gated-at.bofh.it> <s80iR-2Yl-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, Aug 19, 2016 at 3:11 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>>
>> (I have some experimental patches that actually use "asm goto" in
>> "unsafe_put_user()" to get that nice code generation, but they only
>> work if your gcc version supports "asm goto", which some older
>> versions of gcc does not)
>
> Since you actually are looking at the user access stuff, I'll just put
> them here.

Here's an updated patch that applies on current git and that actually
uses this for filldir() (but not signal handling).

It turns out that on Skylake, which supports SMAP, the clac/stac
instructions are quite slow, and doing them for each access makes
things insanely much slower than it could be. And "filldir" does the
user accesses one by one (except for the name copying), and is
actually somewhat common under some loads (ie the "find . -name XYZ"
kind of thing).

Anyway, the asm coming out of gcc looks nasty, because it has all the
ugly section stuiff and fixups for SMAP not existing on some CPU's
etc. So the resulting fs/readdir.s file is hard to read. But if you
look at the disassembly at the object file that hides all that (and
shows what the end result actually is), the actual filldir user
accesses end up looking beautiful, with no extra code anywhere. An
exception just goes to the EFAULT handling directly.

Sadly, unsafe_get_user() looking as good does require gcc improvements
that aren't imminent.

This patch is untested, although the earlier original pre-rebased
version of it actually got a fair amount of testing on my machine
(including the filldir use)

                    Linus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 21:20 +0200
  Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-19 23:30 +0200
    Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-20 00:10 +0200
      Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-20 00:20 +0200
        Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-21 01:40 +0200
          Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-21 02:20 +0200
            Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-21 02:50 +0200
              Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-21 03:10 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault "H. Peter Anvin" <hpa@zytor.com> - 2016-08-21 03:10 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-21 03:50 +0200
              Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Jakub Jelinek <jakub@redhat.com> - 2016-08-21 07:00 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-21 08:50 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-21 20:00 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-23 00:30 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault "H. Peter Anvin" <hpa@zytor.com> - 2016-08-23 01:20 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-23 01:50 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of  fault David Miller <davem@davemloft.net> - 2016-08-23 02:00 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault "H. Peter Anvin" <hpa@zytor.com> - 2016-08-23 02:10 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault "H. Peter Anvin" <hpa@zytor.com> - 2016-08-23 02:00 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-23 02:20 +0200
                Re: [PATCH] ARC: uaccess: get_user to zero out dest in cause of fault "H. Peter Anvin" <hpa@zytor.com> - 2016-08-23 01:20 +0200

csiph-web