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
c853dc7e
Unverified
Commit
c853dc7e
authored
6 years ago
by
danh-arm
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1363 from antonio-nino-diaz-arm/an/res1-ap
xlat: Set AP[1] to 1 when it is RES1
parents
0522c1e7
01c0a38e
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
v2.1
v2.1-rc1
v2.1-rc0
v2.0
v2.0-rc0
v1.6
v1.6-rc1
v1.6-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/lib/xlat_tables/xlat_tables_defs.h
+4
-4
include/lib/xlat_tables/xlat_tables_defs.h
lib/xlat_tables/xlat_tables_common.c
+14
-2
lib/xlat_tables/xlat_tables_common.c
lib/xlat_tables_v2/xlat_tables_internal.c
+1
-1
lib/xlat_tables_v2/xlat_tables_internal.c
with
19 additions
and
7 deletions
+19
-7
include/lib/xlat_tables/xlat_tables_defs.h
View file @
c853dc7e
...
...
@@ -107,10 +107,8 @@
* Permissions bits, and does not define an AP[0] bit.
*
* AP[1] is valid only for a stage 1 translation that supports two VA ranges
* (i.e. in the ARMv8A.0 architecture, that is the S-EL1&0 regime).
*
* AP[1] is RES0 for stage 1 translations that support only one VA range
* (e.g. EL3).
* (i.e. in the ARMv8A.0 architecture, that is the S-EL1&0 regime). It is RES1
* when stage 1 translations can only support one VA range.
*/
#define AP2_SHIFT U(0x7)
#define AP2_RO U(0x1)
...
...
@@ -119,6 +117,7 @@
#define AP1_SHIFT U(0x6)
#define AP1_ACCESS_UNPRIVILEGED U(0x1)
#define AP1_NO_ACCESS_UNPRIVILEGED U(0x0)
#define AP1_RES1 U(0x1)
/*
* The following definitions must all be passed to the LOWER_ATTRS() macro to
...
...
@@ -128,6 +127,7 @@
#define AP_RW (AP2_RW << 5)
#define AP_ACCESS_UNPRIVILEGED (AP1_ACCESS_UNPRIVILEGED << 4)
#define AP_NO_ACCESS_UNPRIVILEGED (AP1_NO_ACCESS_UNPRIVILEGED << 4)
#define AP_ONE_VA_RANGE_RES1 (AP1_RES1 << 4)
#define NS (U(0x1) << 3)
#define ATTR_NON_CACHEABLE_INDEX U(0x2)
#define ATTR_DEVICE_INDEX U(0x1)
...
...
This diff is collapsed.
Click to expand it.
lib/xlat_tables/xlat_tables_common.c
View file @
c853dc7e
/*
* Copyright (c) 2016-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -41,6 +41,7 @@ static unsigned long long xlat_max_pa;
static
uintptr_t
xlat_max_va
;
static
uint64_t
execute_never_mask
;
static
uint64_t
ap1_mask
;
/*
* Array of all memory regions stored in order of ascending base address.
...
...
@@ -195,6 +196,7 @@ static uint64_t mmap_desc(mmap_attr_t attr, unsigned long long addr_pa,
desc
|=
(
attr
&
MT_NS
)
?
LOWER_ATTRS
(
NS
)
:
0
;
desc
|=
(
attr
&
MT_RW
)
?
LOWER_ATTRS
(
AP_RW
)
:
LOWER_ATTRS
(
AP_RO
);
desc
|=
LOWER_ATTRS
(
ACCESS_FLAG
);
desc
|=
ap1_mask
;
/*
* Deduce shareability domain and executability of the memory region
...
...
@@ -381,7 +383,17 @@ void init_xlation_table(uintptr_t base_va, uint64_t *table,
unsigned
int
level
,
uintptr_t
*
max_va
,
unsigned
long
long
*
max_pa
)
{
execute_never_mask
=
xlat_arch_get_xn_desc
(
xlat_arch_current_el
());
int
el
=
xlat_arch_current_el
();
execute_never_mask
=
xlat_arch_get_xn_desc
(
el
);
if
(
el
==
3
)
{
ap1_mask
=
LOWER_ATTRS
(
AP_ONE_VA_RANGE_RES1
);
}
else
{
assert
(
el
==
1
);
ap1_mask
=
0
;
}
init_xlation_table_inner
(
mmap
,
base_va
,
table
,
level
);
*
max_va
=
xlat_max_va
;
*
max_pa
=
xlat_max_pa
;
...
...
This diff is collapsed.
Click to expand it.
lib/xlat_tables_v2/xlat_tables_internal.c
View file @
c853dc7e
...
...
@@ -155,7 +155,7 @@ static uint64_t xlat_desc(const xlat_ctx_t *ctx, uint32_t attr,
}
}
else
{
assert
(
ctx
->
xlat_regime
==
EL3_REGIME
);
desc
|=
LOWER_ATTRS
(
AP_
NO_ACCESS_UNPRIVILEGED
);
desc
|=
LOWER_ATTRS
(
AP_
ONE_VA_RANGE_RES1
);
}
/*
...
...
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