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)
committerHaibo Chen <haibo.chen@nxp.com>
Thu, 12 Apr 2018 10:46:28 +0000 (18:46 +0800)
commit353afc7b422d1d4fecce167678a03f34fdde5df6
treeb920b119100bda6ba999a0cc63e9f8af82737a04
parent1a49deab3121b3cd86addfdf5f8e1fd20812b94b
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: Alex Shi <alex.shi@linaro.org>
Conflicts:
no falkor in arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/bpi.S
arch/arm64/kernel/cpu_errata.c