aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/include/asm/mmu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
index 2a93d34cc0ca..1eec3971f0a9 100644
--- a/arch/arm64/include/asm/mmu.h
+++ b/arch/arm64/include/asm/mmu.h
@@ -47,11 +47,22 @@ static inline bool arm64_kernel_unmapped_at_el0(void)
static inline bool kaslr_requires_kpti(void)
{
bool tx1_bug;
+ u64 ftr;
if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE))
return false;
/*
+ * E0PD does a similar job to KPTI so can be used instead
+ * where available.
+ */
+ if (IS_ENABLED(CONFIG_ARM64_E0PD)) {
+ ftr = read_sysreg_s(SYS_ID_AA64MMFR2_EL1);
+ if ((ftr >> ID_AA64MMFR2_E0PD_SHIFT) & 0xf)
+ return false;
+ }
+
+ /*
* Systems affected by Cavium erratum 24756 are incompatible
* with KPTI.
*/