aboutsummaryrefslogtreecommitdiffstats
path: root/make_helpers/defaults.mk
diff options
context:
space:
mode:
authorPetre-Ionut Tudor <petre-ionut.tudor@arm.com>2019-11-07 15:18:03 +0000
committerPetre-Ionut Tudor <petre-ionut.tudor@arm.com>2020-02-24 16:52:56 +0000
commit60e8f3cfd5910c59c9a573ce05bd61091336b09a (patch)
tree9e9c5b42ad746d56aaede8634501f2c71c9e68b9 /make_helpers/defaults.mk
parent2f39c55c085ae92b6eead06172096410e5aab81c (diff)
downloadplatform_external_arm-trusted-firmware-60e8f3cfd5910c59c9a573ce05bd61091336b09a.tar.gz
platform_external_arm-trusted-firmware-60e8f3cfd5910c59c9a573ce05bd61091336b09a.tar.bz2
platform_external_arm-trusted-firmware-60e8f3cfd5910c59c9a573ce05bd61091336b09a.zip
Read-only xlat tables for BL31 memory
This patch introduces a build flag which allows the xlat tables to be mapped in a read-only region within BL31 memory. It makes it much harder for someone who has acquired the ability to write to arbitrary secure memory addresses to gain control of the translation tables. The memory attributes of the descriptors describing the tables themselves are changed to read-only secure data. This change happens at the end of BL31 runtime setup. Until this point, the tables have read-write permissions. This gives a window of opportunity for changes to be made to the tables with the MMU on (e.g. reclaiming init code). No changes can be made to the tables with the MMU turned on from this point onwards. This change is also enabled for sp_min and tspd. To make all this possible, the base table was moved to .rodata. The penalty we pay is that now .rodata must be aligned to the size of the base table (512B alignment). Still, this is better than putting the base table with the higher level tables in the xlat_table section, as that would cost us a full 4KB page. Changing the tables from read-write to read-only cannot be done with the MMU on, as the break-before-make sequence would invalidate the descriptor which resolves the level 3 page table where that very descriptor is located. This would make the translation required for writing the changes impossible, generating an MMU fault. The caches are also flushed. Signed-off-by: Petre-Ionut Tudor <petre-ionut.tudor@arm.com> Change-Id: Ibe5de307e6dc94c67d6186139ac3973516430466
Diffstat (limited to 'make_helpers/defaults.mk')
-rw-r--r--make_helpers/defaults.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
index e8e990d45..60958a1d1 100644
--- a/make_helpers/defaults.mk
+++ b/make_helpers/defaults.mk
@@ -207,6 +207,13 @@ USE_FCONF_BASED_IO := 0
# Build option to choose whether Trusted Firmware uses library at ROM
USE_ROMLIB := 0
+# Build option to choose whether the xlat tables of BL images can be read-only.
+# Note that this only serves as a higher level option to PLAT_RO_XLAT_TABLES,
+# which is the per BL-image option that actually enables the read-only tables
+# API. The reason for having this additional option is to have a common high
+# level makefile where we can check for incompatible features/build options.
+ALLOW_RO_XLAT_TABLES := 0
+
# Chain of trust.
COT := tbbr