diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2020-08-25 07:45:34 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2020-09-01 07:41:38 -0700 |
commit | 3f203194550108a72e8ee55d1b8bcb2333222b71 (patch) | |
tree | 1dbce3f6dae4ff79dd29afd88e04742a0ddd4ed5 /target/microblaze/op_helper.c | |
parent | 287b1defeb44398d02669d97ebdc347d650f274d (diff) | |
download | qemu-3f203194550108a72e8ee55d1b8bcb2333222b71.zip |
target/microblaze: Fix cpu unwind for stackprot
Restore the correct PC when an exception must be raised.
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/microblaze/op_helper.c')
-rw-r--r-- | target/microblaze/op_helper.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index 2c59d4492d..a99c467364 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -389,12 +389,16 @@ void helper_memalign(CPUMBState *env, target_ulong addr, void helper_stackprot(CPUMBState *env, target_ulong addr) { if (addr < env->slr || addr > env->shr) { + CPUState *cs = env_cpu(env); + qemu_log_mask(CPU_LOG_INT, "Stack protector violation at " TARGET_FMT_lx " %x %x\n", addr, env->slr, env->shr); + env->ear = addr; env->esr = ESR_EC_STACKPROT; - helper_raise_exception(env, EXCP_HW_EXCP); + cs->exception_index = EXCP_HW_EXCP; + cpu_loop_exit_restore(cs, GETPC()); } } |