From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWo8s-0006SO-Fw for qemu-devel@nongnu.org; Tue, 01 Sep 2015 12:10:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWo8m-0001Sw-GU for qemu-devel@nongnu.org; Tue, 01 Sep 2015 12:10:38 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:33426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWo8m-0001Sr-B1 for qemu-devel@nongnu.org; Tue, 01 Sep 2015 12:10:32 -0400 Received: by wicmc4 with SMTP id mc4so38579296wic.0 for ; Tue, 01 Sep 2015 09:10:31 -0700 (PDT) References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-36-git-send-email-cota@braap.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1440375847-17603-36-git-send-email-cota@braap.org> Date: Tue, 01 Sep 2015 17:10:30 +0100 Message-ID: <87k2sai0i1.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC 35/38] cputlb: use cpu_tcg_sched_work for tlb_flush_all List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: mttcg@listserver.greensocs.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, Frederic Konrad Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota > --- > 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 > > diff --git a/cputlb.c b/cputlb.c > index 1b3673e..d81a4eb 100644 > --- a/cputlb.c > +++ b/cputlb.c > @@ -73,43 +73,24 @@ void tlb_flush(CPUState *cpu, int flush_global) > tlb_flush_count++; > } > > -struct TLBFlushParams { > - CPUState *cpu; > - int flush_global; > -}; > - > -static void tlb_flush_async_work(void *opaque) > +static void __tlb_flush_all(void *arg) > { > - struct TLBFlushParams *params = opaque; > + CPUState *cpu; > + int flush_global = *(int *)arg; > > - tlb_flush(params->cpu, params->flush_global); > - g_free(params); > + CPU_FOREACH(cpu) { > + tlb_flush(cpu, flush_global); > + } > + g_free(arg); > } > > void tlb_flush_all(int flush_global) > { > - CPUState *cpu; > - struct TLBFlushParams *params; > + int *arg = g_malloc(sizeof(*arg)); > > -#if 0 /* MTTCG */ > - CPU_FOREACH(cpu) { > - tlb_flush(cpu, flush_global); > - } > -#else > - CPU_FOREACH(cpu) { > - if (qemu_cpu_is_self(cpu)) { > - /* async_run_on_cpu handle this case but this just avoid a malloc > - * here. > - */ > - tlb_flush(cpu, flush_global); > - } else { > - params = g_malloc(sizeof(struct TLBFlushParams)); > - params->cpu = cpu; > - params->flush_global = flush_global; > - async_run_on_cpu(cpu, tlb_flush_async_work, params); > - } > - } > -#endif /* MTTCG */ > + *arg = flush_global; > + tb_lock(); > + cpu_tcg_sched_work(current_cpu, __tlb_flush_all, arg); > } > > static inline void tlb_flush_entry(CPUTLBEntry *tlb_entry, target_ulong addr) -- Alex Bennée