From patchwork Thu Apr 2 02:37:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dong, Eddie" X-Patchwork-Id: 15826 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 n322cgNT008266 for ; Thu, 2 Apr 2009 02:38:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbZDBCil (ORCPT ); Wed, 1 Apr 2009 22:38:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752909AbZDBCil (ORCPT ); Wed, 1 Apr 2009 22:38:41 -0400 Received: from mga02.intel.com ([134.134.136.20]:14353 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbZDBCik (ORCPT ); Wed, 1 Apr 2009 22:38:40 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 01 Apr 2009 19:31:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.39,310,1235980800"; d="scan'208";a="502842601" Received: from pgsmsx603.gar.corp.intel.com ([10.221.43.87]) by orsmga001.jf.intel.com with ESMTP; 01 Apr 2009 19:38:04 -0700 Received: from pgsmsx601.gar.corp.intel.com (10.221.43.69) by pgsmsx603.gar.corp.intel.com (10.221.43.87) with Microsoft SMTP Server (TLS) id 8.1.340.0; Thu, 2 Apr 2009 10:37:25 +0800 Received: from pdsmsx601.ccr.corp.intel.com (172.16.12.94) by pgsmsx601.gar.corp.intel.com (10.221.43.69) with Microsoft SMTP Server (TLS) id 8.1.340.0; Thu, 2 Apr 2009 10:37:25 +0800 Received: from pdsmsx503.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx601.ccr.corp.intel.com ([172.16.12.94]) with mapi; Thu, 2 Apr 2009 10:37:24 +0800 From: "Dong, Eddie" To: Avi Kivity CC: "kvm@vger.kernel.org" , "Nakajima, Jun" , "Mallick, Asit K" , "Dong, Eddie" Date: Thu, 2 Apr 2009 10:37:22 +0800 Subject: Check valid bit of VM_EXIT_INTR_INFO Thread-Topic: Check valid bit of VM_EXIT_INTR_INFO Thread-Index: AcmzO/OI2mAJLWeUT/eviKpdDdN6vQ== Message-ID: <9832F13BD22FB94A829F798DA4A8280501A3ED7CB7@pdsmsx503.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Thx, eddie commit ad4a9829c8d5b30995f008e32774bd5f555b7e9f Author: root Date: Thu Apr 2 11:16:03 2009 +0800 Check valid bit of VM_EXIT_INTR_INFO before unblock nmi. Signed-off-by: Eddie Dong diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index aba41ae..689523a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3268,16 +3268,18 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx) exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); if (cpu_has_virtual_nmis()) { - unblock_nmi = (exit_intr_info & INTR_INFO_UNBLOCK_NMI) != 0; - vector = exit_intr_info & INTR_INFO_VECTOR_MASK; /* * SDM 3: 25.7.1.2 * Re-set bit "block by NMI" before VM entry if vmexit caused by * a guest IRET fault. */ - if (unblock_nmi && vector != DF_VECTOR) - vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, + if (exit_intr_info & INTR_INFO_VALID_MASK) { + unblock_nmi = !!(exit_intr_info & INTR_INFO_UNBLOCK_NMI); + vector = exit_intr_info & INTR_INFO_VECTOR_MASK; + if (unblock_nmi && vector != DF_VECTOR) + vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); + } } else if (unlikely(vmx->soft_vnmi_blocked)) vmx->vnmi_blocked_time += ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time));