From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH]KVM: VMX: Remove the secondary execute control depends on irqchip Date: Wed, 21 Nov 2007 15:39:09 +0800 Message-ID: <200711211539.09494.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_dC+QHteKrWcteWK" To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org --Boundary-00=_dC+QHteKrWcteWK Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46rom 140114fbd60afaf08fde429d05c280d88205051b Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Wed, 21 Nov 2007 14:33:25 +0800 Subject: [PATCH] KVM: VMX: Remove the secondary execute control depends on= =20 irqchip The state of SECONDARY_VM_EXEC_CONTROL shouldn't depend on in-kernel IRQ ch= ip, this patch fix this. Signed-off-by: Sheng Yang =2D-- drivers/kvm/vmx.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 4ad60c9..aad31ec 100644 =2D-- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -186,11 +186,6 @@ static inline int cpu_has_secondary_exec_ctrls(void) CPU_BASED_ACTIVATE_SECONDARY_CONTROLS); } =20 =2Dstatic inline int vm_need_secondary_exec_ctrls(struct kvm *kvm) =2D{ =2D return ((cpu_has_secondary_exec_ctrls()) && (irqchip_in_kernel(kvm))); =2D} =2D static inline int cpu_has_vmx_virtualize_apic_accesses(void) { return (vmcs_config.cpu_based_2nd_exec_ctrl & @@ -1516,13 +1511,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) CPU_BASED_CR8_LOAD_EXITING; #endif } =2D if (!vm_need_secondary_exec_ctrls(vmx->vcpu.kvm)) =2D exec_control &=3D ~CPU_BASED_ACTIVATE_SECONDARY_CONTROLS; vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control); =20 =2D if (vm_need_secondary_exec_ctrls(vmx->vcpu.kvm)) =2D vmcs_write32(SECONDARY_VM_EXEC_CONTROL, =2D vmcs_config.cpu_based_2nd_exec_ctrl); + if (cpu_has_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 + ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; + vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); + } =20 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf); vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf); =2D-=20 1.5.3.4 --Boundary-00=_dC+QHteKrWcteWK Content-Type: text/x-diff; charset="us-ascii"; name="0001-KVM-VMX-Remove-the-secondary-execute-control-depen.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-KVM-VMX-Remove-the-secondary-execute-control-depen.patch" =46rom 140114fbd60afaf08fde429d05c280d88205051b Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Wed, 21 Nov 2007 14:33:25 +0800 Subject: [PATCH] KVM: VMX: Remove the secondary execute control depends on = irqchip The state of SECONDARY_VM_EXEC_CONTROL shouldn't depend on in-kernel IRQ ch= ip, this patch fix this. Signed-off-by: Sheng Yang =2D-- drivers/kvm/vmx.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 4ad60c9..aad31ec 100644 =2D-- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -186,11 +186,6 @@ static inline int cpu_has_secondary_exec_ctrls(void) CPU_BASED_ACTIVATE_SECONDARY_CONTROLS); } =20 =2Dstatic inline int vm_need_secondary_exec_ctrls(struct kvm *kvm) =2D{ =2D return ((cpu_has_secondary_exec_ctrls()) && (irqchip_in_kernel(kvm))); =2D} =2D static inline int cpu_has_vmx_virtualize_apic_accesses(void) { return (vmcs_config.cpu_based_2nd_exec_ctrl & @@ -1516,13 +1511,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) CPU_BASED_CR8_LOAD_EXITING; #endif } =2D if (!vm_need_secondary_exec_ctrls(vmx->vcpu.kvm)) =2D exec_control &=3D ~CPU_BASED_ACTIVATE_SECONDARY_CONTROLS; vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control); =20 =2D if (vm_need_secondary_exec_ctrls(vmx->vcpu.kvm)) =2D vmcs_write32(SECONDARY_VM_EXEC_CONTROL, =2D vmcs_config.cpu_based_2nd_exec_ctrl); + if (cpu_has_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 + ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; + vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); + } =20 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf); vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf); =2D-=20 1.5.3.4 --Boundary-00=_dC+QHteKrWcteWK Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --Boundary-00=_dC+QHteKrWcteWK Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --Boundary-00=_dC+QHteKrWcteWK--