* [PATCH] Use -mskip-rax-setup if supported
@ 2015-04-16 21:23 H.J. Lu
2015-04-16 21:25 ` Andi Kleen
2015-04-25 17:26 ` Borislav Petkov
0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2015-04-16 21:23 UTC (permalink / raw)
To: LKML, H. Peter Anvin, Andi Kleen
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
GCC 5 added a compiler option, -mskip-rax-setup, for x86-64. It skips
setting up the RAX register when SSE is disabled and there are no
variable arguments passed in vector registers. Since kernel doesn't
pass vector registers to functions with variable arguments, this option
can be used to optimize the x86-64 kernel. For kernel 3.17:
text data bss dec hex filename
11455921 2204048 5853184 19513153 129bf41 vmlinux #with -mskip-rax-setup
11480079 2204048 5853184 19537311 12a1d9f vmlinux
--
H.J.
[-- Attachment #2: 0001-Use-mskip-rax-setup-if-supported.patch --]
[-- Type: text/x-patch, Size: 1401 bytes --]
From a759c1a4f6ffa408d49e1959449d6797769b951e Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 17 Dec 2014 18:05:29 -0800
Subject: [PATCH] Use -mskip-rax-setup if supported
GCC 5 added a compiler option, -mskip-rax-setup, for x86-64. It skips
setting up the RAX register when SSE is disabled and there are no
variable arguments passed in vector registers. Since kernel doesn't
pass vector registers to functions with variable arguments, this option
can be used to optimize the x86-64 kernel. For kernel 3.17:
text data bss dec hex filename
11455921 2204048 5853184 19513153 129bf41 vmlinux #with -mskip-rax-setup
11480079 2204048 5853184 19537311 12a1d9f vmlinux
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
arch/x86/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 5ba2d9c..40af1ba 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -84,6 +84,9 @@ else
# Use -mpreferred-stack-boundary=3 if supported.
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+ # Use -mskip-rax-setup if supported.
+ KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
+
# FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Use -mskip-rax-setup if supported
2015-04-16 21:23 [PATCH] Use -mskip-rax-setup if supported H.J. Lu
@ 2015-04-16 21:25 ` Andi Kleen
2015-04-25 17:26 ` Borislav Petkov
1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2015-04-16 21:25 UTC (permalink / raw)
To: H.J. Lu; +Cc: LKML, H. Peter Anvin, Andi Kleen
On Thu, Apr 16, 2015 at 02:23:44PM -0700, H.J. Lu wrote:
> GCC 5 added a compiler option, -mskip-rax-setup, for x86-64. It skips
> setting up the RAX register when SSE is disabled and there are no
> variable arguments passed in vector registers. Since kernel doesn't
> pass vector registers to functions with variable arguments, this option
> can be used to optimize the x86-64 kernel. For kernel 3.17:
>
> text data bss dec hex filename
> 11455921 2204048 5853184 19513153 129bf41 vmlinux #with -mskip-rax-setup
> 11480079 2204048 5853184 19537311 12a1d9f vmlinux
Patch looks good to me.
Reviewed-by: Andi Kleen <ak@linux.intel.com>
-Andi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Use -mskip-rax-setup if supported
2015-04-16 21:23 [PATCH] Use -mskip-rax-setup if supported H.J. Lu
2015-04-16 21:25 ` Andi Kleen
@ 2015-04-25 17:26 ` Borislav Petkov
1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2015-04-25 17:26 UTC (permalink / raw)
To: H.J. Lu; +Cc: LKML, H. Peter Anvin, Andi Kleen, Rasmus Villemoes
On Thu, Apr 16, 2015 at 02:23:44PM -0700, H.J. Lu wrote:
> GCC 5 added a compiler option, -mskip-rax-setup, for x86-64. It skips
> setting up the RAX register when SSE is disabled and there are no
> variable arguments passed in vector registers. Since kernel doesn't
> pass vector registers to functions with variable arguments, this option
> can be used to optimize the x86-64 kernel. For kernel 3.17:
>
> text data bss dec hex filename
> 11455921 2204048 5853184 19513153 129bf41 vmlinux #with -mskip-rax-setup
> 11480079 2204048 5853184 19537311 12a1d9f vmlinux
>
>
> --
> H.J.
> From a759c1a4f6ffa408d49e1959449d6797769b951e Mon Sep 17 00:00:00 2001
> From: "H.J. Lu" <hjl.tools@gmail.com>
> Date: Wed, 17 Dec 2014 18:05:29 -0800
> Subject: [PATCH] Use -mskip-rax-setup if supported
>
> GCC 5 added a compiler option, -mskip-rax-setup, for x86-64. It skips
> setting up the RAX register when SSE is disabled and there are no
> variable arguments passed in vector registers. Since kernel doesn't
> pass vector registers to functions with variable arguments, this option
> can be used to optimize the x86-64 kernel. For kernel 3.17:
>
> text data bss dec hex filename
> 11455921 2204048 5853184 19513153 129bf41 vmlinux #with -mskip-rax-setup
> 11480079 2204048 5853184 19537311 12a1d9f vmlinux
>
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Applied, thanks.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-25 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16 21:23 [PATCH] Use -mskip-rax-setup if supported H.J. Lu
2015-04-16 21:25 ` Andi Kleen
2015-04-25 17:26 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox