On Tue, Sep 01, 2015 at 17:10:30 +0100, Alex Bennée wrote: > > Emilio G. Cota <c...@braap.org> writes: > > > Signed-off-by: Emilio G. Cota <c...@braap.org> > > --- > > cputlb.c | 41 +++++++++++------------------------------ > > 1 file changed, 11 insertions(+), 30 deletions(-) > > I bisected my Jessie boot failure to this commit. Before it boots up > fine, here it just hangs before the kernel starts init. > > 17:05 alex@zen/x86_64 [qemu.git/bisect:???] > >./arm-softmmu/qemu-system-arm -machine virt -cpu cortex-a15 -machine > type=virt -display none -serial telnet:127.0.0.1:4444 -monitor stdio > -smp 4 -m 4096 -kernel ../images/aarch32-current-linux-kernel-only.img > --append "console=ttyAMA0 root=/dev/vda1" -drive > file=../images/jessie-arm32.qcow2,id=myblock,index=0,if=none -device > virtio-b > lk-device,drive=myblock -netdev user,id=unet,hostfwd=tcp::2222-:22 > -device virtio-net-device,netdev=unet -D /tmp/qemu.log -d un > imp -name debug-threads=on > > See people.linaro.org/~alex.bennee/images
Thanks for testing! 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. (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.) 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. Thanks, Emilio