aboutsummaryrefslogtreecommitdiff
path: root/target/ppc
diff options
context:
space:
mode:
authorMaria Klimushenkova <maria.klimushenkova@ispras.ru>2018-10-30 15:21:34 +0300
committerDavid Gibson <david@gibson.dropbear.id.au>2018-11-08 12:09:24 +1100
commita59d628f92d8b27deb67387cd26642c3ffac2b06 (patch)
treec009bd93d587f1a6f03fdbdf857291072a9b74b3 /target/ppc
parent09a333ee3dbbc6cdd88830f5b68dc358cacb0093 (diff)
downloadqemu-a59d628f92d8b27deb67387cd26642c3ffac2b06.zip
qemu-a59d628f92d8b27deb67387cd26642c3ffac2b06.tar.gz
qemu-a59d628f92d8b27deb67387cd26642c3ffac2b06.tar.bz2
This patch fixes processing of rfi instructions in icount mode.
In this mode writing to interrupt/peripheral state is controlled by can_do_io flag. This flag must be set explicitly before helper function invocation. Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc')
-rw-r--r--target/ppc/translate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index fb18ced..2b37910 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3919,9 +3919,15 @@ static void gen_rfi(DisasContext *ctx)
}
/* Restore CPU state */
CHK_SV;
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_cfar(ctx, ctx->base.pc_next - 4);
gen_helper_rfi(cpu_env);
gen_sync_exception(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
#endif
}
@@ -3933,9 +3939,15 @@ static void gen_rfid(DisasContext *ctx)
#else
/* Restore CPU state */
CHK_SV;
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_cfar(ctx, ctx->base.pc_next - 4);
gen_helper_rfid(cpu_env);
gen_sync_exception(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
#endif
}