From patchwork Thu Apr 25 07:52:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nakajima, Jun" X-Patchwork-Id: 2487451 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 47C1A3FC64 for ; Thu, 25 Apr 2013 07:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756326Ab3DYHw1 (ORCPT ); Thu, 25 Apr 2013 03:52:27 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:39877 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756300Ab3DYHw0 (ORCPT ); Thu, 25 Apr 2013 03:52:26 -0400 Received: by mail-vb0-f46.google.com with SMTP id 11so2371413vbe.19 for ; Thu, 25 Apr 2013 00:52:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=4s6URRy5ohqacOI1RgRYqEqS2DV5KliQ6IZDvGezGPQ=; b=NsJ6K3L7fTRforj9cNC0QMhEX6jQXNDLvxY/DVe/3PXYTpETqFzwiTxkx3DeLq1PCi BK/wCu87f7qYChnpAJeB6afuarllRgBYpD6EGl6/3QA88E0X5ga2HzECwRnT3D2X39d/ wUjpuf/k+SFZ0potHRz8LjghXGHpQx41EsGkk4adxuZNtT4SqF+awLtiMIahjkL3HSZP WcLbDv3xOdabUWMXO6sfRwGzye21sCHb4kLJlCtebGNsFRmCG/TD+ykcdNhogIXK5Xf4 xrEn94C8lmuAjuGRTE85/arUnEhQzdpIH2/+GhvohF0Ekl8LvvEPGYMl3YBYY/65xViL fNEQ== MIME-Version: 1.0 X-Received: by 10.52.103.50 with SMTP id ft18mr14669789vdb.108.1366876345630; Thu, 25 Apr 2013 00:52:25 -0700 (PDT) Received: by 10.58.64.196 with HTTP; Thu, 25 Apr 2013 00:52:25 -0700 (PDT) Date: Thu, 25 Apr 2013 00:52:25 -0700 Message-ID: Subject: [PATCH 10/12] Subject: [PATCH 10/10] nEPT: Miscelleneous cleanups From: "Nakajima, Jun" To: "kvm@vger.kernel.org" X-Gm-Message-State: ALoCoQmFBRmZowB5i0To7I8jj1twNq5J3PjQcvYq183kI0YVauG/CWP3cHEzTxd6nnH5LlREh+As Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Some trivial code cleanups not really related to nested EPT. Signed-off-by: Nadav Har'El Signed-off-by: Jun Nakajima modified: arch/x86/include/asm/vmx.h modified: arch/x86/kvm/vmx.c --- arch/x86/include/asm/vmx.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ arch/x86/kvm/vmx.c | 3 +-- 2 files changed, 45 insertions(+), 2 deletions(-) -- 1.8.2.1.610.g562af5b -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 0ce54f3..5838be1 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h @@ -254,6 +254,50 @@ enum vmcs_field { HOST_RIP = 0x00006c16, }; +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000 + +#define EXIT_REASON_EXCEPTION_NMI 0 +#define EXIT_REASON_EXTERNAL_INTERRUPT 1 +#define EXIT_REASON_TRIPLE_FAULT 2 + +#define EXIT_REASON_PENDING_INTERRUPT 7 +#define EXIT_REASON_NMI_WINDOW 8 +#define EXIT_REASON_TASK_SWITCH 9 +#define EXIT_REASON_CPUID 10 +#define EXIT_REASON_HLT 12 +#define EXIT_REASON_INVD 13 +#define EXIT_REASON_INVLPG 14 +#define EXIT_REASON_RDPMC 15 +#define EXIT_REASON_RDTSC 16 +#define EXIT_REASON_VMCALL 18 +#define EXIT_REASON_VMCLEAR 19 +#define EXIT_REASON_VMLAUNCH 20 +#define EXIT_REASON_VMPTRLD 21 +#define EXIT_REASON_VMPTRST 22 +#define EXIT_REASON_VMREAD 23 +#define EXIT_REASON_VMRESUME 24 +#define EXIT_REASON_VMWRITE 25 +#define EXIT_REASON_VMOFF 26 +#define EXIT_REASON_VMON 27 +#define EXIT_REASON_CR_ACCESS 28 +#define EXIT_REASON_DR_ACCESS 29 +#define EXIT_REASON_IO_INSTRUCTION 30 +#define EXIT_REASON_MSR_READ 31 +#define EXIT_REASON_MSR_WRITE 32 +#define EXIT_REASON_INVALID_STATE 33 +#define EXIT_REASON_MWAIT_INSTRUCTION 36 +#define EXIT_REASON_MONITOR_INSTRUCTION 39 +#define EXIT_REASON_PAUSE_INSTRUCTION 40 +#define EXIT_REASON_MCE_DURING_VMENTRY 41 +#define EXIT_REASON_TPR_BELOW_THRESHOLD 43 +#define EXIT_REASON_APIC_ACCESS 44 +#define EXIT_REASON_EPT_VIOLATION 48 +#define EXIT_REASON_EPT_MISCONFIG 49 +#define EXIT_REASON_INVEPT 50 +#define EXIT_REASON_WBINVD 54 +#define EXIT_REASON_XSETBV 55 +#define EXIT_REASON_INVPCID 58 + /* * Interruption-information format */ diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 10f2a69..95304cc 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -616,7 +616,6 @@ static void nested_release_page_clean(struct page *page) static u64 construct_eptp(unsigned long root_hpa); static void kvm_cpu_vmxon(u64 addr); static void kvm_cpu_vmxoff(void); -static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3); static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr); static void vmx_set_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); @@ -6320,7 +6319,7 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked && !(is_guest_mode(vcpu) && nested_cpu_has_virtual_nmis( - get_vmcs12(vcpu), vcpu)))) { + get_vmcs12(vcpu))))) { if (vmx_interrupt_allowed(vcpu)) { vmx->soft_vnmi_blocked = 0; } else if (vmx->vnmi_blocked_time > 1000000000LL &&