| a2e702a2 | 14-Feb-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Factor out CPU AMU helpers
This patch also fixes `cpuamu_write_cpuamcntenclr_el0()` to use an MSR instruction instead of an MRS instruction.
Change-Id: Ia6531f64b5ebc60ba432124eaa8d8eaccba40ed0 Sig
Factor out CPU AMU helpers
This patch also fixes `cpuamu_write_cpuamcntenclr_el0()` to use an MSR instruction instead of an MRS instruction.
Change-Id: Ia6531f64b5ebc60ba432124eaa8d8eaccba40ed0 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| 2ff8fbf3 | 19-Feb-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Implement {spe,sve}_supported() helpers and refactor code
Implement helpers to test if the core supports SPE/SVE. We have a similar helper for AMU and this patch makes all extensions consistent in
Implement {spe,sve}_supported() helpers and refactor code
Implement helpers to test if the core supports SPE/SVE. We have a similar helper for AMU and this patch makes all extensions consistent in their implementation.
Change-Id: I3e6f7522535ca358259ad142550b19fcb883ca67 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| 883d1b5d | 23-Feb-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Add comments about mismatched TCR_ELx and xlat tables
When the MMU is enabled and the translation tables are mapped, data read/writes to the translation tables are made using the attributes specifie
Add comments about mismatched TCR_ELx and xlat tables
When the MMU is enabled and the translation tables are mapped, data read/writes to the translation tables are made using the attributes specified in the translation tables themselves. However, the MMU performs table walks with the attributes specified in TCR_ELx. They are completely independent, so special care has to be taken to make sure that they are the same.
This has to be done manually because it is not practical to have a test in the code. Such a test would need to know the virtual memory region that contains the translation tables and check that for all of the tables the attributes match the ones in TCR_ELx. As the tables may not even be mapped at all, this isn't a test that can be made generic.
The flags used by enable_mmu_xxx() have been moved to the same header where the functions are.
Also, some comments in the linker scripts related to the translation tables have been fixed.
Change-Id: I1754768bffdae75f53561b1c4a5baf043b45a304 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 4abd7fa7 | 14-Feb-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Redefine SMC_UNK as -1 instead of 0xFFFFFFFF
According to the SMC Calling Convention (ARM DEN0028B):
The Unknown SMC Function Identifier is a sign-extended value of (-1) that is returned in
Redefine SMC_UNK as -1 instead of 0xFFFFFFFF
According to the SMC Calling Convention (ARM DEN0028B):
The Unknown SMC Function Identifier is a sign-extended value of (-1) that is returned in R0, W0 or X0 register.
The value wasn't sign-extended because it was defined as a 32-bit unsigned value (0xFFFFFFFF).
SMC_PREEMPT has been redefined as -2 for the same reason.
NOTE: This might be a compatibility break for some AArch64 platforms that don't follow the previous version of the SMCCC (ARM DEN0028A) correctly. That document specifies that only the bottom 32 bits of the returned value must be checked. If a platform relies on the top 32 bits of the result being 0 (so that SMC_UNK is 0x00000000FFFFFFFF), it will have to fix its code to comply with the SMCCC.
Change-Id: I7f7b109f6b30c114fe570aa0ead3c335383cb54d Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| 9fd2f13b | 06-Feb-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1224 from masahir0y/gzip
Support GZIP-compressed images for faster loading and verification |
| 9c00555b | 02-Feb-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1253 from dp-arm/dp/amu32
AMUv1 support for AArch32 |
| c43d6851 | 26-Jan-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
zlib: add gunzip() support
This commit adds some more files to use zlib from TF.
To use zlib, ->zalloc and ->zfree hooks are needed. The implementation depends on the system. For user-space, the
zlib: add gunzip() support
This commit adds some more files to use zlib from TF.
To use zlib, ->zalloc and ->zfree hooks are needed. The implementation depends on the system. For user-space, the libc provides malloc() and friends. Unfortunately, ARM Trusted Firmware does not provide malloc() or any concept of dynamic memory allocation.
I implemented very simple calloc() and free() for this. Stupidly, zfree() never frees memory, but it works enough for this.
The purpose of using zlib is to implement gunzip() - this function takes compressed data from in_buf, then dumps the decompressed data to oub_buf. The work_buf is used for memory allocation during the decompress. Upon exit, it updates in_buf and out_buf. If successful, in_buf points to the end of input data, out_buf to the end of the decompressed data.
To use this feature, you need to do:
- include lib/zlib/zlib.mk from your platform.mk
- add $(ZLIB_SOURCES) to your BL*_SOURCES
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
| 9bc94a6d | 01-Feb-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1240 from dp-arm/dp/smccc
Implement support for SMCCC v1.1 and optimize security mitigations for CVE-2017-5715 on AArch64 |
| c70da546 | 21-Dec-2017 |
Joel Hutton <joel.hutton@arm.com> |
AMU: Implement context save/restore for aarch32
Add amu_context_save() and amu_context_restore() functions for aarch32
Change-Id: I4df83d447adeaa9d9f203e16dc5a919ffc04d87a Signed-off-by: Joel Hutto
AMU: Implement context save/restore for aarch32
Add amu_context_save() and amu_context_restore() functions for aarch32
Change-Id: I4df83d447adeaa9d9f203e16dc5a919ffc04d87a Signed-off-by: Joel Hutton <joel.hutton@arm.com>
show more ...
|
| ce213b96 | 12-Dec-2017 |
Joel Hutton <joel.hutton@arm.com> |
AMU: Add assembler helper functions for aarch32
Change-Id: Id6dfe885a63561b1d2649521bd020367b96ae1af Signed-off-by: Joel Hutton <joel.hutton@arm.com> |
| eefd04b6 | 30-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1235 from jwerner-chromium/JW_udelay
Fix udelay issues that can make duration slightly too short |
| d9bd656c | 11-Jan-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Optimize/cleanup BPIALL workaround
In the initial implementation of this workaround we used a dedicated workaround context to save/restore state. This patch reduces the footprint as no additional c
Optimize/cleanup BPIALL workaround
In the initial implementation of this workaround we used a dedicated workaround context to save/restore state. This patch reduces the footprint as no additional context is needed.
Additionally, this patch reduces the memory loads and stores by 20%, reduces the instruction count and exploits static branch prediction to optimize the SMC path.
Change-Id: Ia9f6bf06fbf8a9037cfe7f1f1fb32e8aec38ec7d Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| 3a1b0676 | 19-Jan-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Implement support for SMCCC v1.1
SMCCC v1.1 comes with a relaxed calling convention for AArch64 callers. The caller only needs to save x0-x3 before doing an SMC call.
This patch adds support for S
Implement support for SMCCC v1.1
SMCCC v1.1 comes with a relaxed calling convention for AArch64 callers. The caller only needs to save x0-x3 before doing an SMC call.
This patch adds support for SMCCC_VERSION and SMCCC_ARCH_FEATURES.
Refer to "Firmware Interfaces for mitigating CVE_2017_5715 System Software on Arm Systems"[0] for more information.
[0] https://developer.arm.com/-/media/developer/pdf/ARM%20DEN%200070A%20Firmware%20interfaces%20for%20mitigating%20CVE-2017-5715_V1.0.pdf
Change-Id: If5b1c55c17d6c5c7cb9c2c3ed355d3a91cdad0a9 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| d95eb476 | 25-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1228 from dp-arm/dp/cve_2017_5715
Workarounds for CVE-2017-5715 on A9/A15 and A17 + serial console reporting |
| 040f1e69 | 24-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1193 from jwerner-chromium/JW_coreboot
New console API and coreboot support [v4] |
| 7baa7bca | 22-Jan-2018 |
Julius Werner <jwerner@chromium.org> |
Make div_round_up() correct for divisors that are not a power of 2
The current div_round_up() implementation relies on round_up() which only works correctly for boundaries that are a power of 2. It
Make div_round_up() correct for divisors that are not a power of 2
The current div_round_up() implementation relies on round_up() which only works correctly for boundaries that are a power of 2. It is documented as such, but this still seems dangerously easy to overlook, especially since many other environments (e.g. the Linux kernel) have a similar macro without these limitations.
There is a different way to calculate this that can deal with all kinds of divisors without other drawbacks, so let's just use that instead.
Change-Id: Id382736683f5d4e880ef00c53cfa23a2f9208440 Signed-off-by: Julius Werner <jwerner@chromium.org>
show more ...
|
| 3429c77a | 09-Jun-2017 |
Julius Werner <jwerner@chromium.org> |
Add platform-independent coreboot support library
This patch adds the foundation for a platform-independent coreboot support library that can be shared by all platforms that boot BL31 from coreboot
Add platform-independent coreboot support library
This patch adds the foundation for a platform-independent coreboot support library that can be shared by all platforms that boot BL31 from coreboot (acting as BL2). It adds code to parse the "coreboot table", a data structure that coreboot uses to communicate different kinds of information to later-stage firmware and certain OS drivers.
As a first small use case for this information, allow platforms to access the serial console configuration used by coreboot, removing the need to hardcode base address and divisors and allowing Trusted Firmware to benefit from coreboot's user configuration (e.g. which UART to pick and which baud rate to use).
Change-Id: I2bfb39cd2609ce6640b844ab68df6c9ae3f28e9e Signed-off-by: Julius Werner <jwerner@chromium.org>
show more ...
|
| 0d3a27e7 | 19-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1200 from robertovargas-arm/bl2-el3
Add BL2_AT_EL3 build option |
| e4b34efa | 03-Jan-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Workaround for CVE-2017-5715 for Cortex A9, A15 and A17
A per-cpu vbar is installed that implements the workaround by invalidating the branch target buffer (BTB) directly in the case of A9 and A17 a
Workaround for CVE-2017-5715 for Cortex A9, A15 and A17
A per-cpu vbar is installed that implements the workaround by invalidating the branch target buffer (BTB) directly in the case of A9 and A17 and indirectly by invalidating the icache in the case of A15.
For Cortex A57 and A72 there is currently no workaround implemented when EL3 is in AArch32 mode so report it as missing.
For other vulnerable CPUs (e.g. Cortex A73 and Cortex A75), there are no changes since there is currently no upstream AArch32 EL3 support for these CPUs.
Change-Id: Ib42c6ef0b3c9ff2878a9e53839de497ff736258f Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| 7343505d | 02-Jan-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
sp_min: Implement workaround for CVE-2017-5715
This patch introduces two workarounds for ARMv7 systems. The workarounds need to be applied prior to any `branch` instruction in secure world. This i
sp_min: Implement workaround for CVE-2017-5715
This patch introduces two workarounds for ARMv7 systems. The workarounds need to be applied prior to any `branch` instruction in secure world. This is achieved using a custom vector table where each entry is an `add sp, sp, #1` instruction.
On entry to monitor mode, once the sequence of `ADD` instructions is executed, the branch target buffer (BTB) is invalidated. The bottom bits of `SP` are then used to decode the exception entry type.
A side effect of this change is that the exception vectors are installed before the CPU specific reset function. This is now consistent with how it is done on AArch64.
Note, on AArch32 systems, the exception vectors are typically tightly integrated with the secure payload (e.g. the Trusted OS). This workaround will need porting to each secure payload that requires it.
The patch to modify the AArch32 per-cpu vbar to the corresponding workaround vector table according to the CPU type will be done in a later patch.
Change-Id: I5786872497d359e496ebe0757e8017fa98f753fa Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|
| b1d27b48 | 30-Oct-2017 |
Roberto Vargas <roberto.vargas@arm.com> |
bl2-el3: Add BL2_EL3 image
This patch enables BL2 to execute at the highest exception level without any dependancy on TF BL1. This enables platforms which already have a non-TF Boot ROM to directly
bl2-el3: Add BL2_EL3 image
This patch enables BL2 to execute at the highest exception level without any dependancy on TF BL1. This enables platforms which already have a non-TF Boot ROM to directly load and execute BL2 and subsequent BL stages without need for BL1. This is not currently possible because BL2 executes at S-EL1 and cannot jump straight to EL3.
Change-Id: Ief1efca4598560b1b8c8e61fbe26d1f44e929d69 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| 109ae263 | 16-Jan-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
utils: rename struct mem_region_t to struct mem_region
typedef mem_region_t mem_region_t;
... seems to work because they belong to different name-spaces, but humans are confused even if compilers a
utils: rename struct mem_region_t to struct mem_region
typedef mem_region_t mem_region_t;
... seems to work because they belong to different name-spaces, but humans are confused even if compilers are not.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
| 5f3c7ce4 | 12-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1197 from dp-arm/dp/amu
AMUv1 support |
| 53bfb94e | 11-Dec-2017 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Add hooks to save/restore AMU context for Cortex A75
Change-Id: I504d3f65ca5829bc1f4ebadb764931f8379ee81f Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com> |
| b6eb3932 | 28-Nov-2017 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
AMU: Add hooks to save/restore AMU context
On some systems, the AMU counters might reset to 0 when a CPU powerdown happens. This behaviour conflicts with the intended use-case of AMU as lower ELs a
AMU: Add hooks to save/restore AMU context
On some systems, the AMU counters might reset to 0 when a CPU powerdown happens. This behaviour conflicts with the intended use-case of AMU as lower ELs are only expected to see non-decreasing counter values.
Change-Id: If25519965d4e6e47e09225d0e732947986cbb5ec Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
show more ...
|