From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIH1U-00069N-3V for qemu-devel@nongnu.org; Wed, 29 Jun 2016 11:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIH1Q-0000As-TC for qemu-devel@nongnu.org; Wed, 29 Jun 2016 11:03:28 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:36359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIH1Q-0000AH-M2 for qemu-devel@nongnu.org; Wed, 29 Jun 2016 11:03:24 -0400 Received: by mail-lf0-x243.google.com with SMTP id a2so5367738lfe.3 for ; Wed, 29 Jun 2016 08:03:24 -0700 (PDT) References: <87h9cfdlcd.fsf@linaro.org> From: Sergey Fedorov Message-ID: <5773E339.6020702@gmail.com> Date: Wed, 29 Jun 2016 18:03:21 +0300 MIME-Version: 1.0 In-Reply-To: <87h9cfdlcd.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC 7/8] cpu-exec-common: Introduce async_safe_run_on_cpu() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Sergey Fedorov Cc: qemu-devel@nongnu.org, Riku Voipio , Peter Crosthwaite , patches@linaro.org, Paolo Bonzini , Richard Henderson On 27/06/16 12:36, Alex Bennée wrote: > Sergey Fedorov writes: > >> From: Sergey Fedorov >> (snip) >> diff --git a/cpus.c b/cpus.c >> index 98f60f6f98f5..bb6bd8615cfc 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -932,6 +932,18 @@ static void qemu_tcg_destroy_vcpu(CPUState *cpu) >> { >> } >> >> +static void tcg_cpu_exec_start(CPUState *cpu) >> +{ >> + tcg_pending_cpus++; >> +} >> + >> +static void tcg_cpu_exec_end(CPUState *cpu) >> +{ >> + if (--tcg_pending_cpus) { >> + signal_cpu_work(); >> + } >> +} > Don't these need to be atomic? 'tcg_pending_cpus' is protected by BQL. > >> + >> static void qemu_wait_io_event_common(CPUState *cpu) >> { >> if (cpu->stop) { >> (snip) Thanks, Sergey