SSBS: init SPSR register with default SSBS value
authorJohn Tsichritzis <john.tsichritzis@arm.com>
Tue, 23 Jul 2019 10:12:41 +0000 (11:12 +0100)
committerJohn Tsichritzis <john.tsichritzis@arm.com>
Wed, 24 Jul 2019 11:49:53 +0000 (12:49 +0100)
commitc250cc3b1be497c4262e781df4e55c9ecf18bbd1
tree10f9c7158360a3130968ce9c139671469e76e358
parentb514ee86c4354a8fae21f853bc8d9c6728543267
SSBS: init SPSR register with default SSBS value

This patch introduces an additional precautionary step to further
enhance protection against variant 4. During the context initialisation
before we enter the various BL stages, the SPSR.SSBS bit is explicitly
set to zero. As such, speculative loads/stores are by default disabled
for all BL stages when they start executing. Subsequently, each BL
stage, can choose to enable speculative loads/stores or keep them
disabled.

This change doesn't affect the initial execution context of BL33 which
is totally platform dependent and, thus, it is intentionally left up to
each platform to initialise.

For Arm platforms, SPSR.SSBS is set to zero for BL33 too. This means
that, for Arm platforms, all BL stages start with speculative
loads/stores disabled.

Change-Id: Ie47d39c391d3f20fc2852fc59dbd336f8cacdd6c
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
include/arch/aarch32/arch.h
include/arch/aarch64/arch.h