On 09/22/2017 10:59 AM, Peter Maydell wrote:
> ARM v8M specifies that the INVPC usage fault for mismatched
> xPSR exception field and handler mode bit should be checked
> before updating the PSR and SP, so that the fault is taken
> with the existing stack frame rather than by pushing a new one.
> Perform this check in the right place for v8M.
> 
> Since v7M specifies in its pseudocode that this usage fault
> check should happen later, we have to retain the original
> code for that check rather than being able to merge the two.
> (The distinction is architecturally visible but only in
> very obscure corner cases like attempting an invalid exception
> return with an exception frame in read only memory.)
> 
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
>  target/arm/helper.c | 30 +++++++++++++++++++++++++++---
>  1 file changed, 27 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~


Reply via email to