arm64: Implement branch predictor hardening for affected Cortex-A CPUs
authorWill Deacon <will.deacon@arm.com>
Wed, 3 Jan 2018 12:46:21 +0000 (12:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:22:54 +0000 (20:22 +0100)
commit48993dfa1af8c719576a18c0e2ca1d611297e34e
tree061695c709fbb5ef5462ee2a34d8361d7574fca3
parent3317097b2b4affdd0b600ef0eb558a3e82964dc6
arm64: Implement branch predictor hardening for affected Cortex-A CPUs

Commit aa6acde65e03 upstream.

Cortex-A57, A72, A73 and A75 are susceptible to branch predictor aliasing
and can theoretically be attacked by malicious code.

This patch implements a PSCI-based mitigation for these CPUs when available.
The call into firmware will invalidate the branch predictor state, preventing
any malicious entries from affecting other victim contexts.

Co-developed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/bpi.S
arch/arm64/kernel/cpu_errata.c