]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kpti: Avoid rewriting early page tables when KASLR is enabled
authorWill Deacon <will.deacon@arm.com>
Tue, 8 Jan 2019 16:19:01 +0000 (16:19 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 10 Jan 2019 17:49:35 +0000 (17:49 +0000)
commit46a4faa0b72ce3f2d6e561f1a3376348a3a3f027
treeae9df3844e5cb08338a8945d4a4fb9547ba27e26
parentc54a24727388c097bab599563d395f30d4bc437c
arm64: kpti: Avoid rewriting early page tables when KASLR is enabled

A side effect of commit 438035387b8d ("arm64: mm: apply r/o permissions
of VM areas to its linear alias as well") is that the linear map is
created with page granularity, which means that transitioning the early
page table from global to non-global mappings when enabling kpti can
take a significant amount of time during boot.

Given that most CPU implementations do not require kpti, this mainly
impacts KASLR builds where kpti is forcefully enabled. However, in these
situations we know early on that non-global mappings are required and
can avoid the use of global mappings from the beginning. The only gotcha
is Cavium erratum #27456, which we must detect based on the MIDR value
of the boot CPU.

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reported-by: John Garry <john.garry@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/mmu.h
arch/arm64/include/asm/pgtable-prot.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/head.S