From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 0/2] do not run halted vcpu's Date: Wed, 13 Aug 2008 13:44:33 +0300 Message-ID: <48A2BB11.2020909@qumranet.com> References: <20080801230912.013317832@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from il.qumranet.com ([212.179.150.194]:22998 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbYHMKof (ORCPT ); Wed, 13 Aug 2008 06:44:35 -0400 In-Reply-To: <20080801230912.013317832@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Avi Kivity wrote: > > >> Any reason this is not in __vcpu_run()? >> >> Our main loop could look like >> >> while (no reason to stop) >> if (runnable) >> enter guest >> else >> block >> deal with aftermath >> >> kvm_emulate_halt would then simply modify the mp state. >> > > Like this? > > - I don't think it is necessary to test for pending signals inside irq > safe section, so move that to exit processing. > > It is. We may have received a signal after ioctl processing started but before entry. If we don't don't check before entry, nothing ensures we'll ever exit (or we may exit due to some other reason, but the exit will be delayed). > - Same for need_resched(). > > Incorrect for the same reason. There's no guarantee we will ever exit if we ignore the rescheduling IPI. -- error compiling committee.c: too many arguments to function