From 76a1a5378031e56d29d16c713aee73c6747c3e61 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 21 Dec 2020 07:29:41 +0100 Subject: bsps/arm: Invalidate branch predictors earlier Make sure the branch predictors are invalidated before the first branch is executed. Update #4202. --- bsps/arm/shared/start/start.S | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bsps/arm/shared/start/start.S') diff --git a/bsps/arm/shared/start/start.S b/bsps/arm/shared/start/start.S index 9ebc2818e5..f4880dfcf0 100644 --- a/bsps/arm/shared/start/start.S +++ b/bsps/arm/shared/start/start.S @@ -181,6 +181,17 @@ _start: mov r13, #0 #endif +#if __ARM_ARCH >= 7 + /* + * Write to BPIALL (Branch Predictor Invalidate All) to invalidate all + * branch predictors. There is no need to use BPIALLIS (Branch + * Predictor Invalidate All, Inner Shareable) since this code is + * executed on all processors used by RTEMS. + */ + mov r0, #0 + mcr p15, 0, r0, c7, c5, 6 +#endif + #ifdef RTEMS_SMP /* Read MPIDR and get current processor index */ mrc p15, 0, r7, c0, c0, 5 -- cgit v1.2.3