* [Qemu-devel] [PATCH] target-mips: save cpu state before calling MSA load and store helpers
@ 2015-03-16 16:29 Leon Alrae
2015-03-30 19:01 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Leon Alrae @ 2015-03-16 16:29 UTC (permalink / raw)
To: qemu-devel; +Cc: aurelien
PC needs to be saved if an exception can be generated by an helper.
This fixes a problem related to resuming the execution at unexpected address
after an exception (caused by MSA load/store instruction) has been serviced.
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
target-mips/translate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 9059bfd..7a8a00e 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -18403,12 +18403,14 @@ static void gen_msa(CPUMIPSState *env, DisasContext *ctx)
case OPC_LD_H:
case OPC_LD_W:
case OPC_LD_D:
+ save_cpu_state(ctx, 1);
gen_helper_msa_ld_df(cpu_env, tdf, twd, trs, ts10);
break;
case OPC_ST_B:
case OPC_ST_H:
case OPC_ST_W:
case OPC_ST_D:
+ save_cpu_state(ctx, 1);
gen_helper_msa_st_df(cpu_env, tdf, twd, trs, ts10);
break;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] target-mips: save cpu state before calling MSA load and store helpers
2015-03-16 16:29 [Qemu-devel] [PATCH] target-mips: save cpu state before calling MSA load and store helpers Leon Alrae
@ 2015-03-30 19:01 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2015-03-30 19:01 UTC (permalink / raw)
To: Leon Alrae, qemu-devel; +Cc: aurelien
On 03/16/2015 09:29 AM, Leon Alrae wrote:
> PC needs to be saved if an exception can be generated by an helper.
> This fixes a problem related to resuming the execution at unexpected address
> after an exception (caused by MSA load/store instruction) has been serviced.
Only if the helper doesn't use cpu_restore_state.
In this case, all of your do_##name memory routines should
instead use helper_[lb]e_*_mmu, which allows you to pass along
the mmu_idx (instead of switching on _kernel et al), and the
GETRA() value in the top-level helper.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-30 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-16 16:29 [Qemu-devel] [PATCH] target-mips: save cpu state before calling MSA load and store helpers Leon Alrae
2015-03-30 19:01 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).