Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
3481800f
Unverified
Commit
3481800f
authored
Mar 20, 2019
by
Dimitris Papastamos
Committed by
GitHub
Mar 20, 2019
Browse files
Merge pull request #1887 from ambroise-arm/av/a76-cve
Cortex-A76: Optimize CVE_2018_3639 workaround
parents
5e5c77db
d0d115e2
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/cpus/aarch64/cortex_a76.S
View file @
3481800f
...
@@ -13,16 +13,13 @@
...
@@ -13,16 +13,13 @@
#include <plat_macros.S>
#include <plat_macros.S>
#include <services/arm_arch_svc.h>
#include <services/arm_arch_svc.h>
#if !DYNAMIC_WORKAROUND_CVE_2018_3639
#error Cortex A76 requires DYNAMIC_WORKAROUND_CVE_2018_3639=1
#endif
#define ESR_EL3_A64_SMC0 0x5e000000
#define ESR_EL3_A64_SMC0 0x5e000000
#define ESR_EL3_A32_SMC0 0x4e000000
#define ESR_EL3_A32_SMC0 0x4e000000
#if DYNAMIC_WORKAROUND_CVE_2018_3639
/
*
/
*
*
This
macro
applies
the
mitigation
for
CVE
-
2018
-
3639
.
*
This
macro
applies
the
mitigation
for
CVE
-
2018
-
3639
.
*
It
implements
a
fas
h
path
where
`
SMCCC_ARCH_WORKAROUND_2
`
*
It
implements
a
fas
t
path
where
`
SMCCC_ARCH_WORKAROUND_2
`
*
SMC
calls
from
a
lower
EL
running
in
AArch32
or
AArch64
*
SMC
calls
from
a
lower
EL
running
in
AArch32
or
AArch64
*
will
go
through
the
fast
and
return
early
.
*
will
go
through
the
fast
and
return
early
.
*
*
...
@@ -188,6 +185,7 @@ vector_entry cortex_a76_serror_aarch32
...
@@ -188,6 +185,7 @@ vector_entry cortex_a76_serror_aarch32
apply_cve_2018_3639_wa
_is_sync_exception
=
0
_esr_el3_val
=
ESR_EL3_A32_SMC0
apply_cve_2018_3639_wa
_is_sync_exception
=
0
_esr_el3_val
=
ESR_EL3_A32_SMC0
b
serror_aarch32
b
serror_aarch32
end_vector_entry
cortex_a76_serror_aarch32
end_vector_entry
cortex_a76_serror_aarch32
#endif /* DYNAMIC_WORKAROUND_CVE_2018_3639 */
/
*
--------------------------------------------------
/
*
--------------------------------------------------
*
Errata
Workaround
for
Cortex
A76
Errata
#
1073348
.
*
Errata
Workaround
for
Cortex
A76
Errata
#
1073348
.
...
@@ -320,8 +318,12 @@ func cortex_a76_reset_func
...
@@ -320,8 +318,12 @@ func cortex_a76_reset_func
mrs
x0
,
id_aa64pfr1_el1
mrs
x0
,
id_aa64pfr1_el1
lsr
x0
,
x0
,
#
ID_AA64PFR1_EL1_SSBS_SHIFT
lsr
x0
,
x0
,
#
ID_AA64PFR1_EL1_SSBS_SHIFT
and
x0
,
x0
,
#
ID_AA64PFR1_EL1_SSBS_MASK
and
x0
,
x0
,
#
ID_AA64PFR1_EL1_SSBS_MASK
#if !DYNAMIC_WORKAROUND_CVE_2018_3639 && ENABLE_ASSERTIONS
cmp
x0
,
0
ASM_ASSERT
(
ne
)
#endif
#if DYNAMIC_WORKAROUND_CVE_2018_3639
cbnz
x0
,
1
f
cbnz
x0
,
1
f
mrs
x0
,
CORTEX_A76_CPUACTLR2_EL1
mrs
x0
,
CORTEX_A76_CPUACTLR2_EL1
orr
x0
,
x0
,
#
CORTEX_A76_CPUACTLR2_EL1_DISABLE_LOAD_PASS_STORE
orr
x0
,
x0
,
#
CORTEX_A76_CPUACTLR2_EL1_DISABLE_LOAD_PASS_STORE
msr
CORTEX_A76_CPUACTLR2_EL1
,
x0
msr
CORTEX_A76_CPUACTLR2_EL1
,
x0
...
@@ -336,10 +338,11 @@ func cortex_a76_reset_func
...
@@ -336,10 +338,11 @@ func cortex_a76_reset_func
adr
x0
,
cortex_a76_wa_cve_2018_3639_a76_vbar
adr
x0
,
cortex_a76_wa_cve_2018_3639_a76_vbar
msr
vbar_el3
,
x0
msr
vbar_el3
,
x0
isb
isb
#endif
#endif
/* IMAGE_BL31 */
1
:
1
:
#endif
#endif /* DYNAMIC_WORKAROUND_CVE_2018_3639 */
#endif /* WORKAROUND_CVE_2018_3639 */
#if ERRATA_DSU_936184
#if ERRATA_DSU_936184
bl
errata_dsu_936184_wa
bl
errata_dsu_936184_wa
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment