From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen-Yu Tsai Date: Mon, 23 May 2016 20:41:40 +0800 Subject: [U-Boot] [PATCH 04/10] ARM: allocate extra space for PSCI stack in secure section during link phase In-Reply-To: <1464007306-30269-1-git-send-email-wens@csie.org> References: <1464007306-30269-1-git-send-email-wens@csie.org> Message-ID: <1464007306-30269-5-git-send-email-wens@csie.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The PSCI implementation expects at most 2 pages worth of space reserved at the end of the secure section for its stacks. This was not properly marked and taken into consideration when reserving memory from the kernel. If one accesses PSCI after Linux has fully booted, the memory that should have been reserved for the PSCI stacks may have been used by the kernel or userspace, and would be corrupted. Observed after effects include the system hanging or telinit core dumping when trying to reboot. It seems the init process gets hit the most on my test bed. This fix is only a stop gap. It would be better to rework the stack allocation mechanism, maybe with proper usage of CONFIG_ macros and an explicit symbol. Signed-off-by: Chen-Yu Tsai --- arch/arm/cpu/u-boot.lds | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index cfab8b041234..c7f37b606ad5 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -67,6 +67,9 @@ SECTIONS SIZEOF(.__secure_start) + SIZEOF(.secure_text); + /* Align to page boundary and skip 2 pages */ + . = (. & ~ 0xfff) + 0x2000; + __secure_end_lma = .; .__secure_end : AT(__secure_end_lma) { *(.__secure_end) -- 2.8.1