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

powerpc: Use new CPU feature bit to select 2.06 tlbie

This removes MMU_FTR_TLBIE_206 as we can now use CPU_FTR_HVMODE_206. It
also changes the logic to select which tlbie to use to be based on this
new CPU feature bit.

This also duplicates the ASM_FTR_IF/SET/CLR defines for CPU features
(copied from MMU features).

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Michael Neuling and committed by
Benjamin Herrenschmidt
a32e252f 476eb491

+18 -13
+13
arch/powerpc/include/asm/feature-fixups.h
··· 146 146 147 147 #ifndef __ASSEMBLY__ 148 148 149 + #define ASM_FTR_IF(section_if, section_else, msk, val) \ 150 + stringify_in_c(BEGIN_FTR_SECTION) \ 151 + section_if "; " \ 152 + stringify_in_c(FTR_SECTION_ELSE) \ 153 + section_else "; " \ 154 + stringify_in_c(ALT_FTR_SECTION_END((msk), (val))) 155 + 156 + #define ASM_FTR_IFSET(section_if, section_else, msk) \ 157 + ASM_FTR_IF(section_if, section_else, (msk), (msk)) 158 + 159 + #define ASM_FTR_IFCLR(section_if, section_else, msk) \ 160 + ASM_FTR_IF(section_if, section_else, (msk), 0) 161 + 149 162 #define ASM_MMU_FTR_IF(section_if, section_else, msk, val) \ 150 163 stringify_in_c(BEGIN_MMU_FTR_SECTION) \ 151 164 section_if "; " \
+1 -7
arch/powerpc/include/asm/mmu.h
··· 56 56 */ 57 57 #define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000) 58 58 59 - /* This indicates that the processor uses the ISA 2.06 server tlbie 60 - * mnemonics 61 - */ 62 - #define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000) 63 - 64 59 /* Enable use of TLB reservation. Processor should support tlbsrx. 65 60 * instruction and MAS0[WQ]. 66 61 */ ··· 100 105 #define MMU_FTRS_PPC970 MMU_FTRS_POWER4 101 106 #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 102 107 #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 103 - #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | \ 104 - MMU_FTR_TLBIE_206 108 + #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 105 109 #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ 106 110 MMU_FTR_CI_LARGE_PAGE 107 111 #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
+4 -6
arch/powerpc/mm/hash_native_64.c
··· 50 50 case MMU_PAGE_4K: 51 51 va &= ~0xffful; 52 52 va |= ssize << 8; 53 - asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0), 54 - %2) 55 - : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206) 53 + asm volatile(ASM_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0), %2) 54 + : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206) 56 55 : "memory"); 57 56 break; 58 57 default: ··· 60 61 va |= penc << 12; 61 62 va |= ssize << 8; 62 63 va |= 1; /* L */ 63 - asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), 64 - %2) 65 - : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206) 64 + asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) 65 + : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206) 66 66 : "memory"); 67 67 break; 68 68 }