From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.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: Wed, 13 May 2015 12:31:40 +0200 [thread overview]
Message-ID: <20150513103140.GA5113@gmail.com> (raw)
In-Reply-To: <20150513095248.GD1517@pd.tnic>
* Borislav Petkov <bp@alien8.de> wrote:
> On Tue, May 12, 2015 at 11:53:20PM +0200, Borislav Petkov wrote:
> > > 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?).
>
> It is starting to look better wrt size:
>
> x86_64_defconfig:
>
> text data bss dec hex filename
> before: 12375798 1812800 1085440 15274038 e91036 vmlinux
> after: 12269658 1812800 1085440 15167898 e7719a vmlinux
>
> Now we CALL _copy_*_user which does CALL the optimal alternative
> version. Advantage is that we're saving some space and alternatives
> application for copy_user* is being done in less places, i.e.
> arch/x86/lib/uaccess_64.c. If I move all copy_user_generic() callers
> there, it would be the only compilation unit where the alternatives
> will be done.
>
> The disadvantage is that we have CALL after CALL and I wanted to
> have a single CALL directly to the optimal copy_user function.
> That'll cost us space, though, and more alternatives sites to patch
> during boot...
>
> Thoughts?
So why should an alternatives-CALL, inlined directly into call sites,
cost more kernel space?
It should only be some more metadata, but that's outside any hot path
and would be freed on init. The actual hot instructions should be
exactly the same as a regular call, minus the double CALL indirection.
Thanks,
Ingo
next prev parent reply other threads:[~2015-05-13 10:31 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 [this message]
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=20150513103140.GA5113@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox