From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41042 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpeFQ-0003jV-0M for qemu-devel@nongnu.org; Wed, 16 Feb 2011 05:04:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpeFJ-0001ei-Co for qemu-devel@nongnu.org; Wed, 16 Feb 2011 05:04:36 -0500 Received: from david.siemens.de ([192.35.17.14]:24729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpeFJ-0001d3-36 for qemu-devel@nongnu.org; Wed, 16 Feb 2011 05:04:29 -0500 Message-ID: <4D5BA128.9060909@siemens.com> Date: Wed, 16 Feb 2011 11:04:24 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20110215175410.GA13487@amt.cnet> <4D5ACCED.1080906@siemens.com> <20110215200446.GA15802@amt.cnet> <4D5AE2FC.4020309@web.de> <20110215205504.GA16527@amt.cnet> <20110215205631.GA16579@amt.cnet> <4D5B99A9.1010404@redhat.com> <4D5B9CFC.1030503@siemens.com> <4D5B9F8B.3000306@redhat.com> In-Reply-To: <4D5B9F8B.3000306@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "Edgar E. Iglesias" , Marcelo Tosatti , "qemu-devel@nongnu.org" On 2011-02-16 10:57, Paolo Bonzini wrote: > On 02/16/2011 10:46 AM, Jan Kiszka wrote: >> What should this be good for? The iothread already kicks the vcpu if it >> wants to acquire the contended global mutex. > > Assuming the VCPU is in the timedwait that Marcelo changed, the global > mutex is free and the iothread will not kick the VCPU. Then why should it kick it at all? > >> And when the vcpu thread is >> in halt state, kicking it should change no other state. > > Kicking the VCPU will start running it, if an interrupt request from the > devices caused cpu_has_work to become true (and hence > all_cpu_threads_idle to become false). If we change the halt condition, we should not kick the vcpus but only signal the condition variable. Actually, I've a patch queued that skips pointless qemu_thread_signal in qemu_cpu_kick for TCG. > > So, perhaps the correct fix is to kick the cpu in cpu_interrupt, and all > I wrote about timeouts and timers is wrong. My patch would band-aid it. That's my strong suspect. We really need to understand what goes wrong. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux