From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andy Lutomirski <luto@amacapital.net>,
Denys Vlasenko <dvlasenk@redhat.com>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] Drop some asm from copy_user_64.S
Date: Tue, 12 May 2015 23:53:20 +0200 [thread overview]
Message-ID: <20150512215320.GK3497@pd.tnic> (raw)
In-Reply-To: <CA+55aFwZ4xTtvT8JX_T8RVVJD88L2hrE3HK0o-tt8BK=7T_4Aw@mail.gmail.com>
On Tue, May 12, 2015 at 02:13:33PM -0700, Linus Torvalds wrote:
> On Tue, May 12, 2015 at 1:57 PM, Borislav Petkov <bp@alien8.de> wrote:
> >
> > I want to get rid of the asm glue in arch/x86/lib/copy_user_64.S which
> > prepares the copy_user* alternatives calls. And replace it with nice and
> > clean C.
>
> Ack. I'm not a fan of the x86-64 usercopy funmctions.
>
> That said, I think you should uninline those things, and move them
> from a header file to a C file (arch/x86/lib/uaccess.c?).
Ok.
> Move all the copy_user_generic_unrolled/string garbage there too, and
> keep the header file simple.
Those are just forward declarations for the asm functions in
arch/x86/lib/copy_user_64.S but yeah, I'll do some experimenting.
Just to make sure - I'm not getting rid of the different asm string copy
versions in copy_user_64.S - just the _copy_from_user/_copy_to_user
stubs at the beginning of that file as that gunk can be replaced with
calls with inlined copy_user_generic() workhorse.
The alternatives give us directly then
CALL <optimal asm version>
which is as optimal as it gets.
> Because I think that we would actually be better off trying to inline
> the copy_user_generic_string() thing into the various versions (in
> that uaccess.c file) than try to inline the access_ok() check into the
> caller.
Right.
Thanks.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
next prev parent reply other threads:[~2015-05-12 21:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 20:57 [RFC PATCH] Drop some asm from copy_user_64.S Borislav Petkov
2015-05-12 21:13 ` Linus Torvalds
2015-05-12 21:53 ` Borislav Petkov [this message]
2015-05-13 9:52 ` Borislav Petkov
2015-05-13 10:31 ` Ingo Molnar
2015-05-13 10:43 ` Borislav Petkov
2015-05-13 10:46 ` Ingo Molnar
2015-05-13 11:16 ` Borislav Petkov
2015-05-13 16:02 ` Linus Torvalds
2015-05-14 9:36 ` Borislav Petkov
2015-05-13 6:19 ` Ingo Molnar
2015-05-13 10:28 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150512215320.GK3497@pd.tnic \
--to=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox