From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: VMX: Fix locking order in handle_invalid_guest_state Date: Wed, 29 Jul 2009 15:44:20 +0300 Message-ID: <4A704424.1090602@redhat.com> References: <4A678A56.7050901@web.de> <20090723214553.GA10152@amt.cnet> <20090729122456.GA16868@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , kvm-devel To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48917 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754331AbZG2Mji (ORCPT ); Wed, 29 Jul 2009 08:39:38 -0400 In-Reply-To: <20090729122456.GA16868@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 07/29/2009 03:24 PM, Marcelo Tosatti wrote: > On Thu, Jul 23, 2009 at 06:45:53PM -0300, Marcelo Tosatti wrote: > >> On Wed, Jul 22, 2009 at 11:53:26PM +0200, Jan Kiszka wrote: >> >>> Release and re-acquire preemption and IRQ lock in the same order as >>> vcpu_enter_guest does. >>> >> This should happen in vcpu_enter_guest, before it decides to disable >> preemption/irqs (so you consolidate the control there). >> >> Maybe add a new member to x86_ops? >> > > Why don't do something like this ? > The downside is that we're moving a vmx specific hack to common code. I think this could be simplified if interrupt injection happened outside the critical section. This is needed anyway because emulated interrupt injection needs to access guest memory (IVT and the stack). Something else I noticed, handle_invalid_guest_state() doesn't check vcpu->requests; normal execution will exit due to the interrupt while emulated execution will not. -- error compiling committee.c: too many arguments to function