Skip to content

Commit

Permalink
target/ppc: Fix icount access for some hypervisor instructions
Browse files Browse the repository at this point in the history
Several instructions and register access require icount reads and are
missing translator_io_start().

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20230625103700.8992-1-npiggin@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
npiggin authored and danielhb committed Jul 7, 2023
1 parent bc65beb commit c32654a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions target/ppc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@ void spr_write_tfmr(DisasContext *ctx, int sprn, int gprn)

void spr_write_lpcr(DisasContext *ctx, int sprn, int gprn)
{
translator_io_start(&ctx->base);
gen_helper_store_lpcr(cpu_env, cpu_gpr[gprn]);
}
#endif /* !defined(CONFIG_USER_ONLY) */
Expand Down Expand Up @@ -4012,6 +4013,7 @@ static void gen_doze(DisasContext *ctx)
TCGv_i32 t;

CHK_HV(ctx);
translator_io_start(&ctx->base);
t = tcg_constant_i32(PPC_PM_DOZE);
gen_helper_pminsn(cpu_env, t);
/* Stop translation, as the CPU is supposed to sleep from now */
Expand All @@ -4027,6 +4029,7 @@ static void gen_nap(DisasContext *ctx)
TCGv_i32 t;

CHK_HV(ctx);
translator_io_start(&ctx->base);
t = tcg_constant_i32(PPC_PM_NAP);
gen_helper_pminsn(cpu_env, t);
/* Stop translation, as the CPU is supposed to sleep from now */
Expand All @@ -4042,6 +4045,7 @@ static void gen_stop(DisasContext *ctx)
TCGv_i32 t;

CHK_HV(ctx);
translator_io_start(&ctx->base);
t = tcg_constant_i32(PPC_PM_STOP);
gen_helper_pminsn(cpu_env, t);
/* Stop translation, as the CPU is supposed to sleep from now */
Expand All @@ -4057,6 +4061,7 @@ static void gen_sleep(DisasContext *ctx)
TCGv_i32 t;

CHK_HV(ctx);
translator_io_start(&ctx->base);
t = tcg_constant_i32(PPC_PM_SLEEP);
gen_helper_pminsn(cpu_env, t);
/* Stop translation, as the CPU is supposed to sleep from now */
Expand All @@ -4072,6 +4077,7 @@ static void gen_rvwinkle(DisasContext *ctx)
TCGv_i32 t;

CHK_HV(ctx);
translator_io_start(&ctx->base);
t = tcg_constant_i32(PPC_PM_RVWINKLE);
gen_helper_pminsn(cpu_env, t);
/* Stop translation, as the CPU is supposed to sleep from now */
Expand Down Expand Up @@ -4468,6 +4474,7 @@ static void gen_hrfid(DisasContext *ctx)
#else
/* Restore CPU state */
CHK_HV(ctx);
translator_io_start(&ctx->base);
gen_helper_hrfid(cpu_env);
ctx->base.is_jmp = DISAS_EXIT;
#endif
Expand Down

0 comments on commit c32654a

Please sign in to comment.