From patchwork Sun Apr 18 06:35:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Regmi X-Patchwork-Id: 93337 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3I6ZYHT016864 for ; Sun, 18 Apr 2010 06:35:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752764Ab0DRGfc (ORCPT ); Sun, 18 Apr 2010 02:35:32 -0400 Received: from mail-iw0-f197.google.com ([209.85.223.197]:64534 "EHLO mail-iw0-f197.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539Ab0DRGfb (ORCPT ); Sun, 18 Apr 2010 02:35:31 -0400 Received: by iwn35 with SMTP id 35so1352314iwn.21 for ; Sat, 17 Apr 2010 23:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:cc:content-type; bh=J4WWrOXIdhMzuom6Wlk8euzqlVzgcGhrDMv6C3KDrqk=; b=b5zR2K0GYVUmmW04TMpug8YYedKIBbwahpk/KQ2hzb0tX8EZUU4kwK0y1cT0ZbwPUL LRQ/5tg9MI8N5Bp/yVSfhUsDWI6dGBC1OON0vE1kkrSvDlbl5hz7petTefZdj+qeMsbL vcOTbYroPYkU3A9e+XbYZl1EFYZSzpIwH9ne0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=ay98SIkPxunc0vjhER+CVryhMCaiz+U0Zdf/HO8qY2xTHD+T7tyGvbYAWhbK/FbFC6 7iLmB4+jxv4NMXRsI4roKu38Kh3X/CtaGlHOkMhgF5TdkCr0ZxHoEs0zdnddBnvBMhpM rI8EikxaTbw4gSBItgmAtG6A6AitHtXs4sBL0= MIME-Version: 1.0 Received: by 10.231.59.72 with HTTP; Sat, 17 Apr 2010 23:35:31 -0700 (PDT) Date: Sun, 18 Apr 2010 01:35:31 -0500 Received: by 10.231.152.79 with SMTP id f15mr615552ibw.19.1271572531123; Sat, 17 Apr 2010 23:35:31 -0700 (PDT) Message-ID: Subject: [PATCH 1/1] correctly handle VM Entry Exit reasons and also show them in trace. From: Manish Regmi To: kvm@vger.kernel.org Cc: avi@redhat.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 18 Apr 2010 06:35:35 +0000 (UTC) diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index fb9a080..9bf84db 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h @@ -251,6 +251,8 @@ enum vmcs_field { #define EXIT_REASON_IO_INSTRUCTION 30 #define EXIT_REASON_MSR_READ 31 #define EXIT_REASON_MSR_WRITE 32 +#define EXIT_REASON_INVALID_GUEST_STATE 33 +#define EXIT_REASON_MSR_LOADING 34 #define EXIT_REASON_MWAIT_INSTRUCTION 36 #define EXIT_REASON_MONITOR_INSTRUCTION 39 #define EXIT_REASON_PAUSE_INSTRUCTION 40 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7e2f8d5..e93be6f 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3641,7 +3641,7 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx) exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); - vmx->exit_reason = vmcs_read32(VM_EXIT_REASON); + vmx->exit_reason = vmcs_read32(VM_EXIT_REASON) & ~VMX_EXIT_REASONS_FAILED_VMENTRY; /* Handle machine checks before interrupts are enabled */