From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
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: Wed, 13 May 2015 08:19:55 +0200 [thread overview]
Message-ID: <20150513061954.GA24538@gmail.com> (raw)
In-Reply-To: <20150512205750.GJ3497@pd.tnic>
* Borislav Petkov <bp@alien8.de> wrote:
> Hi guys,
>
> this is just an RFC first to sanity-check what I'm trying to do:
>
> 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.
>
> The other intention is to switch to using copy_user_generic() which does
> CALL <copy_user_function> directly instead of as it is now with CALL
> _copy_*_user and inside the JMP to the proper <copy_user_function>,
> i.e., to save us that JMP.
>
> I'm not 100% sure about the equivalence between the addition carry and
> segment limit check we're doing in asm in arch/x86/lib/copy_user_64.S
> now and with the access_ok() I've replaced it with.
>
> I mean, it *looks* like access_ok() and __chk_range_not_ok() especially
> does the proper checks - addition carry and segment limit with
> user_addr_max() but I'd like for someone much more experienced than me
> to double-check that.
>
> So, without much further ado, here is the diff. It looks simple enough...
Looks nice. Would be useful to do before/after analysis of the
generated asm with a defconfig and document that in the changelog.
I'd keep any changes to inlining decisions a separate patch and do
vmlinux before/after size analysis as well, so that we don't mix the
effects of the various enhancements.
Thanks,
Ingo
next prev parent reply other threads:[~2015-05-13 6:20 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
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 [this message]
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=20150513061954.GA24538@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.