Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trusted-firmware-a
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arm Reference Solutions
trusted-firmware-a
Commits
5e8911a0
Commit
5e8911a0
authored
4 years ago
by
Olivier Deprez
Committed by
TrustedFirmware Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Aarch64: Add support for FEAT_MTE3" into integration
parents
08886940
0563ab08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/arch/aarch64/arch.h
+11
-3
11 additions, 3 deletions
include/arch/aarch64/arch.h
lib/el3_runtime/aarch64/context_mgmt.c
+17
-14
17 additions, 14 deletions
lib/el3_runtime/aarch64/context_mgmt.c
with
28 additions
and
17 deletions
include/arch/aarch64/arch.h
+
11
−
3
View file @
5e8911a0
...
...
@@ -266,9 +266,17 @@
#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 */
/* Memory Tagging Extension is not implemented */
#define MTE_UNIMPLEMENTED U(0)
/* FEAT_MTE: MTE instructions accessible at EL0 are implemented */
#define MTE_IMPLEMENTED_EL0 U(1)
/* FEAT_MTE2: Full MTE is implemented */
#define MTE_IMPLEMENTED_ELX U(2)
/*
* FEAT_MTE3: MTE is implemented with support for
* asymmetric Tag Check Fault handling
*/
#define MTE_IMPLEMENTED_ASY U(3)
#define ID_AA64PFR1_MPAM_FRAC_SHIFT ULL(16)
#define ID_AA64PFR1_MPAM_FRAC_MASK ULL(0xf)
...
...
This diff is collapsed.
Click to expand it.
lib/el3_runtime/aarch64/context_mgmt.c
+
17
−
14
View file @
5e8911a0
...
...
@@ -144,30 +144,33 @@ 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 */
#if !CTX_INCLUDE_MTE_REGS || ENABLE_ASSERTIONS
/* Get Memory Tagging Extension support level */
unsigned
int
mte
=
get_armv8_5_mte_support
();
#endif
/*
* Enable MTE support. Support is enabled unilaterally for the normal
* world, and only for the secure world when CTX_INCLUDE_MTE_REGS is
* set.
*/
#if CTX_INCLUDE_MTE_REGS
assert
(
get_armv8_5_mte_support
()
==
MTE_IMPLEMENTED_ELX
);
assert
(
(
mte
==
MTE_IMPLEMENTED_ELX
)
||
(
mte
==
MTE_IMPLEMENTED_ASY
)
);
scr_el3
|=
SCR_ATA_BIT
;
#else
unsigned
int
mte
=
get_armv8_5_mte_support
();
if
(
mte
==
MTE_IMPLEMENTED_EL0
)
{
/*
* Can enable MTE across both worlds as no MTE registers are
* used
*/
scr_el3
|=
SCR_ATA_BIT
;
}
else
if
(
mte
==
MTE_IMPLEMENTED_ELX
&&
security_state
==
NON_SECURE
)
{
/*
* Can only enable MTE in Non-Secure world without register
* saving
*/
/*
* When MTE is only implemented at EL0, it can be enabled
* across both worlds as no MTE registers are used.
*/
if
((
mte
==
MTE_IMPLEMENTED_EL0
)
||
/*
* When MTE is implemented at all ELs, it can be only enabled
* in Non-Secure world without register saving.
*/
(((
mte
==
MTE_IMPLEMENTED_ELX
)
||
(
mte
==
MTE_IMPLEMENTED_ASY
))
&&
(
security_state
==
NON_SECURE
)))
{
scr_el3
|=
SCR_ATA_BIT
;
}
#endif
#endif
/* CTX_INCLUDE_MTE_REGS */
#ifdef IMAGE_BL31
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment