From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGWZy-0002Ue-AR for qemu-devel@nongnu.org; Thu, 20 Feb 2014 11:34:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGWZs-0008Sv-Kq for qemu-devel@nongnu.org; Thu, 20 Feb 2014 11:34:30 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:39177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGWZs-0008R5-DE for qemu-devel@nongnu.org; Thu, 20 Feb 2014 11:34:24 -0500 Received: by mail-la0-f41.google.com with SMTP id mc6so1523958lab.28 for ; Thu, 20 Feb 2014 08:34:23 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <53062A17.8060909@suse.de> References: <1392268034-6220-1-git-send-email-edgar.iglesias@gmail.com> <20140216020700.GA32391@amz.ap-southeast-2.compute.internal> <53062A17.8060909@suse.de> From: Peter Maydell Date: Thu, 20 Feb 2014 16:34:03 +0000 Message-ID: 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: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: "Edgar E. Iglesias" , QEMU Developers , pcrost@xilinx.com On 20 February 2014 16:15, Andreas F=C3=A4rber wrote: > Am 20.02.2014 16:58, schrieb Peter Maydell: >> On 16 February 2014 02:07, Edgar E. Iglesias = wrote: >>> 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. >> >> Yes, having looked at the code I agree with you, so: >> >> Reviewed-by: Peter Maydell >> >> However, doesn't this also apply to interrupt_request ? > > I was wondering the same thing but didn't find time to investigate yet. > > Is it possible that we rather need to register some reset hook or bottom > half to process the exit_request *before* this reset code runs? The only way to process the exit_request is to abandon execution of whatever instruction caused us to try to do the CPU reset. That's in the general case impossible because we probably got here via an emulated power control device which has already updated its internal state and isn't capable of rolling back. Simply making sure we honour the exit_request as soon as we've completed the cpu_reset is much simpler, I think. thanks -- PMM