]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: spectre-v2: Favour CPU-specific mitigation at EL2
authorWill Deacon <will@kernel.org>
Tue, 20 Oct 2020 15:01:57 +0000 (16:01 +0100)
committerWill Deacon <will@kernel.org>
Tue, 20 Oct 2020 15:01:57 +0000 (16:01 +0100)
commitd3e9dd740be2c130a67e0634aabad4fba2250c12
tree4ea2c390058e54fb3b182d9518eda196e1e7db5e
parent6b6d51b5c46037c6ab1e8436f279e7e6b91ccea2
arm64: spectre-v2: Favour CPU-specific mitigation at EL2

Spectre-v2 can be mitigated on Falkor CPUs either by calling into
firmware or by issuing a magic, CPU-specific sequence of branches.
Although the latter is faster, the size of the code sequence means that
it cannot be used in the EL2 vectors, and so there is a need for both
mitigations to co-exist in order to achieve optimal performance.

Change the mitigation selection logic for Spectre-v2 so that the
CPU-specific mitigation is used only when the firmware mitigation is
also available, rather than when a firmware mitigation is unavailable.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/proton-pack.c