]> git.ipfire.org Git - thirdparty/linux.git/commit
arm64/mm: Avoid ID mapping of kpti flag if it is no longer needed
authorArd Biesheuvel <ardb@kernel.org>
Fri, 1 Mar 2024 10:40:49 +0000 (11:40 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 1 Mar 2024 15:25:45 +0000 (15:25 +0000)
commit27f2b9fcddc76d542ac339febf2af55b67f610ca
tree83953c1630499dc1ebb3071877a5d9d151db37ea
parent3137db4c66bf70360ee7027af5c50662b3152046
arm64/mm: Avoid ID mapping of kpti flag if it is no longer needed

arm64_use_ng_mappings will be set to 'true' by the early boot code if it
decides to use non-global (nG) attributes for all kernel mappings,
typically when enabling KASLR on a system that does not implement E0PD.

In this case, the G-to-nG update routines are never called, and so there
is no reason to create the writable mapping of the associated status
flag in the ID map.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240301104046.1234309-6-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/mmu.c