diff options
author | Fabio Estevam <festevam@gmail.com> | 2018-07-12 14:45:03 -0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-08-10 08:05:11 +0200 |
commit | 293e7937317859764565cf01a82c255040ea95a9 (patch) | |
tree | 87b3b39463535793c4b7b03e2ac60f54887ebca5 /arch/arm/include | |
parent | 635c1f1838730d1f5674201384e4e859e1c6467d (diff) | |
download | barebox-293e7937317859764565cf01a82c255040ea95a9.tar.gz barebox-293e7937317859764565cf01a82c255040ea95a9.tar.xz |
mx5: Implement Spectre v2 workaround for Cortex-A8
Since 4.18-rc1 kernel the following warning is seen on i.MX51 and
i.MX53:
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
Implement the suggested workaround by setting the IBE bit in the
auxiliary control register, which allows the kernel to flush the
BTB properly.
Based on commit 7b37a9c732bf ("ARM: Introduce ability to enable ACR::IBE
on Cortex-A8 for CVE-2017-5715") from U-Boot.
With this patch applied the kernel now reports:
CPU0: Spectre v2: using BPIALL workaround
Tested on a imx51 babbage.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/errata.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/include/asm/errata.h b/arch/arm/include/asm/errata.h index 98137b557f..f020369916 100644 --- a/arch/arm/include/asm/errata.h +++ b/arch/arm/include/asm/errata.h @@ -86,3 +86,12 @@ static inline void enable_arm_errata_845369_war(void) "mcr p15, 0, r0, c15, c0, 1\n" ); } + +static inline void enable_arm_errata_cortexa8_enable_ibe(void) +{ + __asm__ __volatile__ ( + "mrc p15, 0, r0, c1, c0, 1\n" + "orr r0, r0, #1 << 6\n" + "mcr p15, 0, r0, c1, c0, 1\n" + ); +} |