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

powerpc/64s: update cpu selection options

Update the 64s GENERIC_CPU option. POWER4 support has been dropped, so
make that clear in the option name. The POWER5_CPU option is dropped
because it's uncommon, and GENERIC_CPU covers it.

-mtune= before power8 is dropped because the minimum gcc version
supports power8, and tuning is made consistent between big and little
endian.

A 970 option is added for PowerPC 970 / G5 because they still have a
user base, and -mtune=power8 does not generate good code for the 970.

This also updates the ISA versions document to add Power4/Power4+
because I didn't realise Power4+ used 2.01.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220921014103.587954-2-npiggin@gmail.com

authored by

Nicholas Piggin and committed by
Michael Ellerman
7fd123e5 58ec7f06

+21 -6
+14
Documentation/powerpc/isa-versions.rst
··· 4 4 5 5 Mapping of some CPU versions to relevant ISA versions. 6 6 7 + Note Power4 and Power4+ are not supported. 8 + 7 9 ========= ==================================================================== 8 10 CPU Architecture version 9 11 ========= ==================================================================== ··· 28 26 - PowerPC Virtual Environment Architecture Book II v2.01 29 27 - PowerPC Operating Environment Architecture Book III v2.01 30 28 - Plus Altivec/VMX ~= 2.03 29 + Power4+ - PowerPC User Instruction Set Architecture Book I v2.01 30 + - PowerPC Virtual Environment Architecture Book II v2.01 31 + - PowerPC Operating Environment Architecture Book III v2.01 32 + Power4 - PowerPC User Instruction Set Architecture Book I v2.00 33 + - PowerPC Virtual Environment Architecture Book II v2.00 34 + - PowerPC Operating Environment Architecture Book III v2.00 31 35 ========= ==================================================================== 32 36 33 37 ··· 56 48 Power5+ No 57 49 Power5 No 58 50 PPC970 Yes 51 + Power4+ No 52 + Power4 No 59 53 ========== ================== 60 54 61 55 ========== ==== ··· 76 66 Power5+ No 77 67 Power5 No 78 68 PPC970 No 69 + Power4+ No 70 + Power4 No 79 71 ========== ==== 80 72 81 73 ========== ==================================== ··· 96 84 Power5+ No 97 85 Power5 No 98 86 PPC970 No 87 + Power4+ No 88 + Power4 No 99 89 ========== ====================================
+3 -2
arch/powerpc/Makefile
··· 149 149 ifdef CONFIG_PPC_BOOK3S_64 150 150 ifdef CONFIG_CPU_LITTLE_ENDIAN 151 151 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 152 - CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8) 153 152 else 154 - CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) 155 153 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4 156 154 endif 155 + CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power10, \ 156 + $(call cc-option,-mtune=power9, \ 157 + $(call cc-option,-mtune=power8))) 157 158 else ifdef CONFIG_PPC_BOOK3E_64 158 159 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 159 160 endif
+4 -4
arch/powerpc/platforms/Kconfig.cputype
··· 126 126 If unsure, select Generic. 127 127 128 128 config GENERIC_CPU 129 - bool "Generic (POWER4 and above)" 129 + bool "Generic (POWER5 and PowerPC 970 and above)" 130 130 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 131 131 select PPC_64S_HASH_MMU 132 132 ··· 145 145 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 146 146 select PPC_64S_HASH_MMU 147 147 148 - config POWER5_CPU 149 - bool "POWER5" 148 + config PPC_970_CPU 149 + bool "PowerPC 970 (including PowerPC G5)" 150 150 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 151 151 select PPC_64S_HASH_MMU 152 152 ··· 235 235 string 236 236 depends on TARGET_CPU_BOOL 237 237 default "cell" if CELL_CPU 238 - default "power5" if POWER5_CPU 238 + default "970" if PPC_970_CPU 239 239 default "power6" if POWER6_CPU 240 240 default "power7" if POWER7_CPU 241 241 default "power8" if POWER8_CPU