Skip to content

Commit a8ed87c

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Add MMU_FTR_RADIX
We are going to add asm changes in the follow up patches. Add the feature bit now so that we can get it all build. mpe: When CONFIG_PPC_RADIX_MMU=n we omit MMU_FTR_RADIX from the MMU_FTRS_POSSIBLE mask. This allows the compiler to work out that those checks will always be false and so the code can be elided completely. Note we do *not* define MMU_FTR_RADIX to 0 in the RADIX_MMU=n case, because that doesn't work with the ASM_FTR patching. In particular an IF_SET section will result in a mask and value of zero, which is always true, meaning the section *won't* be patched, which is the opposite of what we want. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 773edea commit a8ed87c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

arch/powerpc/include/asm/book3s/64/mmu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ struct mmu_psize_def {
2323
};
2424
extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
2525

26-
#define radix_enabled() (0)
26+
#define radix_enabled() mmu_has_feature(MMU_FTR_RADIX)
27+
2728
#endif /* __ASSEMBLY__ */
2829

2930
/* 64-bit classic hash table MMU */

arch/powerpc/include/asm/mmu.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
*/
8989
#define MMU_FTR_1T_SEGMENT ASM_CONST(0x40000000)
9090

91+
/*
92+
* Radix page table available
93+
*/
94+
#define MMU_FTR_RADIX ASM_CONST(0x80000000)
95+
9196
/* MMU feature bit sets for various CPUs */
9297
#define MMU_FTRS_DEFAULT_HPTE_ARCH_V2 \
9398
MMU_FTR_HPTE_TABLE | MMU_FTR_PPCAS_ARCH_V2
@@ -119,7 +124,11 @@ enum {
119124
MMU_FTR_USE_TLBRSRV | MMU_FTR_USE_PAIRED_MAS |
120125
MMU_FTR_NO_SLBIE_B | MMU_FTR_16M_PAGE | MMU_FTR_TLBIEL |
121126
MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_CI_LARGE_PAGE |
122-
MMU_FTR_1T_SEGMENT,
127+
MMU_FTR_1T_SEGMENT |
128+
#ifdef CONFIG_PPC_RADIX_MMU
129+
MMU_FTR_RADIX |
130+
#endif
131+
0,
123132
};
124133

125134
static inline int mmu_has_feature(unsigned long feature)

0 commit comments

Comments
 (0)