On 14/06/18 22:02, Richard Henderson wrote:
On 06/14/2018 12:53 AM, Mark Cave-Ayland wrote:
+ if (dc->base.tb->cflags & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
Need to use tb_cflags(dc->base.tb) for the atomic_read therein.
+ if (dc->base.tb->cflags & CF_USE_ICOUNT) {
+ gen_io_end();
+ /* End TB to handle timer interrupt */
+ save_state(dc);
+ gen_op_next_insn();
+ tcg_gen_exit_tb(NULL, 0);
+ dc->base.is_jmp = DISAS_NORETURN;
+ }
Exiting the TB should not be dependent on icount.
I would encourage you to introduce e.g. DISAS_EXIT, and code to handle that in
sparc_tr_tb_stop, to avoid replicating this pattern so many times.
Okay thanks for the feedback. I've made the changes and will post a v3
shortly.
I still see the "WARNING: Time of Day clock error" messages on the
console when booting Milax with icount enabled, although I'm inclined to
merge this if you're happy with the patch as it is a definite improvement.
ATB,
Mark.