powerpc: Use new CPU feature bit to select 2.06 tlbie
authorMichael Neuling <mikey@neuling.org>
Wed, 6 Apr 2011 18:23:29 +0000 (18:23 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 4 May 2011 05:19:26 +0000 (15:19 +1000)
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>
arch/powerpc/include/asm/feature-fixups.h
arch/powerpc/include/asm/mmu.h
arch/powerpc/mm/hash_native_64.c

index bdc0d6877bce5fa3b1c57d01ffef42abcc40715d..9a67a38bf7b94a3b443dc0b1428bf64b40b544aa 100644 (file)
@@ -146,6 +146,19 @@ label##5:                                                  \
 
 #ifndef __ASSEMBLY__
 
+#define ASM_FTR_IF(section_if, section_else, msk, val) \
+       stringify_in_c(BEGIN_FTR_SECTION)                       \
+       section_if "; "                                         \
+       stringify_in_c(FTR_SECTION_ELSE)                        \
+       section_else "; "                                       \
+       stringify_in_c(ALT_FTR_SECTION_END((msk), (val)))
+
+#define ASM_FTR_IFSET(section_if, section_else, msk)   \
+       ASM_FTR_IF(section_if, section_else, (msk), (msk))
+
+#define ASM_FTR_IFCLR(section_if, section_else, msk)   \
+       ASM_FTR_IF(section_if, section_else, (msk), 0)
+
 #define ASM_MMU_FTR_IF(section_if, section_else, msk, val)     \
        stringify_in_c(BEGIN_MMU_FTR_SECTION)                   \
        section_if "; "                                         \
index a39304b74f84cbe53f2164290dd0683dd3f8286f..4138b21ae80afeb216da9cf6b7ab1e5ca8247a3a 100644 (file)
  */
 #define MMU_FTR_NEED_DTLB_SW_LRU       ASM_CONST(0x00200000)
 
-/* This indicates that the processor uses the ISA 2.06 server tlbie
- * mnemonics
- */
-#define MMU_FTR_TLBIE_206              ASM_CONST(0x00400000)
-
 /* Enable use of TLB reservation.  Processor should support tlbsrx.
  * instruction and MAS0[WQ].
  */
 #define MMU_FTRS_PPC970                MMU_FTRS_POWER4
 #define MMU_FTRS_POWER5                MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
 #define MMU_FTRS_POWER6                MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
-#define MMU_FTRS_POWER7                MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | \
-                               MMU_FTR_TLBIE_206
+#define MMU_FTRS_POWER7                MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
 #define MMU_FTRS_CELL          MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
                                MMU_FTR_CI_LARGE_PAGE
 #define MMU_FTRS_PA6T          MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
index c23eef2b81a61f5a1beadc3c6322bcbd00593b43..dfd764896db07bd26255648ec60a465006061ad2 100644 (file)
@@ -50,9 +50,8 @@ static inline void __tlbie(unsigned long va, int psize, int ssize)
        case MMU_PAGE_4K:
                va &= ~0xffful;
                va |= ssize << 8;
-               asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0),
-                                              %2)
-                            : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206)
+               asm volatile(ASM_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0), %2)
+                            : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206)
                             : "memory");
                break;
        default:
@@ -61,9 +60,8 @@ static inline void __tlbie(unsigned long va, int psize, int ssize)
                va |= penc << 12;
                va |= ssize << 8;
                va |= 1; /* L */
-               asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0),
-                                              %2)
-                            : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206)
+               asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2)
+                            : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206)
                             : "memory");
                break;
        }