Commit ee6ff1bb authored by Jeenu Viswambharan's avatar Jeenu Viswambharan
Browse files

RAS: Validate stack pointer after error handling



RAS handling flows might involve using setjmp/longjump calls introduced
in earlier patches; therefore, it'd be good to make sure the stack has
been unwound completely after the handling.

This patch inserts ASM assertions on the RAS handling path to validate
stack.

Change-Id: I59d40d3122010c977cdeab3cce3160f3909e7e69
Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
parent df8f3188
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <asm_macros.S> #include <asm_macros.S>
#include <assert_macros.S>
#include <context.h> #include <context.h>
#include <ea_handle.h> #include <ea_handle.h>
...@@ -143,9 +144,24 @@ func ea_proceed ...@@ -143,9 +144,24 @@ func ea_proceed
mov sp, x5 mov sp, x5
mov x29, x30 mov x29, x30
#if ENABLE_ASSERTIONS
/* Stash the stack pointer */
mov x28, sp
#endif
bl plat_ea_handler bl plat_ea_handler
mov x30, x29 mov x30, x29
#if ENABLE_ASSERTIONS
/*
* Error handling flows might involve long jumps; so upon returning from
* the platform error handler, validate that the we've completely
* unwound the stack.
*/
mov x27, sp
cmp x28, x27
ASM_ASSERT(eq)
#endif
/* Make SP point to context */ /* Make SP point to context */
msr spsel, #1 msr spsel, #1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment