summaryrefslogtreecommitdiff
path: root/lib/cpus/aarch64/cortex_a72.S
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-03-12 13:27:02 +0000
committerDimitris Papastamos <dimitris.papastamos@arm.com>2018-03-14 11:15:44 +0000
commit3991a6a49f3cf8d0b30a2800428e60454e2f92dd (patch)
tree8af432a51fa27ca1dc415bffee189d50b03ce2c9 /lib/cpus/aarch64/cortex_a72.S
parent16b05e94a2d1757cbb98de068c662d58a6919613 (diff)
Use PFR0 to identify need for mitigation of CVE-2017-5715
If the CSV2 field reads as 1 then branch targets trained in one context cannot affect speculative execution in a different context. In that case skip the workaround on Cortex A72 and A73. Change-Id: Ide24fb6efc77c548e4296295adc38dca87d042ee Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Diffstat (limited to 'lib/cpus/aarch64/cortex_a72.S')
-rw-r--r--lib/cpus/aarch64/cortex_a72.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/cpus/aarch64/cortex_a72.S b/lib/cpus/aarch64/cortex_a72.S
index 9633aa8f..199820cc 100644
--- a/lib/cpus/aarch64/cortex_a72.S
+++ b/lib/cpus/aarch64/cortex_a72.S
@@ -98,12 +98,16 @@ func check_errata_859971
endfunc check_errata_859971
func check_errata_cve_2017_5715
+ cpu_check_csv2 x0, 1f
#if WORKAROUND_CVE_2017_5715
mov x0, #ERRATA_APPLIES
#else
mov x0, #ERRATA_MISSING
#endif
ret
+1:
+ mov x0, #ERRATA_NOT_APPLIES
+ ret
endfunc check_errata_cve_2017_5715
/* -------------------------------------------------
@@ -121,8 +125,10 @@ func cortex_a72_reset_func
#endif
#if IMAGE_BL31 && WORKAROUND_CVE_2017_5715
+ cpu_check_csv2 x0, 1f
adr x0, workaround_mmu_runtime_exceptions
msr vbar_el3, x0
+1:
#endif
/* ---------------------------------------------