Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
1db9e051 b226635a

+69
+61
arch/s390/Kconfig
··· 238 238 239 239 endchoice 240 240 241 + config MARCH_G5_TUNE 242 + def_bool TUNE_G5 || MARCH_G5 && TUNE_DEFAULT 243 + 244 + config MARCH_Z900_TUNE 245 + def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT 246 + 247 + config MARCH_Z990_TUNE 248 + def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT 249 + 250 + config MARCH_Z9_109_TUNE 251 + def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT 252 + 253 + config MARCH_Z10_TUNE 254 + def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT 255 + 256 + config MARCH_Z196_TUNE 257 + def_bool TUNE_Z196 || MARCH_Z196 && TUNE_DEFAULT 258 + 259 + config MARCH_ZEC12_TUNE 260 + def_bool TUNE_ZEC12 || MARCH_ZEC12 && TUNE_DEFAULT 261 + 262 + choice 263 + prompt "Tune code generation" 264 + default TUNE_DEFAULT 265 + help 266 + Cause the compiler to tune (-mtune) the generated code for a machine. 267 + This will make the code run faster on the selected machine but 268 + somewhat slower on other machines. 269 + This option only changes how the compiler emits instructions, not the 270 + selection of instructions itself, so the resulting kernel will run on 271 + all other machines. 272 + 273 + config TUNE_DEFAULT 274 + bool "Default" 275 + help 276 + Tune the generated code for the target processor for which the kernel 277 + will be compiled. 278 + 279 + config TUNE_G5 280 + bool "System/390 model G5 and G6" 281 + 282 + config TUNE_Z900 283 + bool "IBM zSeries model z800 and z900" 284 + 285 + config TUNE_Z990 286 + bool "IBM zSeries model z890 and z990" 287 + 288 + config TUNE_Z9_109 289 + bool "IBM System z9" 290 + 291 + config TUNE_Z10 292 + bool "IBM System z10" 293 + 294 + config TUNE_Z196 295 + bool "IBM zEnterprise 114 and 196" 296 + 297 + config TUNE_ZEC12 298 + bool "IBM zBC12 and zEC12" 299 + 300 + endchoice 301 + 241 302 config 64BIT 242 303 def_bool y 243 304 prompt "64 bit kernel"
+8
arch/s390/Makefile
··· 43 43 cflags-$(CONFIG_MARCH_Z196) += -march=z196 44 44 cflags-$(CONFIG_MARCH_ZEC12) += -march=zEC12 45 45 46 + cflags-$(CONFIG_MARCH_G5_TUNE) += -mtune=g5 47 + cflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900 48 + cflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990 49 + cflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109 50 + cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10 51 + cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196 52 + cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12 53 + 46 54 #KBUILD_IMAGE is necessary for make rpm 47 55 KBUILD_IMAGE :=arch/s390/boot/image 48 56