Hi Stefano, On 10/21/2017 03:09 PM, Stefano Stabellini wrote: [...] > diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c > index a39b9d3..6f74589 100644 > --- a/target/arm/translate-a64.c > +++ b/target/arm/translate-a64.c > @@ -11380,17 +11380,20 @@ static void aarch64_tr_tb_stop(DisasContextBase > *dcbase, CPUState *cpu) > gen_helper_yield(cpu_env); > break; > case DISAS_WFI: > + { > + TCGv_i32 tmp = tcg_const_i32((dc->insn & (1U << 31)) ? 4 : 2);
this alloc'd tmp var needs to be free'd. > /* This is a special case because we don't want to just halt the > CPU > * if trying to debug across a WFI. > */ > gen_a64_set_pc_im(dc->pc); > - gen_helper_wfi(cpu_env); > + gen_helper_wfi(cpu_env, tmp); as: tcg_temp_free_i32(tmp); > /* The helper doesn't necessarily throw an exception, but we > * must go back to the main loop to check for interrupts anyway. > */ > tcg_gen_exit_tb(0); > break; > } > + } > } > > /* Functions above can change dc->pc, so re-align db->pc_next */ > diff --git a/target/arm/translate.c b/target/arm/translate.c > index 4da1a4c..a89518f 100644 > --- a/target/arm/translate.c > +++ b/target/arm/translate.c > @@ -12325,12 +12325,15 @@ static void arm_tr_tb_stop(DisasContextBase > *dcbase, CPUState *cpu) > /* nothing more to generate */ > break; > case DISAS_WFI: > - gen_helper_wfi(cpu_env); > + { > + TCGv_i32 tmp = tcg_const_i32((dc->insn & (1U << 31)) ? 4 : 2); > + gen_helper_wfi(cpu_env, tmp); ditto. > /* The helper doesn't necessarily throw an exception, but we > * must go back to the main loop to check for interrupts anyway. > */ > tcg_gen_exit_tb(0); > break; > + } > case DISAS_WFE: > gen_helper_wfe(cpu_env); > break; > Regards, Phil.