Thanks Richard! I have fixed it following your advice:
diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc
index 528c30c9a2..acd2548e9b 100644
--- a/target/riscv/insn_trans/trans_rvi.c.inc
+++ b/target/riscv/insn_trans/trans_rvi.c.inc
@@ -808,9 +808,13 @@ static bool trans_pause(DisasContext *ctx, arg_pause *a)
/*
* PAUSE is a no-op in QEMU,
- * however we need to clear the reservation
+ * however we need to clear the reservation,
+ * end the TB and return to main loop
*/
tcg_gen_movi_tl(load_res, -1);
+ gen_set_pc_imm(ctx, ctx->pc_succ_insn);
+ tcg_gen_exit_tb(NULL, 0);
+ ctx->base.is_jmp = DISAS_NORETURN;
return true;
}
I will wait a bit to see if there are any more comments.