Add support for Branch Target Identification
authorAlexei Fedorov <Alexei.Fedorov@arm.com>
Fri, 24 May 2019 11:17:09 +0000 (12:17 +0100)
committerAlexei Fedorov <Alexei.Fedorov@arm.com>
Fri, 24 May 2019 13:44:45 +0000 (14:44 +0100)
commit9fc59639e649f614318f78ae2ca103fe102405ec
treedc3edbb0a38dcc6b033c088dbaa156cfec653baa
parentced1711297347f24fee45e75e73c7767507a0982
Add support for Branch Target Identification

This patch adds the functionality needed for platforms to provide
Branch Target Identification (BTI) extension, introduced to AArch64
in Armv8.5-A by adding BTI instruction used to mark valid targets
for indirect branches. The patch sets new GP bit [50] to the stage 1
Translation Table Block and Page entries to denote guarded EL3 code
pages which will cause processor to trap instructions in protected
pages trying to perform an indirect branch to any instruction other
than BTI.
BTI feature is selected by BRANCH_PROTECTION option which supersedes
the previous ENABLE_PAUTH used for Armv8.3-A Pointer Authentication
and is disabled by default. Enabling BTI requires compiler support
and was tested with GCC versions 9.0.0, 9.0.1 and 10.0.0.
The assembly macros and helpers are modified to accommodate the BTI
instruction.
This is an experimental feature.
Note. The previous ENABLE_PAUTH build option to enable PAuth in EL3
is now made as an internal flag and BRANCH_PROTECTION flag should be
used instead to enable Pointer Authentication.
Note. USE_LIBROM=1 option is currently not supported.

Change-Id: Ifaf4438609b16647dc79468b70cd1f47a623362e
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
22 files changed:
Makefile
bl1/bl1.mk
bl2/aarch64/bl2_el3_entrypoint.S
bl2/aarch64/bl2_entrypoint.S
bl2/bl2.mk
bl31/aarch64/bl31_entrypoint.S
bl31/bl31.mk
bl32/tsp/aarch64/tsp_entrypoint.S
bl32/tsp/tsp.mk
docs/design/firmware-design.rst
docs/getting_started/user-guide.rst
include/arch/aarch64/arch.h
include/arch/aarch64/arch_features.h
include/arch/aarch64/asm_macros.S
include/common/asm_macros_common.S
include/lib/xlat_tables/xlat_tables_defs.h
lib/aarch64/cache_helpers.S
lib/cpus/aarch64/cpuamu_helpers.S
lib/extensions/amu/aarch64/amu_helpers.S
lib/xlat_tables_v2/xlat_tables_core.c
lib/xlat_tables_v2/xlat_tables_utils.c
make_helpers/defaults.mk