Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83ff3b9d authored by Sheng Yang's avatar Sheng Yang Committed by Avi Kivity
Browse files

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: default avatarSheng Yang <sheng.yang@intel.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 07716717
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -193,11 +193,6 @@ static inline int cpu_has_secondary_exec_ctrls(void)
		CPU_BASED_ACTIVATE_SECONDARY_CONTROLS);
		CPU_BASED_ACTIVATE_SECONDARY_CONTROLS);
}
}


static inline int vm_need_secondary_exec_ctrls(struct kvm *kvm)
{
	return ((cpu_has_secondary_exec_ctrls()) && (irqchip_in_kernel(kvm)));
}

static inline int cpu_has_vmx_virtualize_apic_accesses(void)
static inline int cpu_has_vmx_virtualize_apic_accesses(void)
{
{
	return (vmcs_config.cpu_based_2nd_exec_ctrl &
	return (vmcs_config.cpu_based_2nd_exec_ctrl &
@@ -1524,13 +1519,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
				CPU_BASED_CR8_LOAD_EXITING;
				CPU_BASED_CR8_LOAD_EXITING;
#endif
#endif
	}
	}
	if (!vm_need_secondary_exec_ctrls(vmx->vcpu.kvm))
		exec_control &= ~CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
	vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control);
	vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control);


	if (vm_need_secondary_exec_ctrls(vmx->vcpu.kvm))
	if (cpu_has_secondary_exec_ctrls()) {
		vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
		exec_control = vmcs_config.cpu_based_2nd_exec_ctrl;
			     vmcs_config.cpu_based_2nd_exec_ctrl);
		if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
			exec_control &=
				~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
		vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
	}


	vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf);
	vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf);
	vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf);
	vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf);