[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 16/22] target/ppc: fix mtmsr instruction for icount
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 16/22] target/ppc: fix mtmsr instruction for icount |
Date: |
Thu, 8 Nov 2018 23:16:40 +1100 |
From: Pavel Dovgalyuk <address@hidden>
This patch fixes processing of mtmsr 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 <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/translate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index c999832426..fb18cedcf0 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -4298,11 +4298,17 @@ static void gen_mtmsrd(DisasContext *ctx)
* if we enter power saving mode, we will exit the loop
* directly from ppc_store_msr
*/
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_nip(ctx, ctx->base.pc_next);
gen_helper_store_msr(cpu_env, cpu_gpr[rS(ctx->opcode)]);
/* Must stop the translation as machine state (may have) changed */
/* Note that mtmsr is not always defined as context-synchronizing */
gen_stop_exception(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
}
#endif /* !defined(CONFIG_USER_ONLY) */
}
@@ -4327,6 +4333,9 @@ static void gen_mtmsr(DisasContext *ctx)
* if we enter power saving mode, we will exit the loop
* directly from ppc_store_msr
*/
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_nip(ctx, ctx->base.pc_next);
#if defined(TARGET_PPC64)
tcg_gen_deposit_tl(msr, cpu_msr, cpu_gpr[rS(ctx->opcode)], 0, 32);
@@ -4334,6 +4343,9 @@ static void gen_mtmsr(DisasContext *ctx)
tcg_gen_mov_tl(msr, cpu_gpr[rS(ctx->opcode)]);
#endif
gen_helper_store_msr(cpu_env, msr);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
tcg_temp_free(msr);
/* Must stop the translation as machine state (may have) changed */
/* Note that mtmsr is not always defined as context-synchronizing */
--
2.19.1
- [Qemu-ppc] [PULL 22/22] ppc/spapr_caps: Add SPAPR_CAP_NESTED_KVM_HV, (continued)
- [Qemu-ppc] [PULL 07/22] target/ppc: Remove float_check_status, David Gibson, 2018/11/08
- [Qemu-ppc] [PULL 15/22] hw/ppc/mac_newworld: Free openpic_irqs array after use, David Gibson, 2018/11/08
- [Qemu-ppc] [PULL 14/22] macio/pmu: Fix missing vmsd terminator, David Gibson, 2018/11/08
- [Qemu-ppc] [PULL 16/22] target/ppc: fix mtmsr instruction for icount,
David Gibson <=
- [Qemu-ppc] [PULL 21/22] target/ppc: Add one reg id for ptcr, David Gibson, 2018/11/08
- [Qemu-ppc] [PULL 17/22] ppc/pnv: check size before data buffer access, David Gibson, 2018/11/08
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/22] ppc-for-3.1 queue 20181108, Eric Blake, 2018/11/08