From: dl9pf@gmx.de
To: dl9pf@gmx.de
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-kernel@vger.kernel.org,
llvmlinux@lists.linuxfoundation.org, dwmw2@infradead.org,
behanw@converseincode.com
Subject: [PATCH] Make alignment cflags configurable.
Date: Wed, 12 Aug 2015 14:32:55 +0200 [thread overview]
Message-ID: <1439382775-28009-1-git-send-email-dl9pf@gmx.de> (raw)
From: Jan-Simon Möller <dl9pf@gmx.de>
This patch adds switches for
-falign-jumps=1
and
-falign-loops=1
Default is off by intention to allow seamless operation.
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
CC: tglx@linutronix.de
CC: mingo@redhat.com
CC: hpa@zytor.com
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
CC: llvmlinux@lists.linuxfoundation.org
CC: dwmw2@infradead.org
CC: behanw@converseincode.com
---
arch/x86/Kconfig | 22 ++++++++++++++++++++++
arch/x86/Makefile | 4 ++++
2 files changed, 26 insertions(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b3a1a5d..ebd4b03 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -644,6 +644,28 @@ config SCHED_OMIT_FRAME_POINTER
If in doubt, say "Y".
+config ALIGN_JUMP_TARGETS_NONDEFAULT
+ bool "Align jump targets to 1 byte"
+ default n
+ ---help---
+ Align jump targets to 1 byte, not the default 16 bytes.
+ This results in a smaller packaging of the Kernel
+ (around 300k in a usual configuration) by removing
+ noops that would otherwise be inserted for
+ alignment reasons.
+ The default is off to make sure all compilers work.
+
+config ALIGN_LOOPS_NONDEFAULT
+ bool "Pack loops tightly"
+ default n
+ ---help---
+ Align loops to 1 byte, not the default 16 bytes.
+ This results in a smaller packaging of the Kernel
+ by removing noops that would otherwise be inserted for
+ alignment reasons.
+ The default is off to make sure all compilers work.
+
+
menuconfig HYPERVISOR_GUEST
bool "Linux guest support"
---help---
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 118e6de..38c38f4 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -77,11 +77,15 @@ else
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
+ifdef ALIGN_JUMP_TARGETS_NONDEFAULT
# Align jump targets to 1 byte, not the default 16 bytes:
KBUILD_CFLAGS += -falign-jumps=1
+endif
+ifdef ALIGN_LOOPS_NONDEFAULT
# Pack loops tightly as well:
KBUILD_CFLAGS += -falign-loops=1
+endif
# Don't autogenerate traditional x87 instructions
KBUILD_CFLAGS += $(call cc-option,-mno-80387)
--
2.5.0
next reply other threads:[~2015-08-12 12:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 12:32 dl9pf [this message]
2015-08-12 12:50 ` David Woodhouse
2015-08-12 22:30 ` Jan-Simon Moeller
2015-08-12 22:37 ` H. Peter Anvin
2015-08-12 23:17 ` [llvmlinux] " Jan-Simon Moeller
2015-08-12 23:37 ` David Woodhouse
2015-08-12 23:59 ` Jan-Simon Moeller
2015-08-13 0:05 ` David Woodhouse
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=1439382775-28009-1-git-send-email-dl9pf@gmx.de \
--to=dl9pf@gmx.de \
--cc=behanw@converseincode.com \
--cc=dwmw2@infradead.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvmlinux@lists.linuxfoundation.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®