commit | efabaa90e39443bf6f96bdd52b148f9691795b8f | [log] [tgz] |
---|---|---|
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | Thu Apr 27 13:30:22 2017 +0100 |
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | Tue May 02 15:34:01 2017 +0100 |
tree | ca2de540bfb5a40e8be469e3a0d10d51687dc404 | |
parent | 014f833afd7786fe0b37c43e450c83aed31e18cd [diff] |
Fix execute-never permissions in xlat tables libs Translation regimes that only support one virtual address space (such as the ones for EL2 and EL3) can flag memory regions as execute-never by setting to 1 the XN bit in the Upper Attributes field in the translation tables descriptors. Translation regimes that support two different virtual address spaces (such as the one shared by EL1 and EL0) use bits PXN and UXN instead. The Trusted Firmware runs at EL3 and EL1, it has to handle translation tables of both translation regimes, but the previous code handled both regimes the same way, as if both had only 1 VA range. When trying to set a descriptor as execute-never it would set the XN bit correctly in EL3, but it would set the XN bit in EL1 as well. XN is at the same bit position as UXN, which means that EL0 was being prevented from executing code at this region, not EL1 as the code intended. Therefore, the PXN bit was unset to 0 all the time. The result is that, in AArch64 mode, read-only data sections of BL2 weren't protected from being executed. This patch adds support of translation regimes with two virtual address spaces to both versions of the translation tables library, fixing the execute-never permissions for translation tables in EL1. The library currently does not support initializing translation tables for EL0 software, therefore it does not set/unset the UXN bit. If EL1 software needs to initialize translation tables for EL0 software, it should use a different library instead. Change-Id: If27588f9820ff42988851d90dc92801c8ecbe0c9 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
ARM Trusted Firmware provides a reference implementation of secure world software for ARMv8-A, including a [Secure Monitor] TEE-SMC executing at Exception Level 3 (EL3). It implements various ARM interface standards, such as the Power State Coordination Interface (PSCI), Trusted Board Boot Requirements (TBBR, ARM DEN0006C-1) and SMC Calling Convention. As far as possible the code is designed for reuse or porting to other ARMv8-A model and hardware platforms.
ARM will continue development in collaboration with interested parties to provide a full reference implementation of PSCI, TBBR and Secure Monitor code to the benefit of all developers working with ARMv8-A TrustZone technology.
The software is provided under a BSD-3-Clause license. Contributions to this project are accepted under the same license with developer sign-off as described in the Contributing Guidelines.
This project contains code from other projects as listed below. The original license text is included in those source files.
The stdlib source code is derived from FreeBSD code.
The libfdt source code is dual licensed. It is used by this project under the terms of the BSD-2-Clause license.
This release provides a suitable starting point for productization of secure world boot and runtime firmware, executing in either the AArch32 or AArch64 execution state.
Users are encouraged to do their own security validation, including penetration testing, on any secure world code derived from ARM Trusted Firmware.
Initialization of the secure world (for example, exception vectors, control registers, interrupt controller and interrupts for the platform), before transitioning into the normal world at the Exception Level and Register Width specified by the platform.
Library support for CPU specific reset and power down sequences. This includes support for errata workarounds.
Drivers for both versions 2.0 and 3.0 of the ARM Generic Interrupt Controller specifications (GICv2 and GICv3). The latter also enables GICv3 hardware systems that do not contain legacy GICv2 support.
Drivers to enable standard initialization of ARM System IP, for example Cache Coherent Interconnect (CCI), Cache Coherent Network (CCN), Network Interconnect (NIC) and TrustZone Controller (TZC).
SMC (Secure Monitor Call) handling, conforming to the SMC Calling Convention using an EL3 runtime services framework.
PSCI library support for the Secondary CPU Boot, CPU Hotplug, CPU Idle and System Shutdown/Reset/Suspend use-cases. This library is pre-integrated with the provided AArch64 EL3 Runtime Software, and is also suitable for integration into other EL3 Runtime Software.
A minimal AArch32 Secure Payload to demonstrate PSCI library integration on platforms with AArch32 EL3 Runtime Software.
Secure Monitor library code such as world switching, EL1 context management and interrupt routing. When using the provided AArch64 EL3 Runtime Software, this must be integrated with a Secure-EL1 Payload Dispatcher (SPD) component to customize the interaction with a Secure-EL1 Payload (SP), for example a Secure OS.
A Test Secure-EL1 Payload and Dispatcher to demonstrate AArch64 Secure Monitor functionality and Secure-EL1 interaction with PSCI.
AArch64 SPDs for the OP-TEE Secure OS and [NVidia Trusted Little Kernel] NVidia TLK.
A Trusted Board Boot implementation, conforming to all mandatory TBBR requirements. This includes image authentication using certificates, a Firmware Update (or recovery mode) boot flow, and packaging of the various firmware images into a Firmware Image Package (FIP) to be loaded from non-volatile storage. The TBBR implementation is currently only supported in the AArch64 build.
Support for alternative boot flows. Some platforms have their own boot firmware and only require the AArch64 EL3 Runtime Software provided by this project. Other platforms require minimal initialization before booting into an arbitrary EL3 payload.
For a full description of functionality and implementation details, please see the Firmware Design and supporting documentation. The Change Log provides details of changes made since the last release.
The AArch64 build of this release has been tested on variants r0, r1 and r2 of the [Juno ARM Development Platform] Juno with Linaro Release 16.06.
The AArch64 build of this release has been tested on the following ARM FVPs (64-bit host machine only, with Linaro Release 16.06):
Foundation_Platform
(Version 10.1, Build 10.1.32)FVP_Base_AEMv8A-AEMv8A
(Version 7.7, Build 0.8.7701)FVP_Base_Cortex-A57x4-A53x4
(Version 7.7, Build 0.8.7701)FVP_Base_Cortex-A57x1-A53x1
(Version 7.7, Build 0.8.7701)FVP_Base_Cortex-A57x2-A53x4
(Version 7.7, Build 0.8.7701)The AArch32 build of this release has been tested on the following ARM FVPs (64-bit host machine only, with Linaro Release 16.06):
FVP_Base_AEMv8A-AEMv8A
(Version 7.7, Build 0.8.7701)FVP_Base_Cortex-A32x4
(Version 10.1, Build 10.1.32)The Foundation FVP can be downloaded free of charge. The Base FVPs can be licensed from ARM: see [www.arm.com/fvp] FVP.
This release also contains the following platform support:
AArch32 TBBR support and ongoing TBBR alignment.
More platform support.
Ongoing support for new architectural features, CPUs and System IP.
Ongoing PSCI alignment and feature support.
Ongoing security hardening, optimization and quality improvements.
For a full list of detailed issues in the current code, please see the Change Log and the GitHub issue tracker.
Get the Trusted Firmware source code from GitHub.
See the User Guide for instructions on how to install, build and use the Trusted Firmware with the ARM FVPs.
See the Firmware Design for information on how the ARM Trusted Firmware works.
See the Porting Guide as well for information about how to use this software on another ARMv8-A platform.
See the Contributing Guidelines for information on how to contribute to this project and the Acknowledgments file for a list of contributors to the project.
ARM welcomes any feedback on the Trusted Firmware. Please send feedback using the GitHub issue tracker.
ARM licensees may contact ARM directly via their partner managers.
Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.