]> git.proxmox.com Git - mirror_qemu.git/commit - target/arm/helper.c
target/arm: Don't switch to target stack early in v7M exception return
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 6 Oct 2017 15:46:47 +0000 (16:46 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 6 Oct 2017 15:46:47 +0000 (16:46 +0100)
commit5b5223997c04b769bb362767cecb5f7ec382c5f0
tree5bf3bccfa955fdd713cd19030fa52e121fed8e81
parent8ff26a3344b6e6d1eeb00b4043232a5bdbc0ebf9
target/arm: Don't switch to target stack early in v7M exception return

Currently our M profile exception return code switches to the
target stack pointer relatively early in the process, before
it tries to pop the exception frame off the stack. This is
awkward for v8M for two reasons:
 * in v8M the process vs main stack pointer is not selected
   purely by the value of CONTROL.SPSEL, so updating SPSEL
   and relying on that to switch to the right stack pointer
   won't work
 * the stack we should be reading the stack frame from and
   the stack we will eventually switch to might not be the
   same if the guest is doing strange things

Change our exception return code to use a 'frame pointer'
to read the exception frame rather than assuming that we
can switch the live stack pointer this early.

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