From faf499dfccfd88d842164078917e7b6aae9a3cdb Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 11 Sep 2013 09:29:33 +0200 Subject: s390: always set -march compiler option Currently we only set the -march compiler option if the kbuild system figured out that the compiler actually supports the selected architecture (cc-option test). In result this means that no -march compiler option is set when an unsupported cpu architecture of the current compiler is selected. The kernel compile will afterwards succeed but with the default architecture instead of the (unsupported) selected one. Change this behaviour, so compiles will fail if the compiler does not support the selected cpu architecture. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/s390/Makefile') diff --git a/arch/s390/Makefile b/arch/s390/Makefile index a7d68a467ce8..ecc9d4f73cc6 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -35,13 +35,13 @@ endif export LD_BFD -cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) -cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) -cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) -cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109) -cflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10) -cflags-$(CONFIG_MARCH_Z196) += $(call cc-option,-march=z196) -cflags-$(CONFIG_MARCH_ZEC12) += $(call cc-option,-march=zEC12) +cflags-$(CONFIG_MARCH_G5) += -march=g5 +cflags-$(CONFIG_MARCH_Z900) += -march=z900 +cflags-$(CONFIG_MARCH_Z990) += -march=z990 +cflags-$(CONFIG_MARCH_Z9_109) += -march=z9-109 +cflags-$(CONFIG_MARCH_Z10) += -march=z10 +cflags-$(CONFIG_MARCH_Z196) += -march=z196 +cflags-$(CONFIG_MARCH_ZEC12) += -march=zEC12 #KBUILD_IMAGE is necessary for make rpm KBUILD_IMAGE :=arch/s390/boot/image -- cgit v1.2.3 From 1db9e0513d7478f6c80ca0bc4f58f53fe49e27f8 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 30 Oct 2013 12:12:50 +0100 Subject: s390: allow to set gcc -mtune flag Add a new Kconfig choice group which allows to configure how gcc should tune the generated code (via -mtune option). By default the -mtune parameter will match the -march parameter. This is a rather large patch, but I wouldn't know how to make this shorter unfortunately. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/Kconfig | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/s390/Makefile | 8 +++++++ 2 files changed, 69 insertions(+) (limited to 'arch/s390/Makefile') diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index a02177fb5ec1..f75d7e517927 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -238,6 +238,67 @@ config MARCH_ZEC12 endchoice +config MARCH_G5_TUNE + def_bool TUNE_G5 || MARCH_G5 && TUNE_DEFAULT + +config MARCH_Z900_TUNE + def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT + +config MARCH_Z990_TUNE + def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT + +config MARCH_Z9_109_TUNE + def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT + +config MARCH_Z10_TUNE + def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT + +config MARCH_Z196_TUNE + def_bool TUNE_Z196 || MARCH_Z196 && TUNE_DEFAULT + +config MARCH_ZEC12_TUNE + def_bool TUNE_ZEC12 || MARCH_ZEC12 && TUNE_DEFAULT + +choice + prompt "Tune code generation" + default TUNE_DEFAULT + help + Cause the compiler to tune (-mtune) the generated code for a machine. + This will make the code run faster on the selected machine but + somewhat slower on other machines. + This option only changes how the compiler emits instructions, not the + selection of instructions itself, so the resulting kernel will run on + all other machines. + +config TUNE_DEFAULT + bool "Default" + help + Tune the generated code for the target processor for which the kernel + will be compiled. + +config TUNE_G5 + bool "System/390 model G5 and G6" + +config TUNE_Z900 + bool "IBM zSeries model z800 and z900" + +config TUNE_Z990 + bool "IBM zSeries model z890 and z990" + +config TUNE_Z9_109 + bool "IBM System z9" + +config TUNE_Z10 + bool "IBM System z10" + +config TUNE_Z196 + bool "IBM zEnterprise 114 and 196" + +config TUNE_ZEC12 + bool "IBM zBC12 and zEC12" + +endchoice + config 64BIT def_bool y prompt "64 bit kernel" diff --git a/arch/s390/Makefile b/arch/s390/Makefile index ecc9d4f73cc6..874e6d6e9c5f 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -43,6 +43,14 @@ cflags-$(CONFIG_MARCH_Z10) += -march=z10 cflags-$(CONFIG_MARCH_Z196) += -march=z196 cflags-$(CONFIG_MARCH_ZEC12) += -march=zEC12 +cflags-$(CONFIG_MARCH_G5_TUNE) += -mtune=g5 +cflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900 +cflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990 +cflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109 +cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10 +cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196 +cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12 + #KBUILD_IMAGE is necessary for make rpm KBUILD_IMAGE :=arch/s390/boot/image -- cgit v1.2.3