From patchwork Wed Jul 22 21:53:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 36918 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6MLrU6W014643 for ; Wed, 22 Jul 2009 21:53:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816AbZGVVx2 (ORCPT ); Wed, 22 Jul 2009 17:53:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753376AbZGVVx2 (ORCPT ); Wed, 22 Jul 2009 17:53:28 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:35590 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719AbZGVVx2 (ORCPT ); Wed, 22 Jul 2009 17:53:28 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 75D5310CA7796; Wed, 22 Jul 2009 23:53:27 +0200 (CEST) Received: from [92.74.59.61] (helo=[192.168.0.10]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1MTjkd-0007Jw-00; Wed, 22 Jul 2009 23:53:27 +0200 Message-ID: <4A678A56.7050901@web.de> Date: Wed, 22 Jul 2009 23:53:26 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Marcelo Tosatti CC: kvm-devel Subject: [PATCH] KVM: VMX: Fix locking order in handle_invalid_guest_state X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1/X1ECJC99f+M+LPkge7cBAwppmRGZTZV4QnpUO flBZQIURMKqwvYWXqysF9o8gKzPe/g6sAhKq9AQNRmrekAkhhV 3v2GbXfeA= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Release and re-acquire preemption and IRQ lock in the same order as vcpu_enter_guest does. Signed-off-by: Jan Kiszka --- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d75c271..4f914c3 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3324,8 +3324,8 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx = to_vmx(vcpu); enum emulation_result err = EMULATE_DONE; - preempt_enable(); local_irq_enable(); + preempt_enable(); while (!guest_state_valid(vcpu)) { err = emulate_instruction(vcpu, kvm_run, 0, 0, 0); @@ -3344,8 +3344,8 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, schedule(); } - local_irq_disable(); preempt_disable(); + local_irq_disable(); vmx->invalid_state_emulation_result = err; }