OSDN Git Service

arm64: Implement branch predictor hardening for affected Cortex-A CPUs
authorMark Rutland <mark.rutland@arm.com>
Thu, 12 Apr 2018 11:11:21 +0000 (12:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Apr 2018 06:21:04 +0000 (08:21 +0200)
commitbad52d7979532b20bce7545c18fe7e443b7472f6
tree6746a813efac1ac2928d2224367ed3442ded5250
parent4bcf61fa86cd8bb150fe89be782ded66e5ff11c3
arm64: Implement branch predictor hardening for affected Cortex-A CPUs

From: Will Deacon <will.deacon@arm.com>

commit aa6acde65e03186b5add8151e1ffe36c3c62639b 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: Mark Rutland <mark.rutland@arm.com> [v4.9 backport]
Tested-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/bpi.S
arch/arm64/kernel/cpu_errata.c