diff options
author | Anton Blanchard <anton@samba.org> | 2012-04-17 22:21:52 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-04-30 01:37:26 -0400 |
commit | 694caf0255dcab506d1e174c96a65ab65d96e108 (patch) | |
tree | b5bb6facfc517062c319c742b54c4fceffa56c9b | |
parent | 6cd3209967469f6e89d329deda6bb0b4700e7b62 (diff) |
powerpc: Remove CONFIG_POWER4_ONLY
Remove CONFIG_POWER4_ONLY, the option is badly named and only does two
things:
- It wraps the MMU segment table code. With feature fixups there is
little downside to compiling this in.
- It uses the newer mtocrf instruction in various assembly functions.
Instead of making this a compile option just do it at runtime via
a feature fixup.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/configs/g5_defconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/configs/maple_defconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/configs/pasemi_defconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/asm-compat.h | 11 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ppc_asm.h | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 4 | ||||
-rw-r--r-- | arch/powerpc/lib/copyuser_64.S | 6 | ||||
-rw-r--r-- | arch/powerpc/lib/mem_64.S | 6 | ||||
-rw-r--r-- | arch/powerpc/lib/memcpy_64.S | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 9 |
10 files changed, 19 insertions, 36 deletions
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig index 1196c34163b7..07b7f2af2dca 100644 --- a/arch/powerpc/configs/g5_defconfig +++ b/arch/powerpc/configs/g5_defconfig | |||
@@ -1,5 +1,4 @@ | |||
1 | CONFIG_PPC64=y | 1 | CONFIG_PPC64=y |
2 | CONFIG_POWER4_ONLY=y | ||
3 | CONFIG_ALTIVEC=y | 2 | CONFIG_ALTIVEC=y |
4 | CONFIG_SMP=y | 3 | CONFIG_SMP=y |
5 | CONFIG_NR_CPUS=4 | 4 | CONFIG_NR_CPUS=4 |
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig index 2244d370f24d..02ac96b679b8 100644 --- a/arch/powerpc/configs/maple_defconfig +++ b/arch/powerpc/configs/maple_defconfig | |||
@@ -1,5 +1,4 @@ | |||
1 | CONFIG_PPC64=y | 1 | CONFIG_PPC64=y |
2 | CONFIG_POWER4_ONLY=y | ||
3 | CONFIG_SMP=y | 2 | CONFIG_SMP=y |
4 | CONFIG_NR_CPUS=4 | 3 | CONFIG_NR_CPUS=4 |
5 | CONFIG_EXPERIMENTAL=y | 4 | CONFIG_EXPERIMENTAL=y |
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig index f4deb0b78cf0..840a2c2d0430 100644 --- a/arch/powerpc/configs/pasemi_defconfig +++ b/arch/powerpc/configs/pasemi_defconfig | |||
@@ -1,5 +1,4 @@ | |||
1 | CONFIG_PPC64=y | 1 | CONFIG_PPC64=y |
2 | CONFIG_POWER4_ONLY=y | ||
3 | CONFIG_ALTIVEC=y | 2 | CONFIG_ALTIVEC=y |
4 | # CONFIG_VIRT_CPU_ACCOUNTING is not set | 3 | # CONFIG_VIRT_CPU_ACCOUNTING is not set |
5 | CONFIG_SMP=y | 4 | CONFIG_SMP=y |
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h index decad950f11a..5d7fbe1950f9 100644 --- a/arch/powerpc/include/asm/asm-compat.h +++ b/arch/powerpc/include/asm/asm-compat.h | |||
@@ -29,18 +29,9 @@ | |||
29 | #define PPC_LLARX(t, a, b, eh) PPC_LDARX(t, a, b, eh) | 29 | #define PPC_LLARX(t, a, b, eh) PPC_LDARX(t, a, b, eh) |
30 | #define PPC_STLCX stringify_in_c(stdcx.) | 30 | #define PPC_STLCX stringify_in_c(stdcx.) |
31 | #define PPC_CNTLZL stringify_in_c(cntlzd) | 31 | #define PPC_CNTLZL stringify_in_c(cntlzd) |
32 | #define PPC_MTOCRF(FXM, RS) MTOCRF((FXM), (RS)) | ||
32 | #define PPC_LR_STKOFF 16 | 33 | #define PPC_LR_STKOFF 16 |
33 | #define PPC_MIN_STKFRM 112 | 34 | #define PPC_MIN_STKFRM 112 |
34 | |||
35 | /* Move to CR, single-entry optimized version. Only available | ||
36 | * on POWER4 and later. | ||
37 | */ | ||
38 | #ifdef CONFIG_POWER4_ONLY | ||
39 | #define PPC_MTOCRF stringify_in_c(mtocrf) | ||
40 | #else | ||
41 | #define PPC_MTOCRF stringify_in_c(mtcrf) | ||
42 | #endif | ||
43 | |||
44 | #else /* 32-bit */ | 35 | #else /* 32-bit */ |
45 | 36 | ||
46 | /* operations for longs and pointers */ | 37 | /* operations for longs and pointers */ |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 50f73aa2ba21..15444204a3a1 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -369,7 +369,15 @@ BEGIN_FTR_SECTION \ | |||
369 | END_FTR_SECTION_IFCLR(CPU_FTR_601) | 369 | END_FTR_SECTION_IFCLR(CPU_FTR_601) |
370 | #endif | 370 | #endif |
371 | 371 | ||
372 | 372 | #ifdef CONFIG_PPC64 | |
373 | #define MTOCRF(FXM, RS) \ | ||
374 | BEGIN_FTR_SECTION_NESTED(848); \ | ||
375 | mtcrf (FXM), (RS); \ | ||
376 | FTR_SECTION_ELSE_NESTED(848); \ | ||
377 | mtocrf (FXM), (RS); \ | ||
378 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_NOEXECUTE, 848) | ||
379 | #endif | ||
380 | |||
373 | /* | 381 | /* |
374 | * This instruction is not implemented on the PPC 603 or 601; however, on | 382 | * This instruction is not implemented on the PPC 603 or 601; however, on |
375 | * the 403GCX and 405GP tlbia IS defined and tlbie is not. | 383 | * the 403GCX and 405GP tlbia IS defined and tlbie is not. |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index cb705fdbb458..e0537693d660 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -94,12 +94,10 @@ machine_check_pSeries_1: | |||
94 | data_access_pSeries: | 94 | data_access_pSeries: |
95 | HMT_MEDIUM | 95 | HMT_MEDIUM |
96 | SET_SCRATCH0(r13) | 96 | SET_SCRATCH0(r13) |
97 | #ifndef CONFIG_POWER4_ONLY | ||
98 | BEGIN_FTR_SECTION | 97 | BEGIN_FTR_SECTION |
99 | b data_access_check_stab | 98 | b data_access_check_stab |
100 | data_access_not_stab: | 99 | data_access_not_stab: |
101 | END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB) | 100 | END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB) |
102 | #endif | ||
103 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD, | 101 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD, |
104 | KVMTEST, 0x300) | 102 | KVMTEST, 0x300) |
105 | 103 | ||
@@ -301,7 +299,6 @@ machine_check_fwnmi: | |||
301 | EXC_STD, KVMTEST, 0x200) | 299 | EXC_STD, KVMTEST, 0x200) |
302 | KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200) | 300 | KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200) |
303 | 301 | ||
304 | #ifndef CONFIG_POWER4_ONLY | ||
305 | /* moved from 0x300 */ | 302 | /* moved from 0x300 */ |
306 | data_access_check_stab: | 303 | data_access_check_stab: |
307 | GET_PACA(r13) | 304 | GET_PACA(r13) |
@@ -328,7 +325,6 @@ do_stab_bolted_pSeries: | |||
328 | GET_SCRATCH0(r10) | 325 | GET_SCRATCH0(r10) |
329 | std r10,PACA_EXSLB+EX_R13(r13) | 326 | std r10,PACA_EXSLB+EX_R13(r13) |
330 | EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD) | 327 | EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD) |
331 | #endif /* CONFIG_POWER4_ONLY */ | ||
332 | 328 | ||
333 | KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300) | 329 | KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300) |
334 | KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380) | 330 | KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380) |
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S index 773d38f90aaa..d73a59014900 100644 --- a/arch/powerpc/lib/copyuser_64.S +++ b/arch/powerpc/lib/copyuser_64.S | |||
@@ -30,7 +30,7 @@ _GLOBAL(__copy_tofrom_user_base) | |||
30 | dcbt 0,r4 | 30 | dcbt 0,r4 |
31 | beq .Lcopy_page_4K | 31 | beq .Lcopy_page_4K |
32 | andi. r6,r6,7 | 32 | andi. r6,r6,7 |
33 | PPC_MTOCRF 0x01,r5 | 33 | PPC_MTOCRF(0x01,r5) |
34 | blt cr1,.Lshort_copy | 34 | blt cr1,.Lshort_copy |
35 | /* Below we want to nop out the bne if we're on a CPU that has the | 35 | /* Below we want to nop out the bne if we're on a CPU that has the |
36 | * CPU_FTR_UNALIGNED_LD_STD bit set and the CPU_FTR_CP_USE_DCBTZ bit | 36 | * CPU_FTR_UNALIGNED_LD_STD bit set and the CPU_FTR_CP_USE_DCBTZ bit |
@@ -186,7 +186,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
186 | blr | 186 | blr |
187 | 187 | ||
188 | .Ldst_unaligned: | 188 | .Ldst_unaligned: |
189 | PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ | 189 | PPC_MTOCRF(0x01,r6) /* put #bytes to 8B bdry into cr7 */ |
190 | subf r5,r6,r5 | 190 | subf r5,r6,r5 |
191 | li r7,0 | 191 | li r7,0 |
192 | cmpldi cr1,r5,16 | 192 | cmpldi cr1,r5,16 |
@@ -201,7 +201,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
201 | 2: bf cr7*4+1,3f | 201 | 2: bf cr7*4+1,3f |
202 | 37: lwzx r0,r7,r4 | 202 | 37: lwzx r0,r7,r4 |
203 | 83: stwx r0,r7,r3 | 203 | 83: stwx r0,r7,r3 |
204 | 3: PPC_MTOCRF 0x01,r5 | 204 | 3: PPC_MTOCRF(0x01,r5) |
205 | add r4,r6,r4 | 205 | add r4,r6,r4 |
206 | add r3,r6,r3 | 206 | add r3,r6,r3 |
207 | b .Ldst_aligned | 207 | b .Ldst_aligned |
diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S index 11ce045e21fd..f4fcb0bc6563 100644 --- a/arch/powerpc/lib/mem_64.S +++ b/arch/powerpc/lib/mem_64.S | |||
@@ -19,7 +19,7 @@ _GLOBAL(memset) | |||
19 | rlwimi r4,r4,16,0,15 | 19 | rlwimi r4,r4,16,0,15 |
20 | cmplw cr1,r5,r0 /* do we get that far? */ | 20 | cmplw cr1,r5,r0 /* do we get that far? */ |
21 | rldimi r4,r4,32,0 | 21 | rldimi r4,r4,32,0 |
22 | PPC_MTOCRF 1,r0 | 22 | PPC_MTOCRF(1,r0) |
23 | mr r6,r3 | 23 | mr r6,r3 |
24 | blt cr1,8f | 24 | blt cr1,8f |
25 | beq+ 3f /* if already 8-byte aligned */ | 25 | beq+ 3f /* if already 8-byte aligned */ |
@@ -49,7 +49,7 @@ _GLOBAL(memset) | |||
49 | bdnz 4b | 49 | bdnz 4b |
50 | 5: srwi. r0,r5,3 | 50 | 5: srwi. r0,r5,3 |
51 | clrlwi r5,r5,29 | 51 | clrlwi r5,r5,29 |
52 | PPC_MTOCRF 1,r0 | 52 | PPC_MTOCRF(1,r0) |
53 | beq 8f | 53 | beq 8f |
54 | bf 29,6f | 54 | bf 29,6f |
55 | std r4,0(r6) | 55 | std r4,0(r6) |
@@ -65,7 +65,7 @@ _GLOBAL(memset) | |||
65 | std r4,0(r6) | 65 | std r4,0(r6) |
66 | addi r6,r6,8 | 66 | addi r6,r6,8 |
67 | 8: cmpwi r5,0 | 67 | 8: cmpwi r5,0 |
68 | PPC_MTOCRF 1,r5 | 68 | PPC_MTOCRF(1,r5) |
69 | beqlr+ | 69 | beqlr+ |
70 | bf 29,9f | 70 | bf 29,9f |
71 | stw r4,0(r6) | 71 | stw r4,0(r6) |
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S index e178922b2c21..82fea3963e15 100644 --- a/arch/powerpc/lib/memcpy_64.S +++ b/arch/powerpc/lib/memcpy_64.S | |||
@@ -12,7 +12,7 @@ | |||
12 | .align 7 | 12 | .align 7 |
13 | _GLOBAL(memcpy) | 13 | _GLOBAL(memcpy) |
14 | std r3,48(r1) /* save destination pointer for return value */ | 14 | std r3,48(r1) /* save destination pointer for return value */ |
15 | PPC_MTOCRF 0x01,r5 | 15 | PPC_MTOCRF(0x01,r5) |
16 | cmpldi cr1,r5,16 | 16 | cmpldi cr1,r5,16 |
17 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry | 17 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry |
18 | andi. r6,r6,7 | 18 | andi. r6,r6,7 |
@@ -154,7 +154,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
154 | blr | 154 | blr |
155 | 155 | ||
156 | .Ldst_unaligned: | 156 | .Ldst_unaligned: |
157 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 | 157 | PPC_MTOCRF(0x01,r6) # put #bytes to 8B bdry into cr7 |
158 | subf r5,r6,r5 | 158 | subf r5,r6,r5 |
159 | li r7,0 | 159 | li r7,0 |
160 | cmpldi cr1,r5,16 | 160 | cmpldi cr1,r5,16 |
@@ -169,7 +169,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
169 | 2: bf cr7*4+1,3f | 169 | 2: bf cr7*4+1,3f |
170 | lwzx r0,r7,r4 | 170 | lwzx r0,r7,r4 |
171 | stwx r0,r7,r3 | 171 | stwx r0,r7,r3 |
172 | 3: PPC_MTOCRF 0x01,r5 | 172 | 3: PPC_MTOCRF(0x01,r5) |
173 | add r4,r6,r4 | 173 | add r4,r6,r4 |
174 | add r3,r6,r3 | 174 | add r3,r6,r3 |
175 | b .Ldst_aligned | 175 | b .Ldst_aligned |
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 425db18580a2..52e70f9b7a8f 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -86,15 +86,6 @@ config PPC_BOOK3E | |||
86 | def_bool y | 86 | def_bool y |
87 | depends on PPC_BOOK3E_64 | 87 | depends on PPC_BOOK3E_64 |
88 | 88 | ||
89 | config POWER4_ONLY | ||
90 | bool "Optimize for POWER4" | ||
91 | depends on PPC64 && PPC_BOOK3S | ||
92 | default n | ||
93 | ---help--- | ||
94 | Cause the compiler to optimize for POWER4/POWER5/PPC970 processors. | ||
95 | The resulting binary will not work on POWER3 or RS64 processors | ||
96 | when compiled with binutils 2.15 or later. | ||
97 | |||
98 | config 6xx | 89 | config 6xx |
99 | def_bool y | 90 | def_bool y |
100 | depends on PPC32 && PPC_BOOK3S | 91 | depends on PPC32 && PPC_BOOK3S |