diff options
author | Jayachandran C <jnair@caviumnetworks.com> | 2018-01-19 04:22:48 -0800 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-01-23 19:59:49 +0000 |
commit | 0ba2e29c7fc1d58a90fab614d41bf487e28e3840 (patch) | |
tree | 264d7397b3e7505f2f5c801c9d613242e0533227 /arch/arm64 | |
parent | f3d795d9b360523beca6d13ba64c2c532f601149 (diff) | |
download | linux-stable-0ba2e29c7fc1d58a90fab614d41bf487e28e3840.tar.gz linux-stable-0ba2e29c7fc1d58a90fab614d41bf487e28e3840.tar.bz2 linux-stable-0ba2e29c7fc1d58a90fab614d41bf487e28e3840.zip |
arm64: Turn on KPTI only on CPUs that need it
Whitelist Broadcom Vulcan/Cavium ThunderX2 processors in
unmap_kernel_at_el0(). These CPUs are not vulnerable to
CVE-2017-5754 and do not need KPTI when KASLR is off.
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/cpufeature.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 5612d6f46331..4b6f9051cf0c 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -868,6 +868,13 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) return true; + /* Don't force KPTI for CPUs that are not vulnerable */ + switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) { + case MIDR_CAVIUM_THUNDERX2: + case MIDR_BRCM_VULCAN: + return false; + } + /* Defer to CPU feature registers */ return !cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_CSV3_SHIFT); |