From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUcJC-0000cR-Q2 for qemu-devel@nongnu.org; Sun, 27 Nov 2011 05:50:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUcJB-000671-IS for qemu-devel@nongnu.org; Sun, 27 Nov 2011 05:50:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUcJB-00065E-6P for qemu-devel@nongnu.org; Sun, 27 Nov 2011 05:50:05 -0500 Date: Sun, 27 Nov 2011 12:50:00 +0200 From: Gleb Natapov Message-ID: <20111127105000.GL2557@redhat.com> References: <1322188529-11609-1-git-send-email-kernelfans@gmail.com> <1322361735-21428-1-git-send-email-kernelfans@gmail.com> <4ED212C7.1080901@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ED212C7.1080901@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] kvm: exit to userspace with reason KVM_EXIT_VCPU_DEAD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Liu Ping Fan , qemu-devel@nongnu.org, ryanh@us.ibm.com, jan.kiszka@web.de On Sun, Nov 27, 2011 at 12:36:55PM +0200, Avi Kivity wrote: > On 11/27/2011 04:42 AM, Liu Ping Fan wrote: > > From: Liu Ping Fan > > > > The vcpu can be safely released when > > --1.guest tells us that the vcpu is not needed any longer. > > --2.vcpu hits the last instruction _halt_ > > > > If both of the conditions are satisfied, kvm exits to userspace > > with the reason vcpu dead. So the user thread can exit safely. > > > > > > Seems to be completely unnecessary. If you want to exit from the vcpu > thread, send it a signal. > Also if guest "tells us that the vcpu is not needed any longer" (via ACPI I presume) and vcpu actually doing something critical instead of sitting in 1:hlt; jmp 1b loop then it is guest's problem if it stops working after vcpu destruction. -- Gleb.