From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755446AbbHLMex (ORCPT ); Wed, 12 Aug 2015 08:34:53 -0400 Received: from mout.gmx.net ([212.227.17.21]:51540 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754927AbbHLMet (ORCPT ); Wed, 12 Aug 2015 08:34:49 -0400 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 Message-Id: <1439382775-28009-1-git-send-email-dl9pf@gmx.de> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Aim1jEcOazSG5wd6WOFtoWLDY1fxc2Fy3Pz47A20iPc/0VnYIGV Sgpm4Pp0bSDiLI5rGC5SW0Gm/9LH21h0DpOykLrl78NvlBqEoXPMp2EkjgXjrSGJ0tPXnP4 TiNU1AQXCcArQ9GXnRJZ948a/awHP2lAJtVUofkolN1uO/O2NaVWDlxh8p2lYpfQ5HBqUoS Jh3NPt9KQdRSPWEFp7ITQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:9wMMwVDxlXA=:UkatirGSje48USSy28kKqX WEp99Ars6g4lPUy4PGpHj3F1/BzzAsigYF3WIF1iwUvSZmTEIlwcfRK/v05KNMnv6iWDN/utu WUBKsba30V9skbY4FAAda7ZlYkkFaNQrYuyEITy/2KqH+tl6C53JMK6D+N26cSMXLBjT67Itk xyXFu9TMk9+3SNXgOizjnMzFDLJVb8LpaupB5TGpkjE4GfHyqLZwfDqkWQYxi+lh6bBSxBDUi LjK4Kz3K/VI/GpqECCFSWY/YK96X5R1q69u1uDov++0mwiCm1NesglqaR6xSZgprbbYDf7qFu LihrXpfxt8VFiVRnACiask6mjqP4nW3z/POhXwFUUNboFW/Sq455dlMHGcFVd7ScSycWBQh+H TemC7pcWL3FEBexxCwqFq4/y7ZVGYth7G07m1Iu3G/BWFkzjXOI2gOwwsrMQKg/rWqPcC1VSI TUn7YMU//61jREqEhF3m7reRkA1K1QKliBOAJBc4UxqgaNFJX0NRjBiO2hJqdK28MVgvrbDGJ KGr2YixFt63gopxRBNESqetH/KwEbIHXjfmTsiBLji048VXz/X6V8Kp6gMfCLciHnZ3AlMjSx KbkLnXQLFHKz8m5KkAvkZSHg9NeMNwWIBa1P7pxPHVYwzUOdHNQ8uBKjAciz3tPsdUZmQE4UO Gf27b+ZvwKQM2oHXppzlgGLRosgPqg5nPAbDWhqop7j7194Mv7EJPdlpAWPW3/RxKgHhQHBXN 3z1hHqTF24WNIF48e1+5BEmdJQHL4m/uuFssNw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan-Simon Möller 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 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