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
e729595f
Commit
e729595f
authored
Apr 07, 2021
by
Olivier Deprez
Committed by
TrustedFirmware Code Review
Apr 07, 2021
Browse files
Merge "Fix: Remove save/restore of EL2 timer registers" into integration
parents
f0d84287
a7cf2743
Changes
2
Show whitespace changes
Inline
Side-by-side
include/lib/el3_runtime/aarch64/context.h
View file @
e729595f
...
@@ -160,86 +160,74 @@
...
@@ -160,86 +160,74 @@
#define CTX_AFSR1_EL2 U(0x10)
#define CTX_AFSR1_EL2 U(0x10)
#define CTX_AMAIR_EL2 U(0x18)
#define CTX_AMAIR_EL2 U(0x18)
#define CTX_CNTHCTL_EL2 U(0x20)
#define CTX_CNTHCTL_EL2 U(0x20)
#define CTX_CNTHP_CTL_EL2 U(0x28)
#define CTX_CNTVOFF_EL2 U(0x28)
#define CTX_CNTHP_CVAL_EL2 U(0x30)
#define CTX_CPTR_EL2 U(0x30)
#define CTX_CNTHP_TVAL_EL2 U(0x38)
#define CTX_DBGVCR32_EL2 U(0x38)
#define CTX_CNTVOFF_EL2 U(0x40)
#define CTX_ELR_EL2 U(0x40)
#define CTX_CPTR_EL2 U(0x48)
#define CTX_ESR_EL2 U(0x48)
#define CTX_DBGVCR32_EL2 U(0x50)
#define CTX_FAR_EL2 U(0x50)
#define CTX_ELR_EL2 U(0x58)
#define CTX_HACR_EL2 U(0x58)
#define CTX_ESR_EL2 U(0x60)
#define CTX_HCR_EL2 U(0x60)
#define CTX_FAR_EL2 U(0x68)
#define CTX_HPFAR_EL2 U(0x68)
#define CTX_HACR_EL2 U(0x70)
#define CTX_HSTR_EL2 U(0x70)
#define CTX_HCR_EL2 U(0x78)
#define CTX_ICC_SRE_EL2 U(0x78)
#define CTX_HPFAR_EL2 U(0x80)
#define CTX_ICH_HCR_EL2 U(0x80)
#define CTX_HSTR_EL2 U(0x88)
#define CTX_ICH_VMCR_EL2 U(0x88)
#define CTX_ICC_SRE_EL2 U(0x90)
#define CTX_MAIR_EL2 U(0x90)
#define CTX_ICH_HCR_EL2 U(0x98)
#define CTX_MDCR_EL2 U(0x98)
#define CTX_ICH_VMCR_EL2 U(0xa0)
#define CTX_PMSCR_EL2 U(0xa0)
#define CTX_MAIR_EL2 U(0xa8)
#define CTX_SCTLR_EL2 U(0xa8)
#define CTX_MDCR_EL2 U(0xb0)
#define CTX_SPSR_EL2 U(0xb0)
#define CTX_PMSCR_EL2 U(0xb8)
#define CTX_SP_EL2 U(0xb8)
#define CTX_SCTLR_EL2 U(0xc0)
#define CTX_TCR_EL2 U(0xc0)
#define CTX_SPSR_EL2 U(0xc8)
#define CTX_TPIDR_EL2 U(0xc8)
#define CTX_SP_EL2 U(0xd0)
#define CTX_TTBR0_EL2 U(0xd0)
#define CTX_TCR_EL2 U(0xd8)
#define CTX_VBAR_EL2 U(0xd8)
#define CTX_TPIDR_EL2 U(0xe0)
#define CTX_VMPIDR_EL2 U(0xe0)
#define CTX_TTBR0_EL2 U(0xe8)
#define CTX_VPIDR_EL2 U(0xe8)
#define CTX_VBAR_EL2 U(0xf0)
#define CTX_VTCR_EL2 U(0xf0)
#define CTX_VMPIDR_EL2 U(0xf8)
#define CTX_VTTBR_EL2 U(0xf8)
#define CTX_VPIDR_EL2 U(0x100)
#define CTX_VTCR_EL2 U(0x108)
#define CTX_VTTBR_EL2 U(0x110)
// Only if MTE registers in use
// Only if MTE registers in use
#define CTX_TFSR_EL2 U(0x1
18
)
#define CTX_TFSR_EL2 U(0x1
00
)
// Only if ENABLE_MPAM_FOR_LOWER_ELS==1
// Only if ENABLE_MPAM_FOR_LOWER_ELS==1
#define CTX_MPAM2_EL2 U(0x1
2
0)
#define CTX_MPAM2_EL2 U(0x10
8
)
#define CTX_MPAMHCR_EL2 U(0x1
28
)
#define CTX_MPAMHCR_EL2 U(0x1
10
)
#define CTX_MPAMVPM0_EL2 U(0x1
30
)
#define CTX_MPAMVPM0_EL2 U(0x1
18
)
#define CTX_MPAMVPM1_EL2 U(0x1
38
)
#define CTX_MPAMVPM1_EL2 U(0x1
20
)
#define CTX_MPAMVPM2_EL2 U(0x1
40
)
#define CTX_MPAMVPM2_EL2 U(0x1
28
)
#define CTX_MPAMVPM3_EL2 U(0x1
48
)
#define CTX_MPAMVPM3_EL2 U(0x1
30
)
#define CTX_MPAMVPM4_EL2 U(0x1
50
)
#define CTX_MPAMVPM4_EL2 U(0x1
38
)
#define CTX_MPAMVPM5_EL2 U(0x1
58
)
#define CTX_MPAMVPM5_EL2 U(0x1
40
)
#define CTX_MPAMVPM6_EL2 U(0x1
60
)
#define CTX_MPAMVPM6_EL2 U(0x1
48
)
#define CTX_MPAMVPM7_EL2 U(0x1
68
)
#define CTX_MPAMVPM7_EL2 U(0x1
50
)
#define CTX_MPAMVPMV_EL2 U(0x1
70
)
#define CTX_MPAMVPMV_EL2 U(0x1
58
)
// Starting with Armv8.6
// Starting with Armv8.6
#define CTX_HAFGRTR_EL2 U(0x1
78
)
#define CTX_HAFGRTR_EL2 U(0x1
60
)
#define CTX_HDFGRTR_EL2 U(0x18
0
)
#define CTX_HDFGRTR_EL2 U(0x1
6
8)
#define CTX_HDFGWTR_EL2 U(0x1
88
)
#define CTX_HDFGWTR_EL2 U(0x1
70
)
#define CTX_HFGITR_EL2 U(0x1
90
)
#define CTX_HFGITR_EL2 U(0x1
78
)
#define CTX_HFGRTR_EL2 U(0x1
9
8)
#define CTX_HFGRTR_EL2 U(0x18
0
)
#define CTX_HFGWTR_EL2 U(0x1
a0
)
#define CTX_HFGWTR_EL2 U(0x1
88
)
#define CTX_CNTPOFF_EL2 U(0x1
a8
)
#define CTX_CNTPOFF_EL2 U(0x1
90
)
// Starting with Armv8.4
// Starting with Armv8.4
#define CTX_CNTHPS_CTL_EL2 U(0x1b0)
#define CTX_CONTEXTIDR_EL2 U(0x198)
#define CTX_CNTHPS_CVAL_EL2 U(0x1b8)
#define CTX_SDER32_EL2 U(0x1a0)
#define CTX_CNTHPS_TVAL_EL2 U(0x1c0)
#define CTX_TTBR1_EL2 U(0x1a8)
#define CTX_CNTHVS_CTL_EL2 U(0x1c8)
#define CTX_VDISR_EL2 U(0x1b0)
#define CTX_CNTHVS_CVAL_EL2 U(0x1d0)
#define CTX_VNCR_EL2 U(0x1b8)
#define CTX_CNTHVS_TVAL_EL2 U(0x1d8)
#define CTX_VSESR_EL2 U(0x1c0)
#define CTX_CNTHV_CTL_EL2 U(0x1e0)
#define CTX_VSTCR_EL2 U(0x1c8)
#define CTX_CNTHV_CVAL_EL2 U(0x1e8)
#define CTX_VSTTBR_EL2 U(0x1d0)
#define CTX_CNTHV_TVAL_EL2 U(0x1f0)
#define CTX_TRFCR_EL2 U(0x1d8)
#define CTX_CONTEXTIDR_EL2 U(0x1f8)
#define CTX_SDER32_EL2 U(0x200)
#define CTX_TTBR1_EL2 U(0x208)
#define CTX_VDISR_EL2 U(0x210)
#define CTX_VNCR_EL2 U(0x218)
#define CTX_VSESR_EL2 U(0x220)
#define CTX_VSTCR_EL2 U(0x228)
#define CTX_VSTTBR_EL2 U(0x230)
#define CTX_TRFCR_EL2 U(0x238)
// Starting with Armv8.5
// Starting with Armv8.5
#define CTX_SCXTNUM_EL2 U(0x
24
0)
#define CTX_SCXTNUM_EL2 U(0x
1e
0)
/* Align to the next 16 byte boundary */
/* Align to the next 16 byte boundary */
#define CTX_EL2_SYSREGS_END U(0x
25
0)
#define CTX_EL2_SYSREGS_END U(0x
1f
0)
#endif
/* CTX_INCLUDE_EL2_REGS */
#endif
/* CTX_INCLUDE_EL2_REGS */
...
...
lib/el3_runtime/aarch64/context.S
View file @
e729595f
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
/*
-----------------------------------------------------
/*
-----------------------------------------------------
*
The
following
function
strictly
follows
the
AArch64
*
The
following
function
strictly
follows
the
AArch64
*
PCS
to
use
x9
-
x1
7
(
temporary
caller
-
saved
registers
)
*
PCS
to
use
x9
-
x1
6
(
temporary
caller
-
saved
registers
)
*
to
save
EL2
system
register
context
.
It
assumes
that
*
to
save
EL2
system
register
context
.
It
assumes
that
*
'x0'
is
pointing
to
a
'el2_sys_regs'
structure
where
*
'x0'
is
pointing
to
a
'el2_sys_regs'
structure
where
*
the
register
context
will
be
saved
.
*
the
register
context
will
be
saved
.
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
*
ICH_LR
<
n
>
_EL2
*
ICH_LR
<
n
>
_EL2
*
-----------------------------------------------------
*
-----------------------------------------------------
*/
*/
func
el2_sysregs_context_save
func
el2_sysregs_context_save
mrs
x9
,
actlr_el2
mrs
x9
,
actlr_el2
mrs
x10
,
afsr0_el2
mrs
x10
,
afsr0_el2
...
@@ -54,185 +53,153 @@ func el2_sysregs_context_save
...
@@ -54,185 +53,153 @@ func el2_sysregs_context_save
stp
x11
,
x12
,
[
x0
,
#
CTX_AFSR1_EL2
]
stp
x11
,
x12
,
[
x0
,
#
CTX_AFSR1_EL2
]
mrs
x13
,
cnthctl_el2
mrs
x13
,
cnthctl_el2
mrs
x14
,
cnt
hp_ctl
_el2
mrs
x14
,
cnt
voff
_el2
stp
x13
,
x14
,
[
x0
,
#
CTX_CNTHCTL_EL2
]
stp
x13
,
x14
,
[
x0
,
#
CTX_CNTHCTL_EL2
]
mrs
x15
,
cnthp_cval_el2
mrs
x15
,
cptr_el2
mrs
x16
,
cnthp_tval_el2
str
x15
,
[
x0
,
#
CTX_CPTR_EL2
]
stp
x15
,
x16
,
[
x0
,
#
CTX_CNTHP_CVAL_EL2
]
mrs
x17
,
cntvoff_el2
mrs
x9
,
cptr_el2
stp
x17
,
x9
,
[
x0
,
#
CTX_CNTVOFF_EL2
]
mrs
x11
,
elr_el2
#if CTX_INCLUDE_AARCH32_REGS
#if CTX_INCLUDE_AARCH32_REGS
mrs
x10
,
dbgvcr32_el2
mrs
x16
,
dbgvcr32_el2
stp
x10
,
x11
,
[
x0
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_ctl_el2
mrs
x12
,
contextidr_el2
mrs
x10
,
cnthps_cval_el2
str
x12
,
[
x0
,
#
CTX_CONTEXTIDR_EL2
]
stp
x9
,
x10
,
[
x0
,
#
CTX_CNTHPS_CTL_EL2
]
mrs
x11
,
cnthps_tval_el2
mrs
x12
,
cnthvs_ctl_el2
stp
x11
,
x12
,
[
x0
,
#
CTX_CNTHPS_TVAL_EL2
]
mrs
x13
,
cnthvs_cval_el2
mrs
x14
,
cnthvs_tval_el2
stp
x13
,
x14
,
[
x0
,
#
CTX_CNTHVS_CVAL_EL2
]
mrs
x15
,
cnthv_ctl_el2
mrs
x16
,
cnthv_cval_el2
stp
x15
,
x16
,
[
x0
,
#
CTX_CNTHV_CTL_EL2
]
mrs
x17
,
cnthv_tval_el2
mrs
x9
,
contextidr_el2
stp
x17
,
x9
,
[
x0
,
#
CTX_CNTHV_TVAL_EL2
]
#if CTX_INCLUDE_AARCH32_REGS
#if CTX_INCLUDE_AARCH32_REGS
mrs
x1
0
,
sder32_el2
mrs
x1
3
,
sder32_el2
str
x1
0
,
[
x0
,
#
CTX_SDER32_EL2
]
str
x1
3
,
[
x0
,
#
CTX_SDER32_EL2
]
#endif
#endif
mrs
x14
,
ttbr1_el2
mrs
x11
,
ttbr1_el2
mrs
x15
,
vdisr_el2
str
x11
,
[
x0
,
#
CTX_TTBR1_EL2
]
stp
x14
,
x15
,
[
x0
,
#
CTX_TTBR1_EL2
]
mrs
x12
,
vdisr_el2
str
x12
,
[
x0
,
#
CTX_VDISR_EL2
]
#if CTX_INCLUDE_NEVE_REGS
#if CTX_INCLUDE_NEVE_REGS
mrs
x1
3
,
vncr_el2
mrs
x1
6
,
vncr_el2
str
x1
3
,
[
x0
,
#
CTX_VNCR_EL2
]
str
x1
6
,
[
x0
,
#
CTX_VNCR_EL2
]
#endif
#endif
mrs
x14
,
vsesr_el2
mrs
x9
,
vsesr_el2
str
x14
,
[
x0
,
#
CTX_VSESR_EL2
]
mrs
x10
,
vstcr_el2
stp
x9
,
x10
,
[
x0
,
#
CTX_VSESR_EL2
]
mrs
x15
,
vstcr_el2
str
x15
,
[
x0
,
#
CTX_VSTCR_EL2
]
mrs
x16
,
vsttbr_el2
mrs
x11
,
vsttbr_el2
str
x16
,
[
x0
,
#
CTX_VSTTBR_EL2
]
mrs
x12
,
TRFCR_EL2
stp
x11
,
x12
,
[
x0
,
#
CTX_VSTTBR_EL2
]
mrs
x17
,
TRFCR_EL2
str
x17
,
[
x0
,
#
CTX_TRFCR_EL2
]
#endif
#endif
#if ARM_ARCH_AT_LEAST(8, 5)
#if ARM_ARCH_AT_LEAST(8, 5)
mrs
x
9
,
scxtnum_el2
mrs
x
13
,
scxtnum_el2
str
x
9
,
[
x0
,
#
CTX_SCXTNUM_EL2
]
str
x
13
,
[
x0
,
#
CTX_SCXTNUM_EL2
]
#endif
#endif
ret
ret
endfunc
el2_sysregs_context_save
endfunc
el2_sysregs_context_save
/*
-----------------------------------------------------
/*
-----------------------------------------------------
*
The
following
function
strictly
follows
the
AArch64
*
The
following
function
strictly
follows
the
AArch64
*
PCS
to
use
x9
-
x1
7
(
temporary
caller
-
saved
registers
)
*
PCS
to
use
x9
-
x1
6
(
temporary
caller
-
saved
registers
)
*
to
restore
EL2
system
register
context
.
It
assumes
*
to
restore
EL2
system
register
context
.
It
assumes
*
that
'x0'
is
pointing
to
a
'el2_sys_regs'
structure
*
that
'x0'
is
pointing
to
a
'el2_sys_regs'
structure
*
from
where
the
register
context
will
be
restored
*
from
where
the
register
context
will
be
restored
...
@@ -246,7 +213,6 @@ endfunc el2_sysregs_context_save
...
@@ -246,7 +213,6 @@ endfunc el2_sysregs_context_save
*
-----------------------------------------------------
*
-----------------------------------------------------
*/
*/
func
el2_sysregs_context_restore
func
el2_sysregs_context_restore
ldp
x9
,
x10
,
[
x0
,
#
CTX_ACTLR_EL2
]
ldp
x9
,
x10
,
[
x0
,
#
CTX_ACTLR_EL2
]
msr
actlr_el2
,
x9
msr
actlr_el2
,
x9
msr
afsr0_el2
,
x10
msr
afsr0_el2
,
x10
...
@@ -257,74 +223,66 @@ func el2_sysregs_context_restore
...
@@ -257,74 +223,66 @@ func el2_sysregs_context_restore
ldp
x13
,
x14
,
[
x0
,
#
CTX_CNTHCTL_EL2
]
ldp
x13
,
x14
,
[
x0
,
#
CTX_CNTHCTL_EL2
]
msr
cnthctl_el2
,
x13
msr
cnthctl_el2
,
x13
msr
cnthp_ctl_el2
,
x14
msr
cntvoff_el2
,
x14
ldp
x15
,
x16
,
[
x0
,
#
CTX_CNTHP_CVAL_EL2
]
msr
cnthp_cval_el2
,
x15
msr
cnthp_tval_el2
,
x16
ldp
x17
,
x9
,
[
x0
,
#
CTX_CNTVOFF_EL2
]
ldr
x15
,
[
x0
,
#
CTX_CPTR_EL2
]
msr
cntvoff_el2
,
x17
msr
cptr_el2
,
x15
msr
cptr_el2
,
x9
#if CTX_INCLUDE_AARCH32_REGS
#if CTX_INCLUDE_AARCH32_REGS
ldp
x10
,
x11
,
[
x0
,
#
CTX_DBGVCR32_EL2
]
ldr
x16
,
[
x0
,
#
CTX_DBGVCR32_EL2
]
msr
dbgvcr32_el2
,
x10
msr
dbgvcr32_el2
,
x16
#else
ldr
x11
,
[
x0
,
#
CTX_ELR_EL2
]
#endif
#endif
msr
elr_el2
,
x11
ldp
x14
,
x15
,
[
x0
,
#
CTX_ESR_EL2
]
ldp
x9
,
x10
,
[
x0
,
#
CTX_ELR_EL2
]
msr
esr_el2
,
x14
msr
elr_el2
,
x9
msr
far_el2
,
x15
msr
esr_el2
,
x10
ldp
x11
,
x12
,
[
x0
,
#
CTX_FAR_EL2
]
msr
far_el2
,
x11
msr
hacr_el2
,
x12
ldp
x1
6
,
x1
7
,
[
x0
,
#
CTX_H
A
CR_EL2
]
ldp
x1
3
,
x1
4
,
[
x0
,
#
CTX_HCR_EL2
]
msr
h
a
cr_el2
,
x1
6
msr
hcr_el2
,
x1
3
msr
h
c
r_el2
,
x1
7
msr
h
pfa
r_el2
,
x1
4
ldp
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TCR
_EL2
]
msr
sp
_el2
,
x
10
msr
tcr
_el2
,
x
9
msr
t
c
r_el2
,
x1
1
msr
t
pid
r_el2
,
x1
0
ldp
x1
2
,
x1
3
,
[
x0
,
#
CTX_T
PIDR
_EL2
]
ldp
x1
1
,
x1
2
,
[
x0
,
#
CTX_T
TBR0
_EL2
]
msr
t
pidr
_el2
,
x1
2
msr
t
tbr0
_el2
,
x1
1
msr
ttbr0
_el2
,
x1
3
msr
vbar
_el2
,
x1
2
ldp
x13
,
x14
,
[
x0
,
#
CTX_V
BA
R_EL2
]
ldp
x13
,
x14
,
[
x0
,
#
CTX_V
MPID
R_EL2
]
msr
v
ba
r_el2
,
x13
msr
v
mpid
r_el2
,
x13
msr
v
m
pidr_el2
,
x14
msr
vpidr_el2
,
x14
ldp
x15
,
x16
,
[
x0
,
#
CTX_VPIDR_EL2
]
ldp
x15
,
x16
,
[
x0
,
#
CTX_VTCR_EL2
]
msr
vpidr_el2
,
x15
msr
vtcr_el2
,
x15
msr
vtcr_el2
,
x16
msr
vttbr_el2
,
x16
ldr
x17
,
[
x0
,
#
CTX_VTTBR_EL2
]
msr
vttbr_el2
,
x17
#if CTX_INCLUDE_MTE_REGS
#if CTX_INCLUDE_MTE_REGS
ldr
x9
,
[
x0
,
#
CTX_TFSR_EL2
]
ldr
x9
,
[
x0
,
#
CTX_TFSR_EL2
]
...
@@ -332,100 +290,76 @@ func el2_sysregs_context_restore
...
@@ -332,100 +290,76 @@ func el2_sysregs_context_restore
#endif
#endif
#if ENABLE_MPAM_FOR_LOWER_ELS
#if ENABLE_MPAM_FOR_LOWER_ELS
ld
p
x10
,
x11
,
[
x0
,
#
CTX_MPAM2_EL2
]
ld
r
x10
,
[
x0
,
#
CTX_MPAM2_EL2
]
msr
MPAM2_EL2
,
x10
msr
MPAM2_EL2
,
x10
msr
MPAMHCR_EL2
,
x11
ldp
x12
,
x13
,
[
x0
,
#
CTX_MPAMVPM0_EL2
]
ldp
x11
,
x12
,
[
x0
,
#
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X_HDFGWTR_EL2
]
ldp
x1
5
,
x1
6
,
[
x0
,
#
CTX_HDFGWTR_EL2
]
msr
HDFGWTR_EL2
,
x1
4
msr
HDFGWTR_EL2
,
x1
5
msr
HFGITR_EL2
,
x1
5
msr
HFGITR_EL2
,
x1
6
ldp
x
16
,
x1
7
,
[
x0
,
#
CTX_HFGRTR_EL2
]
ldp
x
9
,
x1
0
,
[
x0
,
#
CTX_HFGRTR_EL2
]
msr
HFGRTR_EL2
,
x
16
msr
HFGRTR_EL2
,
x
9
msr
HFGWTR_EL2
,
x1
7
msr
HFGWTR_EL2
,
x1
0
ldr
x
9
,
[
x0
,
#
CTX_CNTPOFF_EL2
]
ldr
x
11
,
[
x0
,
#
CTX_CNTPOFF_EL2
]
msr
CNTPOFF_EL2
,
x
9
msr
CNTPOFF_EL2
,
x
11
#endif
#endif
#if ARM_ARCH_AT_LEAST(8, 4)
#if ARM_ARCH_AT_LEAST(8, 4)
ldp
x10
,
x11
,
[
x0
,
#
CTX_CNTHPS_CTL_EL2
]
ldr
x12
,
[
x0
,
#
CTX_CONTEXTIDR_EL2
]
msr
cnthps_ctl_el2
,
x10
msr
contextidr_el2
,
x12
msr
cnthps_cval_el2
,
x11
ldp
x12
,
x13
,
[
x0
,
#
CTX_CNTHPS_TVAL_EL2
]
msr
cnthps_tval_el2
,
x12
msr
cnthvs_ctl_el2
,
x13
ldp
x14
,
x15
,
[
x0
,
#
CTX_CNTHVS_CVAL_EL2
]
msr
cnthvs_cval_el2
,
x14
msr
cnthvs_tval_el2
,
x15
ldp
x16
,
x17
,
[
x0
,
#
CTX_CNTHV_CTL_EL2
]
msr
cnthv_ctl_el2
,
x16
msr
cnthv_cval_el2
,
x17
ldp
x9
,
x10
,
[
x0
,
#
CTX_CNTHV_TVAL_EL2
]
msr
cnthv_tval_el2
,
x9
msr
contextidr_el2
,
x10
#if CTX_INCLUDE_AARCH32_REGS
#if CTX_INCLUDE_AARCH32_REGS
ldr
x1
1
,
[
x0
,
#
CTX_SDER32_EL2
]
ldr
x1
3
,
[
x0
,
#
CTX_SDER32_EL2
]
msr
sder32_el2
,
x1
1
msr
sder32_el2
,
x1
3
#endif
#endif
ldp
x14
,
x15
,
[
x0
,
#
CTX_TTBR1_EL2
]
ldr
x12
,
[
x0
,
#
CTX_TTBR1_EL2
]
msr
ttbr1_el2
,
x14
msr
ttbr1_el2
,
x12
msr
vdisr_el2
,
x15
ldr
x13
,
[
x0
,
#
CTX_VDISR_EL2
]
msr
vdisr_el2
,
x13
#if CTX_INCLUDE_NEVE_REGS
#if CTX_INCLUDE_NEVE_REGS
ldr
x1
4
,
[
x0
,
#
CTX_VNCR_EL2
]
ldr
x1
6
,
[
x0
,
#
CTX_VNCR_EL2
]
msr
vncr_el2
,
x1
4
msr
vncr_el2
,
x1
6
#endif
#endif
ldr
x15
,
[
x0
,
#
CTX_VSESR_EL2
]
ldp
x9
,
x10
,
[
x0
,
#
CTX_VSESR_EL2
]
msr
vsesr_el2
,
x15
msr
vsesr_el2
,
x9
msr
vstcr_el2
,
x10
ldr
x16
,
[
x0
,
#
CTX_VSTCR_EL2
]
msr
vstcr_el2
,
x16
ldr
x17
,
[
x0
,
#
CTX_VSTTBR_EL2
]
msr
vsttbr_el2
,
x17
ldr
x9
,
[
x0
,
#
CTX_TRFCR_EL2
]
ldp
x11
,
x12
,
[
x0
,
#
CTX_VSTTBR_EL2
]
msr
TRFCR_EL2
,
x9
msr
vsttbr_el2
,
x11
msr
TRFCR_EL2
,
x12
#endif
#endif
#if ARM_ARCH_AT_LEAST(8, 5)
#if ARM_ARCH_AT_LEAST(8, 5)
ldr
x1
0
,
[
x0
,
#
CTX_SCXTNUM_EL2
]
ldr
x1
3
,
[
x0
,
#
CTX_SCXTNUM_EL2
]
msr
scxtnum_el2
,
x1
0
msr
scxtnum_el2
,
x1
3
#endif
#endif
ret
ret
...
...
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