| dbcc44a1 | 26-May-2020 |
Alexei Fedorov <Alexei.Fedorov@arm.com> |
TF-A: Fix wrong register read for MPAM extension
This patch fixes wrong ID_AA64DFR0_EL1 register read instead of ID_AA64PFR0_EL1 to detect support for MPAM extension. It also implements get_mpam_ver
TF-A: Fix wrong register read for MPAM extension
This patch fixes wrong ID_AA64DFR0_EL1 register read instead of ID_AA64PFR0_EL1 to detect support for MPAM extension. It also implements get_mpam_version() function which returns MPAM version as: 0x00: None Armv8.0 or later; 0x01: v0.1 Armv8.4 or later; 0x10: v1.0 Armv8.2 or later; 0x11: v1.1 Armv8.4 or later;
Change-Id: I31d776b1a1b60cb16e5e62296d70adb129d7b760 Reported-by: Matteo Zini <matteozini96@gmail.com> Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
show more ...
|
| 6cac724d | 22-Apr-2020 |
johpow01 <john.powell@arm.com> |
Enable v8.6 WFE trap delays
This patch enables the v8.6 extension to add a delay before WFE traps are taken. A weak hook plat_arm_set_twedel_scr_el3 has been added in plat/common/aarch64/plat_common
Enable v8.6 WFE trap delays
This patch enables the v8.6 extension to add a delay before WFE traps are taken. A weak hook plat_arm_set_twedel_scr_el3 has been added in plat/common/aarch64/plat_common.c that disables this feature by default but platform-specific code can override it when needed.
The only hook provided sets the TWED fields in SCR_EL3, there are similar fields in HCR_EL2, SCTLR_EL2, and SCTLR_EL1 to control WFE trap delays in lower ELs but these should be configured by code running at EL2 and/or EL1 depending on the platform configuration and is outside the scope of TF-A.
Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I0a9bb814205efeab693a3d0a0623e62144abba2d
show more ...
|
| 1a04b2e5 | 17-May-2020 |
Varun Wadekar <vwadekar@nvidia.com> |
Fix compilation error when ENABLE_PIE=1
This patch fixes compilation errors when ENABLE_PIE=1.
<snip> bl31/aarch64/bl31_entrypoint.S: Assembler messages: bl31/aarch64/bl31_entrypoint.S:61: Error: i
Fix compilation error when ENABLE_PIE=1
This patch fixes compilation errors when ENABLE_PIE=1.
<snip> bl31/aarch64/bl31_entrypoint.S: Assembler messages: bl31/aarch64/bl31_entrypoint.S:61: Error: invalid operand (*UND* section) for `~' bl31/aarch64/bl31_entrypoint.S:61: Error: invalid immediate Makefile:1079: recipe for target 'build/tegra/t194/debug/bl31/bl31_entrypoint.o' failed <snip>
Verified by setting 'ENABLE_PIE=1' for Tegra platform builds.
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: Ifd184f89b86b4360fda86a6ce83fd8495f930bbc
show more ...
|
| 45aecff0 | 28-Apr-2020 |
Manish V Badarkhe <Manish.Badarkhe@arm.com> |
Implement workaround for AT speculative behaviour
During context switching from higher EL (EL2 or higher) to lower EL can cause incorrect translation in TLB due to speculative execution of AT instru
Implement workaround for AT speculative behaviour
During context switching from higher EL (EL2 or higher) to lower EL can cause incorrect translation in TLB due to speculative execution of AT instruction using out-of-context translation regime.
Workaround is implemented as below during EL's (EL1 or EL2) "context_restore" operation: 1. Disable page table walk using SCTLR.M and TCR.EPD0 & EPD1 bits for EL1 or EL2 (stage1 and stage2 disabled) 2. Save all system registers except TCR and SCTLR (for EL1 and EL2) 3. Do memory barrier operation (isb) to ensure all system register writes are done. 4. Restore TCR and SCTLR registers (for EL1 and EL2)
Errata details are available for various CPUs as below: Cortex-A76: 1165522 Cortex-A72: 1319367 Cortex-A57: 1319537 Cortex-A55: 1530923 Cortex-A53: 1530924
More details can be found in mail-chain: https://lists.trustedfirmware.org/pipermail/tf-a/2020-April/000445.html
Currently, Workaround is implemented as build option which is default disabled.
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com> Change-Id: If8545e61f782cb0c2dda7ffbaf50681c825bd2f0
show more ...
|
| 52696946 | 16-Apr-2020 |
Olivier Deprez <olivier.deprez@arm.com> |
SPMD: code/comments cleanup
As a follow-up to bdd2596d4, and related to SPM Dispatcher EL3 component and SPM Core S-EL2/S-EL1 component: update with cosmetic and coding rules changes. In addition: -
SPMD: code/comments cleanup
As a follow-up to bdd2596d4, and related to SPM Dispatcher EL3 component and SPM Core S-EL2/S-EL1 component: update with cosmetic and coding rules changes. In addition: -Add Armv8.4-SecEL2 arch detection helper. -Add an SPMC context (on current core) get helper. -Return more meaningful error return codes. -Remove complexity in few spmd_smc_handler switch-cases. -Remove unused defines and structures from spmd_private.h
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: I99e642450b0dafb19d3218a2f0e2d3107e8ca3fe
show more ...
|
| 9cf7f355 | 30-Oct-2019 |
Madhukar Pappireddy <madhukar.pappireddy@arm.com> |
Provide a hint to power controller for DSU cluster power down
By writing 0 to CLUSTERPWRDN DSU register bit 0, we send an advisory to the power controller that cluster power is not required when all
Provide a hint to power controller for DSU cluster power down
By writing 0 to CLUSTERPWRDN DSU register bit 0, we send an advisory to the power controller that cluster power is not required when all cores are powered down.
The AArch32 CLUSTERPWRDN register is architecturally mapped to the AArch64 CLUSTERPWRDN_EL1 register
Change-Id: Ie6e67c1c7d811fa25c51e2e405ca7f59bd20c81b Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
show more ...
|
| 11504163 | 02-Apr-2020 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
locks: bakery: use is_dcache_enabled() helper
bakery_lock_normal.c uses the raw register accessor, read_sctlr(_el3) to check whether the dcache is enabled.
Using is_dcache_enabled() is cleaner, and
locks: bakery: use is_dcache_enabled() helper
bakery_lock_normal.c uses the raw register accessor, read_sctlr(_el3) to check whether the dcache is enabled.
Using is_dcache_enabled() is cleaner, and a good abstraction for the library code like this.
A problem is is_dcache_enabled() is declared in the local header, lib/xlat_tables_v2/xlat_tables_private.h
I searched for a good place to declare this helper. Moving it to arch_helpers.h, closed to cache operation helpers, looks good enough to me.
I also changed the type of 'is_cached' to bool for consistency, and to avoid MISRA warnings.
Change-Id: I9b016f67bc8eade25c316aa9c0db0fa4cd375b79 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
| 3443a702 | 20-Mar-2020 |
John Powell <john.powell@arm.com> |
Fix MISRA C issues in BL1/BL2/BL31
Attempts to address MISRA compliance issues in BL1, BL2, and BL31 code. Mainly issues like not using boolean expressions in conditionals, conflicting variable name
Fix MISRA C issues in BL1/BL2/BL31
Attempts to address MISRA compliance issues in BL1, BL2, and BL31 code. Mainly issues like not using boolean expressions in conditionals, conflicting variable names, ignoring return values without (void), adding explicit casts, etc.
Change-Id: If1fa18ab621b9c374db73fa6eaa6f6e5e55c146a Signed-off-by: John Powell <john.powell@arm.com>
show more ...
|
| fd092be2 | 26-Mar-2020 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
Add get_current_el_maybe_constant()
There are some cases where we want to run EL-dependent code in the shared code.
We could use #ifdef, but it leaves slight possibility where we do not know the ex
Add get_current_el_maybe_constant()
There are some cases where we want to run EL-dependent code in the shared code.
We could use #ifdef, but it leaves slight possibility where we do not know the exception level at the build-time (e.g. library code).
The counter approach is to use get_current_el(), but it is run-time detection, so all EL code is linked, some of which might be unneeded.
This commit adds get_current_el_maybe_constant(). This is a static inline function that returns a constant value if we know the exception level at build-time. This is mostly the case.
if (get_current_el_maybe_constant() == 1) { /* do something for EL1 */ } else if (get_current_el_maybe_constant() == 3) { /* do something for EL3 */ }
If get_current_el_maybe_constant() is build-time constant, the compiler will optimize out the unreachable code.
If such code is included from the library code, it is not built-time constant. In this case, it falls back to get_current_el(), so it still works.
Change-Id: Idb03c20342a5b5173fe2d6b40e1fac7998675ad3 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
| 6cdd55d1 | 19-Mar-2020 |
Manish Pandey <manish.pandey2@arm.com> |
Merge "el3_entrypoint_common: avoid overwriting arg3" into integration |
| 8fd41bb9 | 12-Mar-2020 |
Mark Dykes <mardyk01@review.trustedfirmware.org> |
Merge "Use Speculation Barrier instruction for v8.5 cores" into integration |
| ccfb5c81 | 10-Mar-2020 |
Madhukar Pappireddy <madhukar.pappireddy@arm.com> |
Use Speculation Barrier instruction for v8.5 cores
Change-Id: Ie1018bfbae2fe95c699e58648665baa75e862000 Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com> |
| f9ea3a62 | 11-Mar-2020 |
Mark Dykes <mardyk01@review.trustedfirmware.org> |
Merge "Fix crash dump for lower EL" into integration |
| efe30cb1 | 09-Mar-2020 |
Mark Dykes <mardyk01@review.trustedfirmware.org> |
Merge "aarch32: stop speculative execution past exception returns" into integration |
| b4292bc6 | 03-Mar-2020 |
Alexei Fedorov <Alexei.Fedorov@arm.com> |
Fix crash dump for lower EL
This patch provides a fix for incorrect crash dump data for lower EL when TF-A is built with HANDLE_EA_EL3_FIRST=1 option which enables routing of External Aborts and SEr
Fix crash dump for lower EL
This patch provides a fix for incorrect crash dump data for lower EL when TF-A is built with HANDLE_EA_EL3_FIRST=1 option which enables routing of External Aborts and SErrors to EL3.
Change-Id: I9d5e6775e6aad21db5b78362da6c3a3d897df977 Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
show more ...
|
| 2825946e | 17-Feb-2020 |
Max Shvetsov <maksims.svecovs@arm.com> |
SPMD: Adds partially supported EL2 registers.
This patch adds EL2 registers that are supported up to ARMv8.6. ARM_ARCH_MINOR has to specified to enable save/restore routine.
Note: Following registe
SPMD: Adds partially supported EL2 registers.
This patch adds EL2 registers that are supported up to ARMv8.6. ARM_ARCH_MINOR has to specified to enable save/restore routine.
Note: Following registers are still not covered in save/restore. * AMEVCNTVOFF0<n>_EL2 * AMEVCNTVOFF1<n>_EL2 * ICH_AP0R<n>_EL2 * ICH_AP1R<n>_EL2 * ICH_LR<n>_EL2
Change-Id: I4813f3243e56e21cb297b31ef549a4b38d4876e1 Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
show more ...
|
| 28f39f02 | 25-Feb-2020 |
Max Shvetsov <maksims.svecovs@arm.com> |
SPMD: save/restore EL2 system registers.
NOTE: Not all EL-2 system registers are saved/restored. This subset includes registers recognized by ARMv8.0
Change-Id: I9993c7d78d8f5f8e72d1c6c8d6fd871283a
SPMD: save/restore EL2 system registers.
NOTE: Not all EL-2 system registers are saved/restored. This subset includes registers recognized by ARMv8.0
Change-Id: I9993c7d78d8f5f8e72d1c6c8d6fd871283aa3ce0 Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Signed-off-by: Artsem Artsemenka <artsem.artsemenka@arm.com> Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
show more ...
|
| 6bc24382 | 26-Feb-2020 |
Madhukar Pappireddy <madhukar.pappireddy@arm.com> |
aarch32: stop speculative execution past exception returns
aarch32 CPUs speculatively execute instructions following a ERET as if it was not a jump instruction. This could lead to cache-based side c
aarch32: stop speculative execution past exception returns
aarch32 CPUs speculatively execute instructions following a ERET as if it was not a jump instruction. This could lead to cache-based side channel vulnerabilities. The software fix is to place barrier instructions following ERET.
The counterpart patch for aarch64 is merged: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=f461fe346b728d0e88142fd7b8f2816415af18bc
Change-Id: I2aa3105bee0b92238f389830b3a3b8650f33af3d Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
show more ...
|
| 30f31005 | 28-Jan-2020 |
Yann Gautier <yann.gautier@st.com> |
el3_entrypoint_common: avoid overwriting arg3
At each BL entry point, the registers r9 to r12 are used to save info from the previous BL parameters put in r0 to r3. But zeromem uses r12, leading to
el3_entrypoint_common: avoid overwriting arg3
At each BL entry point, the registers r9 to r12 are used to save info from the previous BL parameters put in r0 to r3. But zeromem uses r12, leading to a corruption of arg3. Therefore this change copies r12 to r7 before zeromem() call and restores r12 afterwards. It may be better to save it in r7 in el3_arch_init_common and not at the entrypoint as r7 could be used in other functions, especially platform ones. This is a fix for Task T661.
Change-Id: Icc11990c69b5d4c542d08aca1a77b1f754b61a53 Signed-off-by: Yann Gautier <yann.gautier@st.com>
show more ...
|
| dd4f0885 | 18-Jun-2018 |
Varun Wadekar <vwadekar@nvidia.com> |
Tegra: delay_timer: support for physical secure timer
This patch modifies the delay timer driver to switch to the ARM secure physical timer instead of using Tegra's on-chip uS timer.
The secure tim
Tegra: delay_timer: support for physical secure timer
This patch modifies the delay timer driver to switch to the ARM secure physical timer instead of using Tegra's on-chip uS timer.
The secure timer is not accessible to the NS world and so eliminates an important attack vector, where the Tegra timer source gets switched off from the NS world leading to a DoS attack for the trusted world.
This timer is shared with the S-EL1 layer for now, but later patches will mark it as exclusive to the EL3 exception mode.
Change-Id: I2c00f8cb4c48b25578971c626c314603906ad7cc Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
show more ...
|
| 68c76088 | 06-Feb-2020 |
Alexei Fedorov <Alexei.Fedorov@arm.com> |
Make PAC demangling more generic
At the moment, address demangling is only used by the backtrace functionality. However, at some point, other parts of the TF-A codebase may want to use it. The 'dema
Make PAC demangling more generic
At the moment, address demangling is only used by the backtrace functionality. However, at some point, other parts of the TF-A codebase may want to use it. The 'demangle_address' function is replaced with a single XPACI instruction which is also added in 'do_crash_reporting()'.
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Change-Id: I4424dcd54d5bf0a5f9b2a0a84c4e565eec7329ec
show more ...
|
| f461fe34 | 07-Jan-2020 |
Anthony Steinhauser <asteinhauser@google.com> |
Prevent speculative execution past ERET
Even though ERET always causes a jump to another address, aarch64 CPUs speculatively execute following instructions as if the ERET instruction was not a jump
Prevent speculative execution past ERET
Even though ERET always causes a jump to another address, aarch64 CPUs speculatively execute following instructions as if the ERET instruction was not a jump instruction. The speculative execution does not cross privilege-levels (to the jump target as one would expect), but it continues on the kernel privilege level as if the ERET instruction did not change the control flow - thus execution anything that is accidentally linked after the ERET instruction. Later, the results of this speculative execution are always architecturally discarded, however they can leak data using microarchitectural side channels. This speculative execution is very reliable (seems to be unconditional) and it manages to complete even relatively performance-heavy operations (e.g. multiple dependent fetches from uncached memory).
This was fixed in Linux, FreeBSD, OpenBSD and Optee OS: https://github.com/torvalds/linux/commit/679db70801da9fda91d26caf13bf5b5ccc74e8e8 https://github.com/freebsd/freebsd/commit/29fb48ace4186a41c409fde52bcf4216e9e50b61 https://github.com/openbsd/src/commit/3a08873ece1cb28ace89fd65e8f3c1375cc98de2 https://github.com/OP-TEE/optee_os/commit/abfd092aa19f9c0251e3d5551e2d68a9ebcfec8a
It is demonstrated in a SafeSide example: https://github.com/google/safeside/blob/master/demos/eret_hvc_smc_wrapper.cc https://github.com/google/safeside/blob/master/kernel_modules/kmod_eret_hvc_smc/eret_hvc_smc_module.c
Signed-off-by: Anthony Steinhauser <asteinhauser@google.com> Change-Id: Iead39b0b9fb4b8d8b5609daaa8be81497ba63a0f
show more ...
|
| f8578e64 | 18-Oct-2018 |
Samuel Holland <samuel@sholland.org> |
bl31: Split into two separate memory regions
Some platforms are extremely memory constrained and must split BL31 between multiple non-contiguous areas in SRAM. Allow the NOBITS sections (.bss, stack
bl31: Split into two separate memory regions
Some platforms are extremely memory constrained and must split BL31 between multiple non-contiguous areas in SRAM. Allow the NOBITS sections (.bss, stacks, page tables, and coherent memory) to be placed in a separate region of RAM from the loaded firmware image.
Because the NOBITS region may be at a lower address than the rest of BL31, __RW_{START,END}__ and __BL31_{START,END}__ cannot include this region, or el3_entrypoint_common would attempt to invalidate the dcache for the entire address space. New symbols __NOBITS_{START,END}__ are added when SEPARATE_NOBITS_REGION is enabled, and the dcached for the NOBITS region is invalidated separately.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: Idedfec5e4dbee77e94f2fdd356e6ae6f4dc79d37
show more ...
|
| 2bcc672f | 13-Dec-2019 |
Olivier Deprez <olivier.deprez@arm.com> |
Merge changes from topic "aa/sel2_support" into integration
* changes: S-EL2 Support: Check for AArch64 Add support for enabling S-EL2 |
| da90359b | 26-Nov-2019 |
Manish Pandey <manish.pandey2@arm.com> |
PIE: make call to GDT relocation fixup generalized
When a Firmware is complied as Position Independent Executable it needs to request GDT fixup by passing size of the memory region to el3_entrypoint
PIE: make call to GDT relocation fixup generalized
When a Firmware is complied as Position Independent Executable it needs to request GDT fixup by passing size of the memory region to el3_entrypoint_common macro. The Global descriptor table fixup will be done early on during cold boot process of primary core.
Currently only BL31 supports PIE, but in future when BL2_AT_EL3 will be compiled as PIE, it can simply pass fixup size to the common el3 entrypoint macro to fixup GDT.
The reason for this patch was to overcome the bug introduced by SHA 330ead806 which called fixup routine for each core causing re-initializing of global pointers thus overwriting any changes done by the previous core.
Change-Id: I55c792cc3ea9e7eef34c2e4653afd04572c4f055 Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
show more ...
|