KVM: nVMX: Restore a preemption timer consistency check
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 13 Feb 2019 00:42:23 +0000 (16:42 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Feb 2019 18:38:25 +0000 (19:38 +0100)
A recently added preemption timer consistency check was unintentionally
dropped when the consistency checks were being reorganized to match the
SDM's ordering.

Fixes: 461b4ba4c7ad ("KVM: nVMX: Move the checks for VM-Execution Control Fields to a separate helper function")
Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c

index 8b45205b4e1d94cb9b307aeccdcf25dcd0cd3779..d737a51a53ca368b3a223e2ed41e397a7abbafbd 100644 (file)
@@ -2473,6 +2473,10 @@ static int nested_check_vm_execution_controls(struct kvm_vcpu *vcpu,
            (nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id))
                return -EINVAL;
 
+       if (!nested_cpu_has_preemption_timer(vmcs12) &&
+           nested_cpu_has_save_preemption_timer(vmcs12))
+               return -EINVAL;
+
        if (nested_cpu_has_ept(vmcs12) &&
            !valid_ept_address(vcpu, vmcs12->ept_pointer))
                return -EINVAL;