From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: [PATCH 2/4] KVM: VMX: Get the consistent describe of cpu feature report Date: Thu, 19 Jun 2008 18:43:21 +0800 Message-ID: <200806191843.22037.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_KhjWITk8gSPi8AI" To: kvm@vger.kernel.org Return-path: Received: from mga09.intel.com ([134.134.136.24]:48026 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755460AbYFSKnY (ORCPT ); Thu, 19 Jun 2008 06:43:24 -0400 Sender: kvm-owner@vger.kernel.org List-ID: --Boundary-00=_KhjWITk8gSPi8AI Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46rom 983b4c5b081bcbe01c4c50d3b2916eeb1e51eb49 Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Thu, 19 Jun 2008 18:41:42 +0800 Subject: [PATCH] KVM: VMX: Get the consistent describe of cpu feature report Signed-off-by: Sheng Yang =2D-- arch/x86/kvm/vmx.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6e4278d..0fbbf6d 100644 =2D-- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -213,7 +213,7 @@ static inline int vm_need_tpr_shadow(struct kvm *kvm) return ((cpu_has_vmx_tpr_shadow()) && (irqchip_in_kernel(kvm))); } =2Dstatic inline int cpu_has_secondary_exec_ctrls(void) +static inline int cpu_has_vmx_secondary_exec_ctrls(void) { return (vmcs_config.cpu_based_exec_ctrl & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS); @@ -264,7 +264,7 @@ static inline int cpu_has_vmx_vpid(void) SECONDARY_EXEC_ENABLE_VPID); } =2Dstatic inline int cpu_has_virtual_nmis(void) +static inline int cpu_has_vmx_virtual_nmis(void) { return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS; } @@ -1902,7 +1902,7 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) CPU_BASED_CR3_LOAD_EXITING; vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control); =2D if (cpu_has_secondary_exec_ctrls()) { + if (cpu_has_vmx_secondary_exec_ctrls()) { exec_control =3D vmcs_config.cpu_based_2nd_exec_ctrl; if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) exec_control &=3D @@ -2777,7 +2777,7 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu) { u32 cpu_based_vm_exec_control; =2D if (!cpu_has_virtual_nmis()) + if (!cpu_has_vmx_virtual_nmis()) return; cpu_based_vm_exec_control =3D vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); @@ -2848,7 +2848,7 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) * faulted. */ if ((idtv_info_field & VECTORING_INFO_TYPE_MASK) =2D =3D=3D INTR_TYPE_NMI_INTR && cpu_has_virtual_nmis()) + =3D=3D INTR_TYPE_NMI_INTR && cpu_has_vmx_virtual_nmis()) vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & ~GUEST_INTR_STATE_NMI); @@ -2864,7 +2864,7 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) enable_intr_window(vcpu); return; } =2D if (cpu_has_virtual_nmis()) { + if (cpu_has_vmx_virtual_nmis()) { /* * SDM 3: 25.7.1.2 * Re-set bit "block by NMI" before VM entry if vmexit caused by =2D- 1.5.5 --Boundary-00=_KhjWITk8gSPi8AI Content-Type: text/x-diff; charset="utf-8"; name="0002-KVM-VMX-Get-the-consistent-describe-of-cpu-feature.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0002-KVM-VMX-Get-the-consistent-describe-of-cpu-feature.patch" =46rom 983b4c5b081bcbe01c4c50d3b2916eeb1e51eb49 Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Thu, 19 Jun 2008 18:41:42 +0800 Subject: [PATCH] KVM: VMX: Get the consistent describe of cpu feature report Signed-off-by: Sheng Yang =2D-- arch/x86/kvm/vmx.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6e4278d..0fbbf6d 100644 =2D-- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -213,7 +213,7 @@ static inline int vm_need_tpr_shadow(struct kvm *kvm) return ((cpu_has_vmx_tpr_shadow()) && (irqchip_in_kernel(kvm))); } =20 =2Dstatic inline int cpu_has_secondary_exec_ctrls(void) +static inline int cpu_has_vmx_secondary_exec_ctrls(void) { return (vmcs_config.cpu_based_exec_ctrl & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS); @@ -264,7 +264,7 @@ static inline int cpu_has_vmx_vpid(void) SECONDARY_EXEC_ENABLE_VPID); } =20 =2Dstatic inline int cpu_has_virtual_nmis(void) +static inline int cpu_has_vmx_virtual_nmis(void) { return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS; } @@ -1902,7 +1902,7 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) CPU_BASED_CR3_LOAD_EXITING; vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control); =20 =2D if (cpu_has_secondary_exec_ctrls()) { + if (cpu_has_vmx_secondary_exec_ctrls()) { exec_control =3D vmcs_config.cpu_based_2nd_exec_ctrl; if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) exec_control &=3D @@ -2777,7 +2777,7 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu) { u32 cpu_based_vm_exec_control; =20 =2D if (!cpu_has_virtual_nmis()) + if (!cpu_has_vmx_virtual_nmis()) return; =20 cpu_based_vm_exec_control =3D vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); @@ -2848,7 +2848,7 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) * faulted. */ if ((idtv_info_field & VECTORING_INFO_TYPE_MASK) =2D =3D=3D INTR_TYPE_NMI_INTR && cpu_has_virtual_nmis()) + =3D=3D INTR_TYPE_NMI_INTR && cpu_has_vmx_virtual_nmis()) vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & ~GUEST_INTR_STATE_NMI); @@ -2864,7 +2864,7 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) enable_intr_window(vcpu); return; } =2D if (cpu_has_virtual_nmis()) { + if (cpu_has_vmx_virtual_nmis()) { /* * SDM 3: 25.7.1.2 * Re-set bit "block by NMI" before VM entry if vmexit caused by =2D-=20 1.5.5 --Boundary-00=_KhjWITk8gSPi8AI--