]> git.sur5r.net Git - u-boot/commit
ARM: Add an empty secure stack section
authorChen-Yu Tsai <wens@csie.org>
Sun, 19 Jun 2016 04:38:36 +0000 (12:38 +0800)
committerHans de Goede <hdegoede@redhat.com>
Fri, 15 Jul 2016 13:54:57 +0000 (15:54 +0200)
commit980d6a55119f757ade4abed88bf4b2b7494c68e6
treef11b15b64c4a0a4a303178c68cf281232d416e2c
parentdbf38aabd9f4d4fd4d9bd4eeeba88e0e47dcb27c
ARM: Add an empty secure stack section

Until now we've been using memory beyond psci_text_end as stack space
for the secure monitor or PSCI implementation, even if space was not
allocated for it.

This was partially fixed in ("ARM: allocate extra space for PSCI stack
in secure section during link phase"). However, calculating stack space
from psci_text_end in one place, while allocating the space in another
is error prone.

This patch adds a separate empty secure stack section, with space for
CONFIG_ARMV7_PSCI_NR_CPUS stacks, each 1 KB. There's also
__secure_stack_start and __secure_stack_end symbols. The linker script
handles calculating the correct VMAs for the stack section. For
platforms that relocate/copy the secure monitor before using it, the
space is not allocated in the executable, saving space.

For platforms that do not define CONFIG_ARMV7_PSCI_NR_CPUS, a whole page
of stack space for 4 CPUs is allocated, matching the previous behavior.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
arch/arm/cpu/u-boot.lds
arch/arm/include/asm/armv7.h
arch/arm/include/asm/psci.h
arch/arm/lib/sections.c