[U-Boot] [PATCH 2/2] microblaze: Support stack protection feature

Michal Simek michal.simek at xilinx.com
Wed Jan 14 09:47:57 CET 2015


Ensure that stack didn't rewrite important part
of u-boot.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 arch/microblaze/cpu/start.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index f46603142d85..84c29e54091e 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -23,11 +23,15 @@ _start:

 	mts	rmsr, r0	/* disable cache */

+	addi	r8, r0, __end
+	mts	rslr, r8
 #if defined(CONFIG_SPL_BUILD)
 	addi	r1, r0, CONFIG_SPL_STACK_ADDR
+	mts	rshr, r1
 	addi	r1, r1, -4	/* Decrement SP to top of memory */
 #else
 	addi	r1, r0, CONFIG_SYS_INIT_SP_OFFSET
+	mts	rshr, r1
 	addi	r1, r1, -4	/* Decrement SP to top of memory */

 	/* Find-out if u-boot is running on BIG/LITTLE endian platform
--
1.8.2.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150114/b643a2cd/attachment.pgp>


More information about the U-Boot mailing list