From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c206L-0003p7-Bz for qemu-devel@nongnu.org; Wed, 02 Nov 2016 14:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c206G-00024c-AL for qemu-devel@nongnu.org; Wed, 02 Nov 2016 14:17:29 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c206G-00024N-24 for qemu-devel@nongnu.org; Wed, 02 Nov 2016 14:17:24 -0400 Received: by mail-wm0-x22a.google.com with SMTP id n67so54541842wme.1 for ; Wed, 02 Nov 2016 11:17:23 -0700 (PDT) References: <20161102142559.23395-1-bobby.prani@gmail.com> <20161102164008.28401-1-bobby.prani@gmail.com> <639cd027-f6db-d66d-c664-d5430831cddf@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <639cd027-f6db-d66d-c664-d5430831cddf@redhat.com> Date: Wed, 02 Nov 2016 18:17:21 +0000 Message-ID: <871sytvj9q.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2] mttcg: Handle EXCP_ATOMIC exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Pranith Kumar , qemu-devel@nongnu.org Paolo Bonzini writes: > On 02/11/2016 17:40, Pranith Kumar wrote: >> The patch enables handling atomic code in the guest. This should be >> preferably done in cpu_handle_exception(), but the current assumptions >> regarding when we can execute atomic sections cause a deadlock. >> >> Signed-off-by: Pranith Kumar >> --- >> cpus.c | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/cpus.c b/cpus.c >> index 8f98060..299ce7e 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -1315,6 +1315,11 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) >> if (r == EXCP_DEBUG) { >> cpu_handle_guest_debug(cpu); >> break; >> + } else if (r == EXCP_ATOMIC) { >> + qemu_mutex_unlock_iothread(); >> + cpu_exec_step_atomic(cpu); >> + qemu_mutex_lock_iothread(); >> + break; >> } >> } else if (cpu->stop) { >> if (cpu->unplug) { >> @@ -1385,6 +1390,10 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) >> */ >> g_assert(cpu->halted); >> break; >> + case EXCP_ATOMIC: >> + qemu_mutex_unlock_iothread(); >> + cpu_exec_step_atomic(cpu); >> + qemu_mutex_lock_iothread(); >> default: >> /* Ignore everything else? */ >> break; >> > > Alex, please pick up this patch yourself. Yep, I'll apply it to my tree. > > Paolo -- Alex Bennée