Skip to content

Commit

Permalink
ppc: Fix CFAR updates
Browse files Browse the repository at this point in the history
We were one instruction off

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
ozbenh authored and dgibson committed Sep 7, 2016
1 parent c9f82d0 commit fbc3b39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions target-ppc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ static void gen_b(DisasContext *ctx)
if (LK(ctx->opcode)) {
gen_setlr(ctx, ctx->nip);
}
gen_update_cfar(ctx, ctx->nip);
gen_update_cfar(ctx, ctx->nip - 4);
gen_goto_tb(ctx, 0, target);
}

Expand Down Expand Up @@ -3411,7 +3411,7 @@ static inline void gen_bcond(DisasContext *ctx, int type)
}
tcg_temp_free_i32(temp);
}
gen_update_cfar(ctx, ctx->nip);
gen_update_cfar(ctx, ctx->nip - 4);
if (type == BCOND_IM) {
target_ulong li = (target_long)((int16_t)(BD(ctx->opcode)));
if (likely(AA(ctx->opcode) == 0)) {
Expand Down Expand Up @@ -3526,7 +3526,7 @@ static void gen_rfi(DisasContext *ctx)
*/
/* Restore CPU state */
CHK_SV;
gen_update_cfar(ctx, ctx->nip);
gen_update_cfar(ctx, ctx->nip - 4);
gen_helper_rfi(cpu_env);
gen_sync_exception(ctx);
#endif
Expand All @@ -3540,7 +3540,7 @@ static void gen_rfid(DisasContext *ctx)
#else
/* Restore CPU state */
CHK_SV;
gen_update_cfar(ctx, ctx->nip);
gen_update_cfar(ctx, ctx->nip - 4);
gen_helper_rfid(cpu_env);
gen_sync_exception(ctx);
#endif
Expand Down

0 comments on commit fbc3b39

Please sign in to comment.