[PATCH] kvm/vmx: Don't vmwrite to unsupported secondary processor controls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Older physical CPUs (and possibly some virtual CPUs) don't support the
secondary processor-based VM-execution controls.

Fixes: 8d860bbeedef ("kvm: vmx: Basic APIC virtualization controls have three settings")
Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 arch/x86/kvm/vmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 1689f433f3a08..af68df0765067 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9577,7 +9577,8 @@ static void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu)
 				SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
 		break;
 	}
-	vmcs_write32(SECONDARY_VM_EXEC_CONTROL, sec_exec_control);
+	if (cpu_has_secondary_exec_ctrls())
+		vmcs_write32(SECONDARY_VM_EXEC_CONTROL, sec_exec_control);
 
 	vmx_update_msr_bitmap(vcpu);
 }
-- 
2.18.0.203.gfac676dfb9-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux