arm64: Use the clearbhb instruction in mitigations
authorJames Morse <james.morse@arm.com>
Fri, 10 Dec 2021 14:32:56 +0000 (14:32 +0000)
committerJames Morse <james.morse@arm.com>
Thu, 24 Feb 2022 14:02:44 +0000 (14:02 +0000)
commit228a26b912287934789023b4132ba76065d9491c
tree67a41ff4b1f85a9f72239a7f213d1ff2279af0ac
parenta5905d6af492ee6a4a2205f0d550b3f931b03d03
arm64: Use the clearbhb instruction in mitigations

Future CPUs may implement a clearbhb instruction that is sufficient
to mitigate SpectreBHB. CPUs that implement this instruction, but
not CSV2.3 must be affected by Spectre-BHB.

Add support to use this instruction as the BHB mitigation on CPUs
that support it. The instruction is in the hint space, so it will
be treated by a NOP as older CPUs.

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>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/insn.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/vectors.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/entry.S
arch/arm64/kernel/image-vars.h
arch/arm64/kernel/proton-pack.c
arch/arm64/kvm/hyp/hyp-entry.S