| 75df6269 | 14-Jun-2018 |
Yann Gautier <yann.gautier@st.com> |
xlat_v2: add a check on mm_cursor->size to avoid infinite loop
The issue can occur if end_va is equal to the max architecture address, and when mm_cursor point to the last entry of mmap_region_t tab
xlat_v2: add a check on mm_cursor->size to avoid infinite loop
The issue can occur if end_va is equal to the max architecture address, and when mm_cursor point to the last entry of mmap_region_t table: {0}. The first line of the while will then be true, e.g. on AARCH32, we have: mm_cursor->base_va (=0) + mm_cursor->size (=0) - 1 == end_va (=0xFFFFFFFF) And the mm_cursor->size = 0 will be lesser than mm->size
A check on mm_cursor->size != 0 should be done as in the previous while, to avoid such kind of infinite loop.
fixes arm-software/tf-issues#594
Signed-off-by: Yann Gautier <yann.gautier@st.com>
show more ...
|
| a0b9bb79 | 11-Jun-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat v2: Introduce xlat granule size helpers
The function xlat_arch_is_granule_size_supported() can be used to check if a specific granule size is supported. In Armv8, AArch32 only supports 4 KiB pa
xlat v2: Introduce xlat granule size helpers
The function xlat_arch_is_granule_size_supported() can be used to check if a specific granule size is supported. In Armv8, AArch32 only supports 4 KiB pages. AArch64 supports 4 KiB, 16 KiB or 64 KiB depending on the implementation, which is detected at runtime.
The function xlat_arch_get_max_supported_granule_size() returns the max granule size supported by the implementation.
Even though right now they are only used by SPM, they may be useful in other places in the future. This patch moves the code currently in SPM to the xlat tables lib so that it can be reused.
Change-Id: If54624a5ecf20b9b9b7f38861b56383a03bbc8a4 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| bdcd33a8 | 25-May-2018 |
John Tsichritzis <john.tsichritzis@arm.com> |
MISRA rule 21.15 fix
Rule 21.15: The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible t
MISRA rule 21.15 fix
Rule 21.15: The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible types.
Basically that means that both pointer arguments must be of the same type. However, even if the pointers passed as arguments to the above functions are of the same type, Coverity still thinks it's a violation if we do pointer arithmetics directly at the function call. Thus the pointer arithmetic operations were moved outside of the function argument.
First detected on the following configuration make PLAT=fvp LOG_LEVEL=50
Change-Id: I8b912ec1bfa6f2d60857cb1bd453981fd7001b94 Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
show more ...
|
| 885ca54a | 09-May-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Merge pull request #1377 from robertovargas-arm/compiler-warnings
Compiler warnings |
| a83a74d2 | 09-May-2018 |
Roberto Vargas <roberto.vargas@arm.com> |
Don't use variables as tf_printf format strings
Using variables as format strings can generate security problems when the user can control those strings. Some compilers generate warnings in that cas
Don't use variables as tf_printf format strings
Using variables as format strings can generate security problems when the user can control those strings. Some compilers generate warnings in that cases, even when the variables are constants and are not controlled by the user.
Change-Id: I65dee1d1b66feab38cbf298290a86fa56e6cca40 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| 0ef858bd | 03-May-2018 |
danh-arm <dan.handley@arm.com> |
Merge pull request #1370 from antonio-nino-diaz-arm/an/fix-parange
xlat: Have all values of PARange for 8.x architectures |
| d3c4487c | 02-May-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat: Have all values of PARange for 8.x architectures
In AArch64, the field ID_AA64MMFR0_EL1.PARange has a different set of allowed values depending on the architecture version.
Previously, we onl
xlat: Have all values of PARange for 8.x architectures
In AArch64, the field ID_AA64MMFR0_EL1.PARange has a different set of allowed values depending on the architecture version.
Previously, we only compiled the Trusted Firmware with the values that were allowed by the architecture. However, given that this field is read-only, it is easier to compile the code with all values regardless of the target architecture.
Change-Id: I57597ed103dd0189b1fb738a9ec5497391c10dd1 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 01c0a38e | 26-Apr-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat: Set AP[1] to 1 when it is RES1
According to the ARMv8 ARM issue C.a:
AP[1] is valid only for stage 1 of a translation regime that can support two VA ranges. It is RES 1 when stage 1 t
xlat: Set AP[1] to 1 when it is RES1
According to the ARMv8 ARM issue C.a:
AP[1] is valid only for stage 1 of a translation regime that can support two VA ranges. It is RES 1 when stage 1 translations can support only one VA range.
This means that, even though this bit is ignored, it should be set to 1 in the EL3 and EL2 translation regimes.
For translation regimes consisting on EL0 and a higher regime this bit selects between control at EL0 or at the higher Exception level. The regimes that support two VA ranges are EL1&0 and EL2&0 (the later one is only available since ARMv8.1).
This fix has to be applied to both versions of the translation tables library.
Change-Id: If19aaf588551bac7aeb6e9a686cf0c2068e7c181 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| b3323cd6 | 17-Apr-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Fix some MISRA defects in SPM code
Change-Id: I989c1f4aef8e3cb20d5d19e6347575e6449bb60b Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
| 0ed32232 | 03-Apr-2018 |
Varun Wadekar <vwadekar@nvidia.com> |
lib: xlat_tables_v2: reduce time required to add a mmap region
The last entry in the mapping table is not necessarily the same as the end of the table. This patch loops through the table to find the
lib: xlat_tables_v2: reduce time required to add a mmap region
The last entry in the mapping table is not necessarily the same as the end of the table. This patch loops through the table to find the last entry marker, on every new mmap addition. The memove operation then has to only move the memory between current entry and the last entry. For platforms that arrange their MMIO map properly, this opearation turns out to be a NOP.
The previous implementation added significant overhead per mmap addition as the memmove operation always moved the difference between the current mmap entry and the end of the table.
Tested on Tegra platforms and this new approach improves the memory mapping time by ~75%, thus significantly reducing boot time on some platforms.
Change-Id: Ie3478fa5942379282ef58bee2085da799137e2ca Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
show more ...
|
| 73a96051 | 28-Feb-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1282 from robertovargas-arm/misra-changes
Misra changes |
| 1af540ef | 12-Feb-2018 |
Roberto Vargas <roberto.vargas@arm.com> |
Fix MISRA rule 8.4 Part 1
Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined
Fixed for: make DEBUG=1 PLAT=fvp LOG_LEVEL=50 al
Fix MISRA rule 8.4 Part 1
Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined
Fixed for: make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all
Change-Id: I7c2ad3f5c015411c202605851240d5347e4cc8c7 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| 9fb8af33 | 12-Feb-2018 |
Roberto Vargas <roberto.vargas@arm.com> |
Fix MISRA rule 8.3 in common code
Rule 8.3: All declarations of an object or function shall use the same names and type qualifiers.
Change-Id: Iff384187c74a598a4e73f350a1893b60e9d16cec Si
Fix MISRA rule 8.3 in common code
Rule 8.3: All declarations of an object or function shall use the same names and type qualifiers.
Change-Id: Iff384187c74a598a4e73f350a1893b60e9d16cec Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| 5724481f | 16-Feb-2018 |
David Cunado <david.cunado@arm.com> |
Update ULL() macro and instances of ull to comply with MISRA
MISRA C-2012 Rule 7.3 violation: lowercase l shall not be used as literal suffixes.
This patch resolves this for the ULL() macro by usin
Update ULL() macro and instances of ull to comply with MISRA
MISRA C-2012 Rule 7.3 violation: lowercase l shall not be used as literal suffixes.
This patch resolves this for the ULL() macro by using ULL suffix instead of the ull suffix.
Change-Id: Ia8183c399e74677e676956e8653e82375d0e0a01 Signed-off-by: David Cunado <david.cunado@arm.com>
show more ...
|
| 96abc22b | 05-Jan-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat v2: Correctly unmap regions on map error
`mm_cursor` doesn't have the needed data because the `memmove()` that is called right before it overwrites that information. In order to get the informa
xlat v2: Correctly unmap regions on map error
`mm_cursor` doesn't have the needed data because the `memmove()` that is called right before it overwrites that information. In order to get the information of the region that was being mapped, `mm` has to be used instead (like it is done to fill the fields of `unmap_mm`).
If the incorrect information is read, this check isn't reliable and `xlat_tables_unmap_region` may be requested to unmap memory that isn't mapped at all, triggering assertions.
Change-Id: I602d4ac83095d4e5dac9deb34aa5d00d00e6c289 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 71f8a6a9 | 23-Nov-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1145 from etienne-lms/rfc-armv7-2
Support ARMv7 architectures |
| 6504b2c5 | 17-Nov-2017 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Add ARMv8.2 ID_AA64MMFR0_EL1.PARange value
If an implementation of ARMv8.2 includes ARMv8.2-LPA, the value 0b0110 is permitted in ID_AA64MMFR0_EL1.PARange, which means that the Physical Address rang
Add ARMv8.2 ID_AA64MMFR0_EL1.PARange value
If an implementation of ARMv8.2 includes ARMv8.2-LPA, the value 0b0110 is permitted in ID_AA64MMFR0_EL1.PARange, which means that the Physical Address range supported is 52 bits (4 PiB). It is a reserved value otherwise.
Change-Id: Ie0147218e9650aa09f0034a9ee03c1cca8db908a Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| ad02a759 | 25-Oct-2017 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat: Make function to calculate TCR PA bits public
This function can be useful to setup TCR_ELx by callers that don't use the translation tables library to setup the system registers related to the
xlat: Make function to calculate TCR PA bits public
This function can be useful to setup TCR_ELx by callers that don't use the translation tables library to setup the system registers related to them. By making it common, it can be reused whenever it is needed without duplicating code.
Change-Id: Ibfada9e846d2a6cd113b1925ac911bb27327d375 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 51b992ec | 08-Nov-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
ARMv7 may not support large page addressing
ARCH_SUPPORTS_LARGE_PAGE_ADDRESSING allows build environment to handle specific case when target ARMv7 core only supports 32bit MMU descriptor mode.
If A
ARMv7 may not support large page addressing
ARCH_SUPPORTS_LARGE_PAGE_ADDRESSING allows build environment to handle specific case when target ARMv7 core only supports 32bit MMU descriptor mode.
If ARMv7 based platform does not set ARM_CORTEX_Ax=yes, platform shall define ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING to enable large page addressing support.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 996d6b39 | 17-Oct-2017 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
xlat: Introduce API to change memory attributes of a region
This patch introduces a new API in the translation tables library (v2), that allows to change the memory attributes of a memory region. It
xlat: Introduce API to change memory attributes of a region
This patch introduces a new API in the translation tables library (v2), that allows to change the memory attributes of a memory region. It may be used to change its execution permissions and data access permissions.
As a prerequisite, the memory must be already mapped. Moreover, it must be mapped at the finest granularity (currently 4 KB).
Change-Id: I242a8c6f0f3ef2b0a81a61e28706540462faca3c Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 1be910bb | 13-Oct-2017 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
xlat: Introduce API to get memory attributes of a region
This patch introduces a new API in the translation tables library (v2), that allows to query the memory attributes of a memory block or a mem
xlat: Introduce API to get memory attributes of a region
This patch introduces a new API in the translation tables library (v2), that allows to query the memory attributes of a memory block or a memory page.
Change-Id: I45a8b39a53da39e7617cbac4bff5658dc1b20a11 Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 609c9191 | 04-Oct-2017 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
xlat: Add support for EL0 and EL1 mappings
This patch introduces the ability of the xlat tables library to manage EL0 and EL1 mappings from a higher exception level.
Attributes MT_USER and MT_PRIVI
xlat: Add support for EL0 and EL1 mappings
This patch introduces the ability of the xlat tables library to manage EL0 and EL1 mappings from a higher exception level.
Attributes MT_USER and MT_PRIVILEGED have been added to allow the user specify the target EL in the translation regime EL1&0.
REGISTER_XLAT_CONTEXT2 macro is introduced to allow creating a xlat_ctx_t that targets a given translation regime (EL1&0 or EL3).
A new member is added to xlat_ctx_t to represent the translation regime the xlat_ctx_t manages. The execute_never mask member is removed as it is computed from existing information.
Change-Id: I95e14abc3371d7a6d6a358cc54c688aa9975c110 Co-authored-by: Douglas Raillard <douglas.raillard@arm.com> Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| b4ae615b | 25-Sep-2017 |
Douglas Raillard <douglas.raillard@arm.com> |
xlat: Introduce function xlat_arch_tlbi_va_regime()
Introduce a variant of the TLB invalidation helper function that allows the targeted translation regime to be specified, rather than defaulting to
xlat: Introduce function xlat_arch_tlbi_va_regime()
Introduce a variant of the TLB invalidation helper function that allows the targeted translation regime to be specified, rather than defaulting to the current one.
This new function is useful in the context of EL3 software managing translation tables for the S-EL1&0 translation regime, as then it might need to invalidate S-EL1&0 TLB entries rather than EL3 ones.
Define a new enumeration to be able to represent translation regimes in the xlat tables library.
Change-Id: Ibe4438dbea2d7a6e7470bfb68ff805d8bf6b07e5 Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Douglas Raillard <douglas.raillard@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| f301da44 | 25-Apr-2017 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
xlat: Always compile TLB invalidation functions
TLB invalidation functions used to be conditionally compiled in. They were enabled only when using the dynamic mapping feature. because only then woul
xlat: Always compile TLB invalidation functions
TLB invalidation functions used to be conditionally compiled in. They were enabled only when using the dynamic mapping feature. because only then would we need to modify page tables on the fly.
Actually there are other use cases where invalidating TLBs is required. When changing memory attributes in existing translation descriptors for example. These other use cases do not necessarily depend on the dynamic mapping feature.
This patch removes this dependency and always compile TLB invalidation functions in. If they're not used, they will be removed from the binary at link-time anyway so there's no consequence on the memory footprint if these functions are not called.
Change-Id: I1c33764ae900eb00073ee23b7d0d53d4efa4dd21 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| fdb1964c | 28-Sep-2017 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
xlat: Introduce MAP_REGION2() macro
The current implementation of the memory mapping API favours mapping memory regions using the biggest possible block size in order to reduce the number of transla
xlat: Introduce MAP_REGION2() macro
The current implementation of the memory mapping API favours mapping memory regions using the biggest possible block size in order to reduce the number of translation tables needed.
In some cases, this behaviour might not be desirable. When translation tables are edited at run-time, coarse-grain mappings like that might need splitting into finer-grain tables. This operation has a performance cost.
The MAP_REGION2() macro allows to specify the granularity of translation tables used for the initial mapping of a memory region. This might increase performance for memory regions that are likely to be edited in the future, at the expense of a potentially increased memory footprint.
The Translation Tables Library Design Guide has been updated to explain the use case for this macro. Also added a few intermediate titles to make the guide easier to digest.
Change-Id: I04de9302e0ee3d326b8877043a9f638766b81b7b Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|