KVM: nVMX: Add consistency check for TSC_MULTIPLIER=0

Add a missing consistency check on the TSC Multiplier being '0'.  Per the
SDM:

  If the "use TSC scaling" VM-execution control is 1, the TSC-multiplier
  must not be zero.

Fixes: d041b5ea93 ("KVM: nVMX: Enable nested TSC scaling")
Link: https://lore.kernel.org/r/20250919005955.1366256-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Sean Christopherson 2025-09-18 17:59:52 -07:00
parent 15fe455dd1
commit ae8e6ad841

View File

@ -2962,6 +2962,10 @@ static int nested_check_vm_execution_controls(struct kvm_vcpu *vcpu,
}
}
if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_TSC_SCALING) &&
CC(!vmcs12->tsc_multiplier))
return -EINVAL;
return 0;
}