UPSTREAM: arm64: entry: Add fake CPU feature for unmapping the kernel at EL0

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>
(cherry picked from commit ea1e3de85e94d711f63437c04624aa0e8de5c8b3)

[toddpoynor@google.com: fixup context, cpus_have_const_cap ->
cpus_have_cap]
Change-Id: I72936d608b0d4c0dd9725eced7674b95e4abcf2d
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Git-commit: f79ff2d82888428c2b0f7dbdedce553313156fae
Git-repo: https://android.googlesource.com/kernel/common/
[ckadabi@codeaurora.org: Update ARM64_NCAPS and ARM64_UNMAP_KERNEL_AT_EL0
values based on current supported capabilities]
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
4 files changed