aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
authorSheng Yang <sheng.yang@intel.com>2007-11-21 01:33:25 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:14 -0500
commit83ff3b9d4a0ade8f8eb9757fd4b36c501ba161e4 (patch)
tree0d264664f9d9f1acb202e3537347a7520284f406 /drivers/kvm/vmx.c
parent0771671749b59a507b6da4efb931c44d9691e248 (diff)
KVM: VMX: Remove the secondary execute control dependency on irqchip
The state of SECONDARY_VM_EXEC_CONTROL shouldn't depend on in-kernel IRQ chip, this patch fix this. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r--drivers/kvm/vmx.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b4c0bdce7b34..fc5e7c8381ce 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -193,11 +193,6 @@ static inline int cpu_has_secondary_exec_ctrls(void)
193 CPU_BASED_ACTIVATE_SECONDARY_CONTROLS); 193 CPU_BASED_ACTIVATE_SECONDARY_CONTROLS);
194} 194}
195 195
196static inline int vm_need_secondary_exec_ctrls(struct kvm *kvm)
197{
198 return ((cpu_has_secondary_exec_ctrls()) && (irqchip_in_kernel(kvm)));
199}
200
201static inline int cpu_has_vmx_virtualize_apic_accesses(void) 196static inline int cpu_has_vmx_virtualize_apic_accesses(void)
202{ 197{
203 return (vmcs_config.cpu_based_2nd_exec_ctrl & 198 return (vmcs_config.cpu_based_2nd_exec_ctrl &
@@ -1524,13 +1519,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
1524 CPU_BASED_CR8_LOAD_EXITING; 1519 CPU_BASED_CR8_LOAD_EXITING;
1525#endif 1520#endif
1526 } 1521 }
1527 if (!vm_need_secondary_exec_ctrls(vmx->vcpu.kvm))
1528 exec_control &= ~CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
1529 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control); 1522 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control);
1530 1523
1531 if (vm_need_secondary_exec_ctrls(vmx->vcpu.kvm)) 1524 if (cpu_has_secondary_exec_ctrls()) {
1532 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, 1525 exec_control = vmcs_config.cpu_based_2nd_exec_ctrl;
1533 vmcs_config.cpu_based_2nd_exec_ctrl); 1526 if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
1527 exec_control &=
1528 ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
1529 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
1530 }
1534 1531
1535 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf); 1532 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf);
1536 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf); 1533 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf);