powerpc/mm: Add early_[cpu|mmu]_has_feature()
In later patches, we will be switching CPU and MMU feature checks to
use static keys.
For checks in early boot before jump label is initialized we need a
variant of [cpu|mmu]_has_feature() that doesn't use jump labels.
So create those called, unimaginatively, early_[cpu|mmu]_has_feature().
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index f413b32..08b4c06 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -135,11 +135,16 @@
0,
};
-static inline bool mmu_has_feature(unsigned long feature)
+static inline bool early_mmu_has_feature(unsigned long feature)
{
return !!(MMU_FTRS_POSSIBLE & cur_cpu_spec->mmu_features & feature);
}
+static inline bool mmu_has_feature(unsigned long feature)
+{
+ return early_mmu_has_feature(feature);
+}
+
static inline void mmu_clear_feature(unsigned long feature)
{
cur_cpu_spec->mmu_features &= ~feature;
@@ -168,11 +173,21 @@
{
return mmu_has_feature(MMU_FTR_TYPE_RADIX);
}
+
+static inline bool early_radix_enabled(void)
+{
+ return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
+}
#else
static inline bool radix_enabled(void)
{
return false;
}
+
+static inline bool early_radix_enabled(void)
+{
+ return false;
+}
#endif
#endif /* !__ASSEMBLY__ */