From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNWYm-0004Io-Bc for qemu-devel@nongnu.org; Tue, 11 Mar 2014 19:58:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNWYg-0007OK-D9 for qemu-devel@nongnu.org; Tue, 11 Mar 2014 19:58:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55430 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNWYg-0007O8-6d for qemu-devel@nongnu.org; Tue, 11 Mar 2014 19:58:06 -0400 Message-ID: <531FA30B.5020205@suse.de> Date: Wed, 12 Mar 2014 00:58:03 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1392268034-6220-1-git-send-email-edgar.iglesias@gmail.com> <20140216020700.GA32391@amz.ap-southeast-2.compute.internal> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qom/cpu: Remove cpu->exit_request from reset state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , "Edgar E. Iglesias" Cc: QEMU Developers , pcrost@xilinx.com Am 20.02.2014 16:58, schrieb Peter Maydell: > On 16 February 2014 02:07, Edgar E. Iglesias = wrote: >> On Sat, Feb 15, 2014 at 03:42:56PM +0000, Peter Maydell wrote: >>> On 13 February 2014 05:07, wrote: >>>> From: "Edgar E. Iglesias" >>>> >>>> cpu->exit_request is part of the execution environment and should >>>> not be cleared when a CPU resets. >>>> >>>> Otherwise, we might deadlock QEMU if a CPU resets while there is >>>> I/O going on. >>>> >>>> Signed-off-by: Edgar E. Iglesias >>>> --- >>>> qom/cpu.c | 1 - >>>> 1 file changed, 1 deletion(-) >>>> >>>> diff --git a/qom/cpu.c b/qom/cpu.c >>>> index 9d62479..40d82dd 100644 >>>> --- a/qom/cpu.c >>>> +++ b/qom/cpu.c >>>> @@ -195,7 +195,6 @@ static void cpu_common_reset(CPUState *cpu) >>>> log_cpu_state(cpu, cc->reset_dump_flags); >>>> } >>>> >>>> - cpu->exit_request =3D 0; >>>> cpu->interrupt_request =3D 0; >>>> cpu->current_tb =3D NULL; >>>> cpu->halted =3D 0; >>> >>> This looks kind of odd to me. What's the situation you see where >>> this matters -- is the CPU resetting itself, or is some other device >>> in another thread triggering the CPU reset? TCG or KVM? >> >> Seeing this in TCG. The CPU gets signaled by the IO thread while the >> CPU is resetting itself. If the CPU looses the race, it clears its >> exit_request leaving the IO thread waiting for the global lock >> potentially forever. >> >> The CPU actually exits generated code but goes right back in because >> there is no exit_request pending. >=20 > Yes, having looked at the code I agree with you, so: >=20 > Reviewed-by: Peter Maydell Thanks, applied to qom-cpu (with clarified commit message): https://github.com/afaerber/qemu-cpu/commits/qom-cpu Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg