* [PATCH] x86_64: use -mskip-rax-setup when available
@ 2015-04-20 12:28 Rasmus Villemoes
2015-04-20 15:07 ` Borislav Petkov
0 siblings, 1 reply; 9+ messages in thread
From: Rasmus Villemoes @ 2015-04-20 12:28 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
Cc: Rasmus Villemoes, linux-kernel
gcc 5 supports the option -mskip-rax-setup to avoid emitting the
two-byte instruction xor %eax,%eax before a vararg function
call. Clearing %eax is redundant in the kernel, since no callee
expects any floating point arguments, and hence never use the incoming
value of %eax for anything.
For a defconfig kernel, the .text saving is around 26 kB:
$ size /tmp/vmlinux.{old,new}
text data bss dec hex filename
12221850 1735352 1077248 15034450 e56852 /tmp/vmlinux.old
12195955 1735352 1077248 15008555 e5032b /tmp/vmlinux.new
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
Nothing seems to have happened on the kernel side since H.J. Lu
implemented this in December. Since gcc 5 is officially released
soon, I think it would be nice if this could soak in -next until the
next merge window.
arch/x86/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 2fda005bb334..00bc42c4cbd1 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -81,6 +81,8 @@ else
KBUILD_CFLAGS += $(call cc-option,-mno-80387)
KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
+ KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
+
# Use -mpreferred-stack-boundary=3 if supported.
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
--
2.1.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-20 12:28 [PATCH] x86_64: use -mskip-rax-setup when available Rasmus Villemoes
@ 2015-04-20 15:07 ` Borislav Petkov
2015-04-20 20:24 ` Rasmus Villemoes
0 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2015-04-20 15:07 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel
On Mon, Apr 20, 2015 at 02:28:16PM +0200, Rasmus Villemoes wrote:
> gcc 5 supports the option -mskip-rax-setup to avoid emitting the
> two-byte instruction xor %eax,%eax before a vararg function
> call. Clearing %eax is redundant in the kernel, since no callee
> expects any floating point arguments, and hence never use the incoming
> value of %eax for anything.
>
> For a defconfig kernel, the .text saving is around 26 kB:
>
> $ size /tmp/vmlinux.{old,new}
> text data bss dec hex filename
> 12221850 1735352 1077248 15034450 e56852 /tmp/vmlinux.old
> 12195955 1735352 1077248 15008555 e5032b /tmp/vmlinux.new
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>
> Nothing seems to have happened on the kernel side since H.J. Lu
> implemented this in December. Since gcc 5 is officially released
I see the same patch from him from Apr. 16th:
https://lkml.kernel.org/r/CAMe9rOrfDo3MGaQc_s5crw3TrYhS8NtqeyRcUFiA0yAV8e9Nig@mail.gmail.com
Why are you sending it too?
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-20 15:07 ` Borislav Petkov
@ 2015-04-20 20:24 ` Rasmus Villemoes
2015-04-20 20:41 ` Borislav Petkov
0 siblings, 1 reply; 9+ messages in thread
From: Rasmus Villemoes @ 2015-04-20 20:24 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Mon, Apr 20 2015, Borislav Petkov <bp@alien8.de> wrote:
> On Mon, Apr 20, 2015 at 02:28:16PM +0200, Rasmus Villemoes wrote:
>>
>> Nothing seems to have happened on the kernel side since H.J. Lu
>> implemented this in December. Since gcc 5 is officially released
>
> I see the same patch from him from Apr. 16th:
>
> https://lkml.kernel.org/r/CAMe9rOrfDo3MGaQc_s5crw3TrYhS8NtqeyRcUFiA0yAV8e9Nig@mail.gmail.com
>
> Why are you sending it too?
Hadn't seen that, so I wrongly assumed everybody had forgotten about
it. I don't care about the S-o-b on the trivial Makefile patch, but my
request for a feature-suggested-by or similar still stands.
Rasmus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-20 20:24 ` Rasmus Villemoes
@ 2015-04-20 20:41 ` Borislav Petkov
2015-04-23 11:00 ` Rasmus Villemoes
0 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2015-04-20 20:41 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Mon, Apr 20, 2015 at 10:24:44PM +0200, Rasmus Villemoes wrote:
> Hadn't seen that, so I wrongly assumed everybody had forgotten about
> it. I don't care about the S-o-b on the trivial Makefile patch, but my
> request for a feature-suggested-by or similar still stands.
I don't understand what that means. Are you saying, you want the patch
in or you want attribution or ...?
/me is confused.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-20 20:41 ` Borislav Petkov
@ 2015-04-23 11:00 ` Rasmus Villemoes
2015-04-23 12:29 ` Borislav Petkov
0 siblings, 1 reply; 9+ messages in thread
From: Rasmus Villemoes @ 2015-04-23 11:00 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Mon, Apr 20 2015, Borislav Petkov <bp@alien8.de> wrote:
> On Mon, Apr 20, 2015 at 10:24:44PM +0200, Rasmus Villemoes wrote:
>> Hadn't seen that, so I wrongly assumed everybody had forgotten about
>> it. I don't care about the S-o-b on the trivial Makefile patch, but my
>> request for a feature-suggested-by or similar still stands.
>
> I don't understand what that means. Are you saying, you want the patch
> in
Mostly this, of course, or the whole thing would have been
pointless.
> or you want attribution or ...?
That would be nice.
Rasmus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-23 11:00 ` Rasmus Villemoes
@ 2015-04-23 12:29 ` Borislav Petkov
2015-04-23 12:55 ` Rasmus Villemoes
2015-04-23 12:55 ` H.J. Lu
0 siblings, 2 replies; 9+ messages in thread
From: Borislav Petkov @ 2015-04-23 12:29 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Thu, Apr 23, 2015 at 01:00:26PM +0200, Rasmus Villemoes wrote:
> > or you want attribution or ...?
>
> That would be nice.
I fail to see for what - I see H.J. Lu's patch from Dec. 2014 and you
repeating the same patch months later.
Don't get me wrong - I'd gladly add your attribution too but it is his
patch which should go because it was the first. It is only fair this way
IMO.
Now, if you go and test his patch on latest linus/master, I'd gladly add
your Tested-by...
Thanks.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-23 12:29 ` Borislav Petkov
@ 2015-04-23 12:55 ` Rasmus Villemoes
2015-04-23 13:12 ` Borislav Petkov
2015-04-23 12:55 ` H.J. Lu
1 sibling, 1 reply; 9+ messages in thread
From: Rasmus Villemoes @ 2015-04-23 12:55 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Thu, Apr 23 2015, Borislav Petkov <bp@alien8.de> wrote:
> On Thu, Apr 23, 2015 at 01:00:26PM +0200, Rasmus Villemoes wrote:
>> > or you want attribution or ...?
>>
>> That would be nice.
>
> I fail to see for what - I see H.J. Lu's patch from Dec. 2014 and you
> repeating the same patch months later.
I think we're talking past each other. What I'd like credit for is
coming up with the idea of omitting the xor %eax,%eax in the first place
(the original mail was sent to x86@kernel.org [cc'ed to a few x86
maintainers], but that doesn't seem to be publicly archived).
So it is very much not about (attribution for) the Makefile patch itself.
> [...] it is his patch which should go because it was the first. It is
> only fair this way IMO.
Agreed - all I ask for is being mentioned somewhere in the commit
log. Again, I only sent the April 20 patch because I hadn't seen
anything happen since December.
Rasmus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-23 12:55 ` Rasmus Villemoes
@ 2015-04-23 13:12 ` Borislav Petkov
0 siblings, 0 replies; 9+ messages in thread
From: Borislav Petkov @ 2015-04-23 13:12 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
H.J. Lu
On Thu, Apr 23, 2015 at 02:55:02PM +0200, Rasmus Villemoes wrote:
> I think we're talking past each other. What I'd like credit for is
> coming up with the idea of omitting the xor %eax,%eax in the first place
> (the original mail was sent to x86@kernel.org [cc'ed to a few x86
> maintainers], but that doesn't seem to be publicly archived).
Ok, now *this* I was missing. I'll add that information to the commit
message.
> Agreed - all I ask for is being mentioned somewhere in the commit
> log. Again, I only sent the April 20 patch because I hadn't seen
> anything happen since December.
Right, and I think situations like that can be much easier handled in
the future by you or the person who's interested in the patch, replying
to the original submission and asking what the status is instead of
doing a new and identical patch.
We're on the same page now :-)
Thanks!
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86_64: use -mskip-rax-setup when available
2015-04-23 12:29 ` Borislav Petkov
2015-04-23 12:55 ` Rasmus Villemoes
@ 2015-04-23 12:55 ` H.J. Lu
1 sibling, 0 replies; 9+ messages in thread
From: H.J. Lu @ 2015-04-23 12:55 UTC (permalink / raw)
To: Borislav Petkov
Cc: Rasmus Villemoes, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86@kernel.org, LKML
On Thu, Apr 23, 2015 at 5:29 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Thu, Apr 23, 2015 at 01:00:26PM +0200, Rasmus Villemoes wrote:
>> > or you want attribution or ...?
>>
>> That would be nice.
>
> I fail to see for what - I see H.J. Lu's patch from Dec. 2014 and you
> repeating the same patch months later.
This optimization I implemented in GCC was suggested by Rasmus.
He should be recognized.
> Don't get me wrong - I'd gladly add your attribution too but it is his
> patch which should go because it was the first. It is only fair this way
> IMO.
>
> Now, if you go and test his patch on latest linus/master, I'd gladly add
> your Tested-by...
Thanks.
--
H.J.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-04-23 13:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 12:28 [PATCH] x86_64: use -mskip-rax-setup when available Rasmus Villemoes
2015-04-20 15:07 ` Borislav Petkov
2015-04-20 20:24 ` Rasmus Villemoes
2015-04-20 20:41 ` Borislav Petkov
2015-04-23 11:00 ` Rasmus Villemoes
2015-04-23 12:29 ` Borislav Petkov
2015-04-23 12:55 ` Rasmus Villemoes
2015-04-23 13:12 ` Borislav Petkov
2015-04-23 12:55 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox