]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Add initial support for E0PD
authorMark Brown <broonie@kernel.org>
Mon, 9 Dec 2019 18:12:14 +0000 (18:12 +0000)
committerWill Deacon <will@kernel.org>
Wed, 15 Jan 2020 14:11:02 +0000 (14:11 +0000)
commit199ce38abcc76e44eb088c9d0d4de56ec5d5d7ee
tree48e575bceafa45f0555586629c735419c6e50ba6
parent646cf7ee5f9780d038ddeb0aba0fbb1435cffff2
arm64: Add initial support for E0PD

Kernel Page Table Isolation (KPTI) is used to mitigate some speculation
based security issues by ensuring that the kernel is not mapped when
userspace is running but this approach is expensive and is incompatible
with SPE.  E0PD, introduced in the ARMv8.5 extensions, provides an
alternative to this which ensures that accesses from userspace to the
kernel's half of the memory map to always fault with constant time,
preventing timing attacks without requiring constant unmapping and
remapping or preventing legitimate accesses.

Currently this feature will only be enabled if all CPUs in the system
support E0PD, if some CPUs do not support the feature at boot time then
the feature will not be enabled and in the unlikely event that a late
CPU is the first CPU to lack the feature then we will reject that CPU.

This initial patch does not yet integrate with KPTI, this will be dealt
with in followup patches.  Ideally we could ensure that by default we
don't use KPTI on CPUs where E0PD is present.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
[will: Fixed typo in Kconfig text]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/Kconfig
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/cpufeature.c