]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Don't use KPTI where we have E0PD
authorMark Brown <broonie@kernel.org>
Mon, 9 Dec 2019 18:12:16 +0000 (18:12 +0000)
committerWill Deacon <will@kernel.org>
Wed, 15 Jan 2020 14:11:17 +0000 (14:11 +0000)
commitfcf6c8e1c72d07e3a570792adaafe59728c51188
tree72896c750fc33399f9cf69ab2c358ce39d3140ac
parent6e0009b13e98033533d20b3a64bf926b464c8bb2
arm64: Don't use KPTI where we have E0PD

Since E0PD is intended to fulfil the same role as KPTI we don't need to
use KPTI on CPUs where E0PD is available, we can rely on E0PD instead.
Change the check that forces KPTI on when KASLR is enabled to check for
E0PD before doing so, CPUs with E0PD are not expected to be affected by
meltdown so should not need to enable KPTI for other reasons.

Since E0PD is a system capability we will still enable KPTI if any of
the CPUs in the system lacks E0PD, this will rewrite any global mappings
that were established in systems where some but not all CPUs support
E0PD.  We may transiently have a mix of global and non-global mappings
while booting since we use the local CPU when deciding if KPTI will be
required prior to completing CPU enumeration but any global mappings
will be converted to non-global ones when KPTI is applied.

KPTI can still be forced on from the command line if required.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/mmu.h