aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-12-02 08:48:59 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2023-12-02 08:48:59 +0900
commit35f84584806e4e127a667221c592f8ae248132f6 (patch)
tree5fabb6849edbacd9387fc9824831eec576d96e44
parentMerge tag 'iommu-fixes-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu (diff)
parentarm64: Avoid enabling KPTI unnecessarily (diff)
downloadwireguard-linux-35f84584806e4e127a667221c592f8ae248132f6.tar.xz
wireguard-linux-35f84584806e4e127a667221c592f8ae248132f6.zip
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fix from Catalin Marinas: "Fix a regression where the arm64 KPTI ends up enabled even on systems that don't need it" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Avoid enabling KPTI unnecessarily
Diffstat (limited to '')
-rw-r--r--arch/arm64/kernel/cpufeature.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 646591c67e7a..91d2d6714969 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1839,6 +1839,10 @@ static int __init __kpti_install_ng_mappings(void *__unused)
static void __init kpti_install_ng_mappings(void)
{
+ /* Check whether KPTI is going to be used */
+ if (!cpus_have_cap(ARM64_UNMAP_KERNEL_AT_EL0))
+ return;
+
/*
* We don't need to rewrite the page-tables if either we've done
* it already or we have KASLR enabled and therefore have not