On 1 September 2015 at 20:38, Emilio G. Cota <c...@braap.org> wrote: > I can replicate it; what's happening is that tlb_flush_all calls > cpu_loop_exit(), then re-enters the cpu loop, performs the > job while other CPUs are asleep(i.e. __tlb_flush_all in this case), > but then when it continues execution it loads the same instruction > (say a TLBIALLIS) again. So we end up with the same CPU calling > tlb_flush_all in an infinite loop. > > A possible way to fix this is to finish the TB right after the > helper and then add a flag in cpu_sched_work to not call > cpu_exit_loop, raising an exit interrupt instead.
Sounds like a good idea. > (Note that cpu_exit_loop is still necessary when doing work > out-of-band wrt to execution, e.g. we *want* to come back > to the same PC when doing a tb_flush.) Really? I haven't looked at any of this code, but that sounds a bit odd... > I've tried doing this but I can't see an obvious place to insert > the call to tcg_gen_exit_tb()--I see the calls to the TLB helpers > are embedded in structs that I presume are called by some generic > helper code. A little bit of help here would be appreciated, I'm > not very familiar with target-arm. The code (for 32-bit) is in disas_coproc_insn(). Any coprocessor which isn't a CP_SPECIAL case (ie NOP or WFI) will always be the last thing in its TB anyway, unless this is suppressed with the ARM_CP_SUPPRESS_TB_END flag in the reginfo struct. thanks -- PMM