From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9rQQ-0006hz-Vt for qemu-devel@nongnu.org; Mon, 06 Jun 2016 06:06:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9rQL-0003Q8-O7 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 06:06:26 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9rQL-0003Q0-Fy for qemu-devel@nongnu.org; Mon, 06 Jun 2016 06:06:21 -0400 Received: by mail-lf0-x244.google.com with SMTP id w16so12960409lfd.0 for ; Mon, 06 Jun 2016 03:06:21 -0700 (PDT) References: <87h9d6itnm.fsf@linaro.org> From: Sergey Fedorov Message-ID: <57554B1B.3060000@gmail.com> Date: Mon, 6 Jun 2016 13:06:19 +0300 MIME-Version: 1.0 In-Reply-To: <87h9d6itnm.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v1 09/12] translate-all: introduces tb_flush_safe. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, qemu-devel@nongnu.org, mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, rth@twiddle.net, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite On 06/06/16 11:54, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 15/04/16 17:23, Alex Bennée wrote: >>> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h >>> index f695577..858055b 100644 >>> --- a/include/exec/exec-all.h >>> +++ b/include/exec/exec-all.h >>> @@ -307,6 +307,7 @@ struct TBContext { >>> >>> void tb_free(TranslationBlock *tb); >>> void tb_flush(CPUState *cpu); >>> +void tb_flush_safe(CPUState *cpu); >> Do we really want to have both tb_flush_safe() and tb_flush()? > I guess if we are going to include user-mode in the party ;-) > > User-mode should be fine; we take care of it: +void tb_flush_safe(CPUState *cpu) +{ +#ifdef CONFIG_SOFTMMU + async_safe_run_on_cpu(cpu, tb_flush_work, NULL); +#else + qemu_log("Safe flushing of TBs not implemented for linux-user\n"); + tb_flush(cpu); +#endif +} + Kind regards, Sergey