From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/5] KVM: Adds ability to preepmt an executing VCPU Date: Sun, 22 Apr 2007 11:50:15 +0300 Message-ID: <462B21C7.2060007@qumranet.com> References: <20070420030905.12408.40403.stgit@ghaskins-t60p.haskins.net> <20070420030921.12408.97321.stgit@ghaskins-t60p.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Gregory Haskins Return-path: In-Reply-To: <20070420030921.12408.97321.stgit-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Gregory Haskins wrote: > The VCPU executes synchronously w.r.t. userspace today, and therefore > interrupt injection is pretty straight forward. However, we will soon need > to be able to inject interrupts asynchronous to the execution of the VCPU > due to the introduction of SMP, paravirtualized drivers, and asynchronous > hypercalls. This patch adds support to the interrupt mechanism to force > a VCPU to VMEXIT when a new interrupt is pending. > > Signed-off-by: Gregory Haskins > --- > [vmresume/return code] > /* > + * Signal that we have transitioned back to host mode > + */ > + spin_lock_irqsave(&vcpu->irq.lock, irq_flags); > + vcpu->irq.guest_mode = 0; > + spin_unlock_irqrestore(&vcpu->irq.lock, irq_flags); > + > You need to check for an interrupt here. Otherwise you might go back to user mode and sleep there, no? -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/