arm64: entry: Add fake CPU feature for unmapping the kernel at EL0
authorWill Deacon <will.deacon@arm.com>
Tue, 14 Nov 2017 14:38:19 +0000 (14:38 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:22:48 +0000 (20:22 +0100)
commit7fafcbb04f94d4709a5c8b7fb2c196b5bdf4fd7b
tree45d1902fa2d286839741a2bfb3298947ac4f191a
parent2843ade2dad2249900f508f61068d245921ce9f1
arm64: entry: Add fake CPU feature for unmapping the kernel at EL0

Commit ea1e3de85e94 upstream.

Allow explicit disabling of the entry trampoline on the kernel command
line (kpti=off) by adding a fake CPU feature (ARM64_UNMAP_KERNEL_AT_EL0)
that can be used to toggle the alternative sequences in our entry code and
avoid use of the trampoline altogether if desired. This also allows us to
make use of a static key in arm64_kernel_unmapped_at_el0().

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/mmu.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/entry.S