[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1439382775-28009-1-git-send-email-dl9pf@gmx.de>
Date: Wed, 12 Aug 2015 14:32:55 +0200
From: dl9pf@....de
To: dl9pf@....de
Cc: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, linux-kernel@...r.kernel.org,
llvmlinux@...ts.linuxfoundation.org, dwmw2@...radead.org,
behanw@...verseincode.com
Subject: [PATCH] Make alignment cflags configurable.
From: Jan-Simon Möller <dl9pf@....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@....de>
CC: tglx@...utronix.de
CC: mingo@...hat.com
CC: hpa@...or.com
CC: x86@...nel.org
CC: linux-kernel@...r.kernel.org
CC: llvmlinux@...ts.linuxfoundation.org
CC: dwmw2@...radead.org
CC: behanw@...verseincode.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists