arm64: entry: Make the kpti trampoline's kpti sequence optional
authorJames Morse <james.morse@arm.com>
Thu, 18 Nov 2021 13:16:23 +0000 (13:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2022 11:22:34 +0000 (12:22 +0100)
commit6895584a92eeaa0702afc47c9758b7fca6345fec
treeae21fe05f71ba8650d448031bf1fda83a8588806
parenta40472d463f9ab6f971850989aa5a21f704b5cfd
arm64: entry: Make the kpti trampoline's kpti sequence optional

commit c47e4d04ba0f1ea17353d85d45f611277507e07a upstream.

Spectre-BHB needs to add sequences to the vectors. Having one global
set of vectors is a problem for big/little systems where the sequence
is costly on cpus that are not vulnerable.

Making the vectors per-cpu in the style of KVM's bh_harden_hyp_vecs
requires the vectors to be generated by macros.

Make the kpti re-mapping of the kernel optional, so the macros can be
used without kpti.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/entry.S