public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH] Use -mpreferred-stack-boundary=3 on x86-64 if supported
@ 2012-06-23 16:06 H.J. Lu
  2012-06-23 16:13 ` Andi Kleen
  2012-06-24  3:13 ` [tip:x86/build] x86-64, gcc: Use -mpreferred-stack-boundary= 3 " tip-bot for H.J. Lu
  0 siblings, 2 replies; 8+ messages in thread
From: H.J. Lu @ 2012-06-23 16:06 UTC (permalink / raw)
  To: LKML, Andi Kleen, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

Hi,

-mpreferred-stack-boundary=3 can be used on x86-64 with GCC 4.8.0:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383

I backported it to hjl/x32/gcc-4_7-branch branch at

http://gcc.gnu.org/git/?p=gcc.git;a=summary

http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=96828b1f869a31e3a1227afa420b8f28e71
e006c

This patch uses -mpreferred-stack-boundary=3 on x86-64 if it is supported.
I have been running 3.4 kernel compiled with this option for weeks.


H.J.

[-- Attachment #2: 0001-Use-mpreferred-stack-boundary-3-if-supported.patch --]
[-- Type: application/octet-stream, Size: 884 bytes --]

From 5e067376e73fe3bf86b71c2560e03c5d35a7b537 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 29 May 2012 14:31:23 -0700
Subject: [PATCH] Use -mpreferred-stack-boundary=3 if supported


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 94e91e4..cd4a4f7 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -49,6 +49,9 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
+	# Use -mpreferred-stack-boundary=3 if supported.
+	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+
         # 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.7.10.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-24  3:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-23 16:06 PATCH] Use -mpreferred-stack-boundary=3 on x86-64 if supported H.J. Lu
2012-06-23 16:13 ` Andi Kleen
2012-06-23 16:17   ` H. Peter Anvin
2012-06-23 16:49     ` H.J. Lu
2012-06-23 22:57       ` Randy Dunlap
2012-06-23 19:27     ` Andi Kleen
2012-06-23 19:45       ` H. Peter Anvin
2012-06-24  3:13 ` [tip:x86/build] x86-64, gcc: Use -mpreferred-stack-boundary= 3 " tip-bot for 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