mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-13 08:04:27 +00:00

Align entire TF-A to use Arm in copyright header. Change-Id: Ief9992169efdab61d0da6bd8c5180de7a4bc2244 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
30 lines
691 B
ArmAsm
30 lines
691 B
ArmAsm
/*
|
|
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <context.h>
|
|
|
|
#if WORKAROUND_CVE_2022_23960
|
|
/*
|
|
* This macro applies the mitigation for CVE-2022-23960.
|
|
* The macro saves x2 to the CPU context.
|
|
* SP should point to the CPU context.
|
|
*/
|
|
.macro apply_cve_2022_23960_bhb_wa _bhb_loop_count
|
|
str x2, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X2]
|
|
|
|
/* CVE-BHB-NUM loop count */
|
|
mov x2, \_bhb_loop_count
|
|
|
|
1:
|
|
/* b pc+4 part of the workaround */
|
|
b 2f
|
|
2:
|
|
subs x2, x2, #1
|
|
bne 1b
|
|
speculation_barrier
|
|
ldr x2, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X2]
|
|
.endm
|
|
#endif /* WORKAROUND_CVE_2022_23960 */
|