powerpc cpu feature and kernel build stuff
Subsystems (2)
Nicholas Piggin
reviewerPATCH 2/9 powerpc/64s: fix CPU_FTRS_POSSIBLE vector features
In reply to Nicholas PigginALTIVEC and VSX features are not default in the POWER CPU feature sets because they are intended to be enabled by firmware. They should be added individually to the CPU_FTRS_POSSIBLE set. It already contains CPU_FTR_VSX, so add ALTIVEC. This becomes important with a reduced set of supported CPUs.
The _COMP features should be used because they won't be present if compiled out.
--- arch/powerpc/include/asm/cputable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/cputable.h +2 -2
@@ -488,8 +488,8 @@ static inline void cpu_feature_keys_init(void) { } (CPU_FTRS_POWER4 |CPU_FTRS_PPC970 |CPU_FTRS_POWER5 | \CPU_FTRS_POWER6 |CPU_FTRS_POWER7 |CPU_FTRS_POWER8E | \CPU_FTRS_POWER8 |CPU_FTRS_POWER8_DD1 |CPU_FTRS_CELL | \ -CPU_FTRS_PA6T |CPU_FTR_VSX |CPU_FTRS_POWER9 | \ - CPU_FTRS_POWER9_DD1 | CPU_FTRS_POWER9_DD2_1) +CPU_FTRS_PA6T |CPU_FTR_ALTIVEC_COMP |CPU_FTR_VSX_COMP | \ + CPU_FTRS_POWER9 | CPU_FTRS_POWER9_DD1 | CPU_FTRS_POWER9_DD2_1)#endif #else enum {
Signature · 1 line
2.16.1
Nicholas Piggin
reviewercover powerpc cpu feature and kernel build stuff
These are various things that came up after taking a look at dt_cpu_ftrs again. Just a bunch of small cleanups and fixes.
Nicholas Piggin (9):
powerpc/64s: cputable add all POWER9 features to CPU_FTRS_ALWAYS powerpc/64s: fix CPU_FTRS_POSSIBLE vector features powerpc/64s: kbuild set assembler machine type to POWER4 powerpc/64s: dt_cpu_ftrs fix POWER9 DD2.2 and above
powerpc: remove unused CPU_FTR_ARCH_201
powerpc/64s: remove POWER4 support
powerpc/64/le: add GENERIC_CPU support powerpc/64s/le: refine feature sets for little endian builds powerpc/64s: add POWER9 CPU type selection
arch/powerpc/Makefile | 12 +- arch/powerpc/include/asm/cputable.h | 33 +- arch/powerpc/include/asm/mmu.h | 6 +- arch/powerpc/include/asm/ppc_asm.h | 11 +- arch/powerpc/kernel/cputable.c | 36 +- arch/powerpc/kernel/dt_cpu_ftrs.c | 4 +- arch/powerpc/kernel/entry_64.S | 2 +- arch/powerpc/kernel/exceptions-64s.S | 10 +- arch/powerpc/kernel/prom_init.c | 10 +- arch/powerpc/kvm/emulate.c | 6 - arch/powerpc/lib/copypage_power7.S | 3 - arch/powerpc/lib/copyuser_power7.S | 3 - arch/powerpc/lib/memcpy_power7.S | 3 - arch/powerpc/mm/hash_utils_64.c | 9 +- arch/powerpc/perf/Makefile | 2 +- arch/powerpc/perf/power4-pmu.c | 622 --------------------------------- arch/powerpc/platforms/Kconfig.cputype | 17 +- 17 files changed, 63 insertions(+), 726 deletions(-) delete mode 100644 arch/powerpc/perf/power4-pmu.c
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 4/9 powerpc/64s: dt_cpu_ftrs fix POWER9 DD2.2 and above
The CPU_FTR_POWER9_DD2_1 flag is intended to be set for DD2.1 and above (which is what the cputable setup does). Fix dt_cpu_ftrs setup to match.
--- arch/powerpc/kernel/dt_cpu_ftrs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/kernel/dt_cpu_ftrs.c +3 -1
@@ -707,7 +707,9 @@ static __init void cpufeatures_cpu_quirks(void)*/ if ((version &0xffffff00 ) ==0x004e0100 ) cur_cpu_spec->cpu_features |=CPU_FTR_POWER9_DD1 ; -else if ((version &0xffffefff ) ==0x004e0201 ) +else if ((version &0xffffefff ) ==0x004e0200 ) + ;/* DD2.0 has no feature flag */ +else /* DD2.1 and up have DD2_1 */ cur_cpu_spec->cpu_features |=CPU_FTR_POWER9_DD2_1 ; }
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 7/9 powerpc/64/le: add GENERIC_CPU support
In reply to Nicholas PigginAdd GENERIC_CPU support for little-endian rather than using POWER8 specific selection for POWER9 and above.
Restrict GENERIC_CPU to POWER8 and above on little endian.
--- arch/powerpc/Makefile | 5 +++++ arch/powerpc/platforms/Kconfig.cputype | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-)
arch/powerpc/Makefile +5 -0
@@ -144,8 +144,13 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) ifeq ($(CONFIG_PPC_BOOK3S_64),y) +ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) +CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 +CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power8) +else CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4) +endif else CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 endif
arch/powerpc/platforms/Kconfig.cputype +3 -3
@@ -87,7 +87,6 @@ endchoice choice prompt "CPU selection" depends on PPC64 - default POWER8_CPU if CPU_LITTLE_ENDIAN default GENERIC_CPU help This will create a kernel which is optimised for a particular CPU.
@@ -96,8 +95,9 @@ choice If unsure, select Generic. config GENERIC_CPU - bool "Generic" - depends on !CPU_LITTLE_ENDIAN + bool "Generic" if !CPU_LITTLE_ENDIAN + bool "Generic (POWER8 and above)" if CPU_LITTLE_ENDIAN + select ARCH_HAS_FAST_MULTIPLIER if CPU_LITTLE_ENDIAN config CELL_CPU bool "Cell Broadband Engine"
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 8/9 powerpc/64s/le: refine feature sets for little endian builds
In reply to Nicholas PigginThis reduces vmlinux text size by 1kB and data by 1.5kB with a small build!
--- arch/powerpc/include/asm/cputable.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/powerpc/include/asm/cputable.h +16 -0
@@ -479,6 +479,13 @@ static inline void cpu_feature_keys_init(void) { }#ifdef CONFIG_PPC_BOOK3E #define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500)#else +#ifdef CONFIG_CPU_LITTLE_ENDIAN +#define CPU_FTRS_POSSIBLE \ + (CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \ + CPU_FTRS_POWER8 | CPU_FTRS_POWER8_DD1 | \ + CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | \ + CPU_FTRS_POWER9 | CPU_FTRS_POWER9_DD1 | CPU_FTRS_POWER9_DD2_1) +#else #define CPU_FTRS_POSSIBLE \ (CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \ CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
@@ -486,6 +493,7 @@ static inline void cpu_feature_keys_init(void) { } CPU_FTRS_PA6T | CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | \ CPU_FTRS_POWER9 | CPU_FTRS_POWER9_DD1 | CPU_FTRS_POWER9_DD2_1)#endif +#endif #else enum { CPU_FTRS_POSSIBLE =
@@ -531,6 +539,13 @@ enum {#ifdef CONFIG_PPC_BOOK3E #define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500)#else +#ifdef CONFIG_CPU_LITTLE_ENDIAN +#define CPU_FTRS_ALWAYS \ + (CPU_FTRS_POWER7 & CPU_FTRS_POWER8E & \ + CPU_FTRS_POWER8 & CPU_FTRS_POWER8_DD1 & \ + CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1 & \ + CPU_FTRS_POSSIBLE & ~CPU_FTR_HVMODE) +#else #define CPU_FTRS_ALWAYS \ (CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \ CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
@@ -538,6 +553,7 @@ enum { CPU_FTRS_POWER8_DD1 & ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE & \ CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1)#endif +#endif #else enum { CPU_FTRS_ALWAYS =
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 3/9 powerpc/64s: kbuild set assembler machine type to POWER4
In reply to Nicholas PigginRather than override the machine type in .S code (which can hide wrong or ambiguous code generation for the target), set the type to power4 for all assembly.
--- arch/powerpc/Makefile | 1 + arch/powerpc/include/asm/ppc_asm.h | 11 ++++------- arch/powerpc/kernel/entry_64.S | 2 +- arch/powerpc/kernel/exceptions-64s.S | 10 ++-------- arch/powerpc/lib/copypage_power7.S | 3 --- arch/powerpc/lib/copyuser_power7.S | 3 --- arch/powerpc/lib/memcpy_power7.S | 3 --- 7 files changed, 8 insertions(+), 25 deletions(-)
arch/powerpc/Makefile +1 -0
@@ -243,6 +243,7 @@ endif cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) cpu-as-$(CONFIG_E200) += -Wa,-me200 +cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 KBUILD_AFLAGS += $(cpu-as-y) KBUILD_CFLAGS += $(cpu-as-y)
arch/powerpc/include/asm/ppc_asm.h +4 -7
@@ -439,14 +439,11 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)/* The following stops all load and store data streams associated with stream * ID (ie. streams created explicitly). The embedded and server mnemonics for -* dcbt are different so we use machine "power4" here explicitly. +* dcbt are different so this must only be used for server. */ -#define DCBT_STOP_ALL_STREAM_IDS (scratch) \ -.machine push ; \ -.machine "power4" ; \ - lis scratch,0x60000000@h; \ - dcbt 0,scratch,0b01010; \ -.machine pop +#define DCBT_BOOK3S_STOP_ALL_STREAM_IDS (scratch) \ + lis scratch,0x60000000@h; \ + dcbt 0,scratch,0b01010/* * toreal/fromreal/tophys/tovirt macros. 32-bit BookE makes them
arch/powerpc/kernel/entry_64.S +1 -1
@@ -545,7 +545,7 @@ _GLOBAL(_switch) /* Cancel all explict user streams as they will have no use after context * switch and will stop the HW from creating streams itself */ - DCBT_STOP_ALL_STREAM_IDS(r6) + DCBT_BOOK3S_STOP_ALL_STREAM_IDS(r6) #endif addi r6,r4,-THREAD /* Convert THREAD to 'current' */
arch/powerpc/kernel/exceptions-64s.S +2 -8
@@ -629,14 +629,11 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_RADIX) bne cr4,1f /* returning to kernel */ -.machine push -.machine "power4" mtcrf 0x80,r9 mtcrf 0x08,r9 /* MSR[PR] indication is in cr4 */ mtcrf 0x04,r9 /* MSR[RI] indication is in cr5 */ mtcrf 0x02,r9 /* I/D indication is in cr6 */ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ -.machine pop RESTORE_CTR(r9, PACA_EXSLB) RESTORE_PPR_PACA(PACA_EXSLB, r9)
@@ -649,14 +646,11 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_RADIX) RFI_TO_USER b . /* prevent speculative execution */ 1: -.machine push -.machine "power4" mtcrf 0x80,r9 mtcrf 0x08,r9 /* MSR[PR] indication is in cr4 */ mtcrf 0x04,r9 /* MSR[RI] indication is in cr5 */ mtcrf 0x02,r9 /* I/D indication is in cr6 */ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ -.machine pop RESTORE_CTR(r9, PACA_EXSLB) RESTORE_PPR_PACA(PACA_EXSLB, r9)
@@ -1466,7 +1460,7 @@ TRAMP_REAL_BEGIN(rfi_flush_fallback) ld r11,PACA_L1D_FLUSH_SIZE(r13) srdi r11,r11,(7 + 3) /* 128 byte lines, unrolled 8x */ mtctr r11 - DCBT_STOP_ALL_STREAM_IDS(r11) /* Stop prefetch streams */ + DCBT_BOOK3S_STOP_ALL_STREAM_IDS(r11) /* Stop prefetch streams */ /* order ld/st prior to dcbt stop all streams with flushing */ sync
@@ -1506,7 +1500,7 @@ TRAMP_REAL_BEGIN(hrfi_flush_fallback) ld r11,PACA_L1D_FLUSH_SIZE(r13) srdi r11,r11,(7 + 3) /* 128 byte lines, unrolled 8x */ mtctr r11 - DCBT_STOP_ALL_STREAM_IDS(r11) /* Stop prefetch streams */ + DCBT_BOOK3S_STOP_ALL_STREAM_IDS(r11) /* Stop prefetch streams */ /* order ld/st prior to dcbt stop all streams with flushing */ sync
arch/powerpc/lib/copypage_power7.S +0 -3
@@ -42,8 +42,6 @@ _GLOBAL(copypage_power7) lis r8,0x8000 /* GO=1 */ clrldi r8,r8,32 -.machine push -.machine "power4" /* setup read stream 0 */ dcbt 0,r4,0b01000 /* addr from */ dcbt 0,r7,0b01010 /* length and depth from */
@@ -52,7 +50,6 @@ _GLOBAL(copypage_power7) dcbtst 0,r10,0b01010 /* length and depth to */ eieio dcbt 0,r8,0b01010 /* all streams GO */ -.machine pop #ifdef CONFIG_ALTIVEC mflr r0
arch/powerpc/lib/copyuser_power7.S +0 -3
@@ -312,8 +312,6 @@ err1; stb r0,0(r3) lis r8,0x8000 /* GO=1 */ clrldi r8,r8,32 -.machine push -.machine "power4" /* setup read stream 0 */ dcbt 0,r6,0b01000 /* addr from */ dcbt 0,r7,0b01010 /* length and depth from */
@@ -322,7 +320,6 @@ err1; stb r0,0(r3) dcbtst 0,r10,0b01010 /* length and depth to */ eieio dcbt 0,r8,0b01010 /* all streams GO */ -.machine pop beq cr1,.Lunwind_stack_nonvmx_copy
arch/powerpc/lib/memcpy_power7.S +0 -3
@@ -259,15 +259,12 @@ _GLOBAL(memcpy_power7) lis r8,0x8000 /* GO=1 */ clrldi r8,r8,32 -.machine push -.machine "power4" dcbt 0,r6,0b01000 dcbt 0,r7,0b01010 dcbtst 0,r9,0b01000 dcbtst 0,r10,0b01010 eieio dcbt 0,r8,0b01010 /* GO */ -.machine pop beq cr1,.Lunwind_stack_nonvmx_copy
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 5/9 powerpc: remove unused CPU_FTR_ARCH_201
In reply to Nicholas Piggin--- arch/powerpc/include/asm/cputable.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/include/asm/cputable.h +1 -2
@@ -175,7 +175,6 @@ static inline void cpu_feature_keys_init(void) { }#endif #define CPU_FTR_HVMODE LONG_ASM_CONST(0x0000000100000000) -#define CPU_FTR_ARCH_201 LONG_ASM_CONST(0x0000000200000000)#define CPU_FTR_ARCH_206 LONG_ASM_CONST(0x0000000400000000)#define CPU_FTR_ARCH_207S LONG_ASM_CONST(0x0000000800000000)#define CPU_FTR_ARCH_300 LONG_ASM_CONST(0x0000001000000000)
@@ -417,7 +416,7 @@ static inline void cpu_feature_keys_init(void) { } CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ CPU_FTR_STCX_CHECKS_ADDRESS)#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ - CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_201 | \ + CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \ CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS | \ CPU_FTR_HVMODE | CPU_FTR_DABRX)
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 9/9 powerpc/64s: add POWER9 CPU type selection
In reply to Nicholas Piggin--- arch/powerpc/Makefile | 3 ++- arch/powerpc/platforms/Kconfig.cputype | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
arch/powerpc/Makefile +2 -1
@@ -146,7 +146,7 @@ CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) ifeq ($(CONFIG_PPC_BOOK3S_64),y) ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 -CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power8) +CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8) else CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4)
@@ -175,6 +175,7 @@ CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) CFLAGS-$(CONFIG_POWER8_CPU) += $(call cc-option,-mcpu=power8) +CFLAGS-$(CONFIG_POWER9_CPU) += $(call cc-option,-mcpu=power9) # Altivec option not allowed with e500mc64 in GCC. ifeq ($(CONFIG_ALTIVEC),y)
arch/powerpc/platforms/Kconfig.cputype +5 -0
@@ -121,6 +121,11 @@ config POWER8_CPU depends on PPC_BOOK3S_64 select ARCH_HAS_FAST_MULTIPLIER +config POWER9_CPU + bool "POWER9" + depends on PPC_BOOK3S_64 + select ARCH_HAS_FAST_MULTIPLIER + config E5500_CPU bool "Freescale e5500" depends on E500
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 1/9 powerpc/64s: cputable add all POWER9 features to CPU_FTRS_ALWAYS
In reply to Nicholas Piggin--- arch/powerpc/include/asm/cputable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/cputable.h +1 -1
@@ -541,7 +541,7 @@ enum { CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \ CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \ CPU_FTRS_POWER8_DD1 & ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE & \ - CPU_FTRS_POWER9) + CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1)#endif #else enum {
Signature · 1 line
2.16.1
Nicholas Piggin
reviewerPATCH 6/9 powerpc/64s: remove POWER4 support
In reply to Nicholas PigginPOWER4 has been broken since at least the change 49d09bf2a6 ("powerpc/64s: Optimise MSR handling in exception handling"), which requires mtmsrd L=1 support. This was introduced in ISA v2.01, and POWER4 supports ISA v2.00.
--- arch/powerpc/Makefile | 5 +- arch/powerpc/include/asm/cputable.h | 8 +- arch/powerpc/include/asm/mmu.h | 6 +- arch/powerpc/kernel/cputable.c | 36 +- arch/powerpc/kernel/prom_init.c | 10 +- arch/powerpc/kvm/emulate.c | 6 - arch/powerpc/mm/hash_utils_64.c | 9 +- arch/powerpc/perf/Makefile | 2 +- arch/powerpc/perf/power4-pmu.c | 622 --------------------------------- arch/powerpc/platforms/Kconfig.cputype | 6 +- 10 files changed, 18 insertions(+), 692 deletions(-) delete mode 100644 arch/powerpc/perf/power4-pmu.c
arch/powerpc/Makefile +2 -3
@@ -144,8 +144,8 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) ifeq ($(CONFIG_PPC_BOOK3S_64),y) -CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4) -CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4 +CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) +CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4) else CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 endif
@@ -166,7 +166,6 @@ ifdef CONFIG_MPROFILE_KERNEL endif CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell) -CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4) CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
arch/powerpc/include/asm/cputable.h +2 -6
@@ -411,10 +411,6 @@ static inline void cpu_feature_keys_init(void) { }#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)/* 64-bit CPUs */ -#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ - CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ - CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ - CPU_FTR_STCX_CHECKS_ADDRESS)#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \
@@ -484,7 +480,7 @@ static inline void cpu_feature_keys_init(void) { }#define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500)#else #define CPU_FTRS_POSSIBLE \ - (CPU_FTRS_POWER4 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \ + (CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \ CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \ CPU_FTRS_POWER8 | CPU_FTRS_POWER8_DD1 | CPU_FTRS_CELL | \ CPU_FTRS_PA6T | CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | \
@@ -536,7 +532,7 @@ enum {#define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500)#else #define CPU_FTRS_ALWAYS \ - (CPU_FTRS_POWER4 & CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \ + (CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \ CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \ CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \ CPU_FTRS_POWER8_DD1 & ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE & \
arch/powerpc/include/asm/mmu.h +3 -3
@@ -111,9 +111,9 @@/* MMU feature bit sets for various CPUs */ #define MMU_FTRS_DEFAULT_HPTE_ARCH_V2 \ MMU_FTR_HPTE_TABLE | MMU_FTR_PPCAS_ARCH_V2 -#define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2 -#define MMU_FTRS_PPC970 MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA -#define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE +#define MMU_FTRS_POWER MMU_FTRS_DEFAULT_HPTE_ARCH_V2 +#define MMU_FTRS_PPC970 MMU_FTRS_POWER | MMU_FTR_TLBIE_CROP_VA +#define MMU_FTRS_POWER5 MMU_FTRS_POWER | MMU_FTR_LOCKLESS_TLBIE#define MMU_FTRS_POWER6 MMU_FTRS_POWER5 | MMU_FTR_KERNEL_RO | MMU_FTR_68_BIT_VA#define MMU_FTRS_POWER7 MMU_FTRS_POWER6#define MMU_FTRS_POWER8 MMU_FTRS_POWER6
arch/powerpc/kernel/cputable.c +3 -33
@@ -133,36 +133,6 @@ extern void __restore_cpu_e6500(void); static struct cpu_spec __initdata cpu_specs[] = { #ifdef CONFIG_PPC_BOOK3S_64 - { /* Power4 */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x00350000, - .cpu_name = "POWER4 (gp)", - .cpu_features = CPU_FTRS_POWER4, - .cpu_user_features = COMMON_USER_POWER4, - .mmu_features = MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA, - .icache_bsize = 128, - .dcache_bsize = 128, - .num_pmcs = 8, - .pmc_type = PPC_PMC_IBM, - .oprofile_cpu_type = "ppc64/power4", - .oprofile_type = PPC_OPROFILE_POWER4, - .platform = "power4", - }, - { /* Power4+ */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x00380000, - .cpu_name = "POWER4+ (gq)", - .cpu_features = CPU_FTRS_POWER4, - .cpu_user_features = COMMON_USER_POWER4, - .mmu_features = MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA, - .icache_bsize = 128, - .dcache_bsize = 128, - .num_pmcs = 8, - .pmc_type = PPC_PMC_IBM, - .oprofile_cpu_type = "ppc64/power4", - .oprofile_type = PPC_OPROFILE_POWER4, - .platform = "power4", - }, { /* PPC970 */ .pvr_mask = 0xffff0000, .pvr_value = 0x00390000,
@@ -609,15 +579,15 @@ static struct cpu_spec __initdata cpu_specs[] = { {/* default match */ .pvr_mask = 0x00000000, .pvr_value = 0x00000000, - .cpu_name = "POWER4 (compatible)", + .cpu_name = "POWER5 (compatible)", .cpu_features = CPU_FTRS_COMPATIBLE, .cpu_user_features = COMMON_USER_PPC64, - .mmu_features = MMU_FTRS_DEFAULT_HPTE_ARCH_V2, + .mmu_features = MMU_FTRS_POWER, .icache_bsize = 128, .dcache_bsize = 128, .num_pmcs = 6, .pmc_type = PPC_PMC_IBM, - .platform = "power4", + .platform = "power5", }#endif /* CONFIG_PPC_BOOK3S_64 */
arch/powerpc/kernel/prom_init.c +1 -9
@@ -1810,16 +1810,8 @@ static void __init prom_initialize_tce_table(void)* size to 4 MB. This is enough to map 2GB of PCI DMA space. * By doing this, we avoid the pitfalls of trying to DMA to * MMIO space and the DMA alias hole. -* -* On POWER4, firmware sets the TCE region by assuming -* each TCE table is 8MB. Using this memory for anything -* else will impact performance, so we always allocate 8MB. -* Anton */ -if (pvr_version_is (PVR_POWER4 ) ||pvr_version_is (PVR_POWER4p)) - minsize =8UL <<20 ; -else - minsize =4UL <<20 ; + minsize =4UL <<20 ;/* Align to the greater of the align or size */ align =max (minalign, minsize);
arch/powerpc/kvm/emulate.c +0 -6
@@ -45,12 +45,6 @@ void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)#ifdef CONFIG_PPC_BOOK3S /* mtdec lowers the interrupt line when positive. */ kvmppc_core_dequeue_dec (vcpu); - -/* POWER4+ triggers a dec interrupt if the value is < 0 */ -if (vcpu->arch.dec &0x80000000 ) { -kvmppc_core_queue_dec (vcpu); -return ; - }#endif #ifdef CONFIG_BOOKE
arch/powerpc/mm/hash_utils_64.c +5 -4
@@ -132,9 +132,10 @@ EXPORT_SYMBOL(mmu_hash_ops);* is provided by the firmware. */ -/* Pre-POWER4 CPUs (4k pages only) +/* +* Fallback (4k pages only) */ -static struct mmu_psize_def mmu_psize_defaults_old[] = { +static struct mmu_psize_def mmu_psize_defaults[] = { [MMU_PAGE_4K ] = { .shift =12 , .sllp =0 ,
@@ -554,8 +555,8 @@ static void __init htab_scan_page_sizes(void)mmu_psize_set_default_penc ();/* Default to 4K pages only */ -memcpy (mmu_psize_defs, mmu_psize_defaults_old, -sizeof (mmu_psize_defaults_old)); +memcpy (mmu_psize_defs, mmu_psize_defaults, +sizeof (mmu_psize_defaults));/* * Try to find the available page sizes in the device-tree
arch/powerpc/perf/Makefile +1 -1
@@ -4,7 +4,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror obj-$(CONFIG_PERF_EVENTS) += callchain.o perf_regs.o obj-$(CONFIG_PPC_PERF_CTRS) += core-book3s.o bhrb.o -obj64-$(CONFIG_PPC_PERF_CTRS) += power4-pmu.o ppc970-pmu.o power5-pmu.o \ +obj64-$(CONFIG_PPC_PERF_CTRS) += ppc970-pmu.o power5-pmu.o \ power5+-pmu.o power6-pmu.o power7-pmu.o \ isa207-common.o power8-pmu.o power9-pmu.o obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o
arch/powerpc/perf/power4-pmu.c deleted +0 -622
622 lines not on this page · raw message
arch/powerpc/platforms/Kconfig.cputype +1 -5
@@ -61,7 +61,7 @@ choice help There are two families of 64 bit PowerPC chips supported. The most common ones are the desktop and server CPUs - (POWER4, POWER5, 970, POWER5+, POWER6, POWER7, POWER8 ...) + (POWER5, 970, POWER5+, POWER6, POWER7, POWER8, POWER9 ...) The other are the "embedded" processors compliant with the "Book 3E" variant of the architecture
@@ -103,10 +103,6 @@ config CELL_CPU bool "Cell Broadband Engine" depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN -config POWER4_CPU - bool "POWER4" - depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN - config POWER5_CPU bool "POWER5" depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
Signature · 1 line
2.16.1
kbuild test robot
build botRe: [PATCH 3/9] powerpc/64s: kbuild set assembler machine type to POWER4
In reply to Nicholas PigginThank you for the patch! Yet something to improve:
Hi Nicholas,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.16-rc2 next-20180221]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-cpu-feature-and-kernel-build-stuff/20180221-132025 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-ppc64e_defconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
arch/powerpc/lib/copypage_power7.S: Assembler messages:
>> arch/powerpc/lib/copypage_power7.S:46: Error: junk at end of line: `0b01000' >> arch/powerpc/lib/copypage_power7.S:47: Error: junk at end of line: `0b01010'
arch/powerpc/lib/copypage_power7.S:49: Error: junk at end of line: 0b01000' arch/powerpc/lib/copypage_power7.S:50: Error: junk at end of line: 0b01010' arch/powerpc/lib/copypage_power7.S:52: Error: junk at end of line: `0b01010'
vim +46 arch/powerpc/lib/copypage_power7.S
fde69282 Anton Blanchard 2012-05-29 22 fde69282 Anton Blanchard 2012-05-29 23 _GLOBAL(copypage_power7) fde69282 Anton Blanchard 2012-05-29 24 /* fde69282 Anton Blanchard 2012-05-29 25 * We prefetch both the source and destination using enhanced touch fde69282 Anton Blanchard 2012-05-29 26 * instructions. We use a stream ID of 0 for the load side and fde69282 Anton Blanchard 2012-05-29 27 * 1 for the store side. Since source and destination are page fde69282 Anton Blanchard 2012-05-29 28 * aligned we don't need to clear the bottom 7 bits of either fde69282 Anton Blanchard 2012-05-29 29 * address. fde69282 Anton Blanchard 2012-05-29 30 */ 280a5ba2 Michael Neuling 2013-05-29 31 ori r9,r3,1 /* stream=1 => to */ fde69282 Anton Blanchard 2012-05-29 32 fde69282 Anton Blanchard 2012-05-29 33 #ifdef CONFIG_PPC_64K_PAGES 280a5ba2 Michael Neuling 2013-05-29 34 lis r7,0x0E01 /* depth=7 280a5ba2 Michael Neuling 2013-05-29 35 * units/cachelines=512 */ fde69282 Anton Blanchard 2012-05-29 36 #else fde69282 Anton Blanchard 2012-05-29 37 lis r7,0x0E00 /* depth=7 */ 280a5ba2 Michael Neuling 2013-05-29 38 ori r7,r7,0x1000 /* units/cachelines=32 */ fde69282 Anton Blanchard 2012-05-29 39 #endif fde69282 Anton Blanchard 2012-05-29 40 ori r10,r7,1 /* stream=1 */ fde69282 Anton Blanchard 2012-05-29 41 fde69282 Anton Blanchard 2012-05-29 42 lis r8,0x8000 /* GO=1 */ fde69282 Anton Blanchard 2012-05-29 43 clrldi r8,r8,32 fde69282 Anton Blanchard 2012-05-29 44 280a5ba2 Michael Neuling 2013-05-29 45 /* setup read stream 0 */ 8a583c0a Andreas Schwab 2017-08-05 @46 dcbt 0,r4,0b01000 /* addr from */ 8a583c0a Andreas Schwab 2017-08-05 @47 dcbt 0,r7,0b01010 /* length and depth from */ 280a5ba2 Michael Neuling 2013-05-29 48 /* setup write stream 1 */ 8a583c0a Andreas Schwab 2017-08-05 49 dcbtst 0,r9,0b01000 /* addr to */ 8a583c0a Andreas Schwab 2017-08-05 50 dcbtst 0,r10,0b01010 /* length and depth to */ fde69282 Anton Blanchard 2012-05-29 51 eieio 8a583c0a Andreas Schwab 2017-08-05 52 dcbt 0,r8,0b01010 /* all streams GO */
fde69282 Anton Blanchard 2012-05-29 53
:::::: The code at line 46 was first introduced by commit
:::::: 8a583c0a8d316d8ea52ea78491174ab1a3e9ef9d powerpc: Fix invalid use of register expressions
:::::: TO: Andreas Schwab <[email protected]>
:::::: CC: Michael Ellerman <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Nicholas Piggin
reviewerRe: [PATCH 3/9] powerpc/64s: kbuild set assembler machine type to POWER4
So this shouldn't be built on BookE because it generates the wrong code for them. BookS CPUs are the only ones that set this FTR bit anyway.
Thanks,
Nick
Quoted 71 lines · On Wed, 21 Feb 2018 19:15:29 +0800 kbuild test robot <[email protected]> wrote:
Hi Nicholas,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.16-rc2 next-20180221]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-cpu-feature-and-kernel-build-stuff/20180221-132025 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-ppc64e_defconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpcAll errors (new ones prefixed by >>):
arch/powerpc/lib/copypage_power7.S: Assembler messages:Quoted 2 lines
Quoted 2 lines
arch/powerpc/lib/copypage_power7.S:46: Error: junk at end of line:0b01000' arch/powerpc/lib/copypage_power7.S:47: Error: junk at end of line:0b01010'
arch/powerpc/lib/copypage_power7.S:49: Error: junk at end of line:0b01000' arch/powerpc/lib/copypage_power7.S:50: Error: junk at end of line:0b01010'arch/powerpc/lib/copypage_power7.S:52: Error: junk at end of line: `0b01010'vim +46
arch/powerpc/lib/copypage_power7.Sfde69282 Anton Blanchard 2012-05-29 22 fde69282 Anton Blanchard 2012-05-29 23 _GLOBAL(copypage_power7) fde69282 Anton Blanchard 2012-05-29 24 /* fde69282 Anton Blanchard 2012-05-29 25 * We prefetch both the source and destination using enhanced touch fde69282 Anton Blanchard 2012-05-29 26 * instructions. We use a stream ID of 0 for the load side and fde69282 Anton Blanchard 2012-05-29 27 * 1 for the store side. Since source and destination are page fde69282 Anton Blanchard 2012-05-29 28 * aligned we don't need to clear the bottom 7 bits of either fde69282 Anton Blanchard 2012-05-29 29 * address. fde69282 Anton Blanchard 2012-05-29 30 */ 280a5ba2 Michael Neuling 2013-05-29 31 ori r9,r3,1 /* stream=1 => to */ fde69282 Anton Blanchard 2012-05-29 32 fde69282 Anton Blanchard 2012-05-29 33 #ifdef CONFIG_PPC_64K_PAGES 280a5ba2 Michael Neuling 2013-05-29 34 lis r7,0x0E01 /* depth=7 280a5ba2 Michael Neuling 2013-05-29 35 * units/cachelines=512 */ fde69282 Anton Blanchard 2012-05-29 36 #else fde69282 Anton Blanchard 2012-05-29 37 lis r7,0x0E00 /* depth=7 */ 280a5ba2 Michael Neuling 2013-05-29 38 ori r7,r7,0x1000 /* units/cachelines=32 */ fde69282 Anton Blanchard 2012-05-29 39 #endif fde69282 Anton Blanchard 2012-05-29 40 ori r10,r7,1 /* stream=1 */ fde69282 Anton Blanchard 2012-05-29 41 fde69282 Anton Blanchard 2012-05-29 42 lis r8,0x8000 /* GO=1 */ fde69282 Anton Blanchard 2012-05-29 43 clrldi r8,r8,32 fde69282 Anton Blanchard 2012-05-29 44 280a5ba2 Michael Neuling 2013-05-29 45 /* setup read stream 0 */ 8a583c0a Andreas Schwab 2017-08-05 @46 dcbt 0,r4,0b01000 /* addr from */ 8a583c0a Andreas Schwab 2017-08-05 @47 dcbt 0,r7,0b01010 /* length and depth from */ 280a5ba2 Michael Neuling 2013-05-29 48 /* setup write stream 1 */ 8a583c0a Andreas Schwab 2017-08-05 49 dcbtst 0,r9,0b01000 /* addr to */ 8a583c0a Andreas Schwab 2017-08-05 50 dcbtst 0,r10,0b01010 /* length and depth to */ fde69282 Anton Blanchard 2012-05-29 51 eieio 8a583c0a Andreas Schwab 2017-08-05 52 dcbt 0,r8,0b01010 /* all streams GO */
fde69282Anton Blanchard 2012-05-29 53:::::: The code at line 46 was first introduced by commit
::::::8a583c0a8d316d8ea52ea78491174ab1a3e9ef9dpowerpc: Fix invalid use of register expressions:::::: TO: Andreas Schwab <[email protected]>
:::::: CC: Michael Ellerman <[email protected]>---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [1/9] powerpc/64s: cputable add all POWER9 features to CPU_FTRS_ALWAYS
In reply to Nicholas PigginQuoted 1 line · Nicholas Piggin
Signed-off-by Nicholas Piggin <[email protected]>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/b842bd0f7a61b129a672f8b038325e
cheers