Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
1d7dc63c
Commit
1d7dc63c
authored
5 years ago
by
Soby Mathew
Committed by
TrustedFirmware Code Review
5 years ago
Browse files
Options
Download
Plain Diff
Merge "Enable MTE support unilaterally for Normal World" into integration
parents
b514ee86
b7e398d6
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
v2.2
v2.2-rc2
v2.2-rc1
v2.2-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/arch/aarch64/arch.h
+8
-0
include/arch/aarch64/arch.h
include/arch/aarch64/arch_features.h
+6
-0
include/arch/aarch64/arch_features.h
lib/el3_runtime/aarch64/context_mgmt.c
+13
-0
lib/el3_runtime/aarch64/context_mgmt.c
with
27 additions
and
0 deletions
+27
-0
include/arch/aarch64/arch.h
View file @
1d7dc63c
...
...
@@ -219,6 +219,13 @@
#define BTI_IMPLEMENTED ULL(1)
/* The BTI mechanism is implemented */
#define ID_AA64PFR1_EL1_MTE_SHIFT U(8)
#define ID_AA64PFR1_EL1_MTE_MASK ULL(0xf)
#define MTE_UNIMPLEMENTED ULL(0)
#define MTE_IMPLEMENTED_EL0 ULL(1)
/* MTE is only implemented at EL0 */
#define MTE_IMPLEMENTED_ELX ULL(2)
/* MTE is implemented at all ELs */
/* ID_PFR1_EL1 definitions */
#define ID_PFR1_VIRTEXT_SHIFT U(12)
#define ID_PFR1_VIRTEXT_MASK U(0xf)
...
...
@@ -278,6 +285,7 @@
/* SCR definitions */
#define SCR_RES1_BITS ((U(1) << 4) | (U(1) << 5))
#define SCR_ATA_BIT (U(1) << 26)
#define SCR_FIEN_BIT (U(1) << 21)
#define SCR_API_BIT (U(1) << 17)
#define SCR_APK_BIT (U(1) << 16)
...
...
This diff is collapsed.
Click to expand it.
include/arch/aarch64/arch_features.h
View file @
1d7dc63c
...
...
@@ -54,4 +54,10 @@ static inline bool is_armv8_5_bti_present(void)
ID_AA64PFR1_EL1_BT_MASK
)
==
BTI_IMPLEMENTED
;
}
static
inline
unsigned
int
get_armv8_5_mte_support
(
void
)
{
return
((
read_id_aa64pfr1_el1
()
>>
ID_AA64PFR1_EL1_MTE_SHIFT
)
&
ID_AA64PFR1_EL1_MTE_MASK
);
}
#endif
/* ARCH_FEATURES_H */
This diff is collapsed.
Click to expand it.
lib/el3_runtime/aarch64/context_mgmt.c
View file @
1d7dc63c
...
...
@@ -12,6 +12,7 @@
#include <arch.h>
#include <arch_helpers.h>
#include <arch_features.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
#include <context.h>
...
...
@@ -136,6 +137,18 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep)
scr_el3
|=
SCR_API_BIT
|
SCR_APK_BIT
;
#endif
/* !CTX_INCLUDE_PAUTH_REGS */
unsigned
int
mte
=
get_armv8_5_mte_support
();
/*
* Enable MTE support unilaterally for normal world if the CPU supports
* it.
*/
if
(
mte
!=
MTE_UNIMPLEMENTED
)
{
if
(
security_state
==
NON_SECURE
)
{
scr_el3
|=
SCR_ATA_BIT
;
}
}
#ifdef IMAGE_BL31
/*
* SCR_EL3.IRQ, SCR_EL3.FIQ: Enable the physical FIQ and IRQ routing as
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help