OSDN Git Service

target/arm: Restore SPSEL to correct CONTROL register on exception return
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 6 Oct 2017 15:46:48 +0000 (16:46 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 6 Oct 2017 15:46:48 +0000 (16:46 +0100)
commit3f0cddeee1f266d43c956581f3050058360a810d
tree296d08b674ac4debe7505b9b5547ce1eb6894174
parent3919e60b6efd9a86a0e6ba637aa584222855ac3a
target/arm: Restore SPSEL to correct CONTROL register on exception return

On exception return for v8M, the SPSEL bit in the EXC_RETURN magic
value should be restored to the SPSEL bit in the CONTROL register
banked specified by the EXC_RETURN.ES bit.

Add write_v7m_control_spsel_for_secstate() which behaves like
write_v7m_control_spsel() but allows the caller to specify which
CONTROL bank to use, reimplement write_v7m_control_spsel() in
terms of it, and use it in exception return.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 1506092407-26985-6-git-send-email-peter.maydell@linaro.org
target/arm/helper.c