On Wed, 2026-07-01 at 14:38 -0700, Sean Christopherson wrote:
> 
> >                     pr_info("TSC scaling supported\n");
> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > index a29896a9ef14..ed207cc7692d 100644
> > --- a/arch/x86/kvm/vmx/vmx.c
> > +++ b/arch/x86/kvm/vmx/vmx.c
> > @@ -8672,7 +8672,7 @@ __init int vmx_hardware_setup(void)
> >     if (!enable_apicv || !cpu_has_vmx_ipiv())
> >             enable_ipiv = false;
> >   
> > -   if (cpu_has_vmx_tsc_scaling())
> > +   if (cpu_has_vmx_tsc_scaling() && boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
> 
> We should clear SECONDARY_EXEC_TSC_SCALING in setup_vmcs_config().  Failure to
> clear the vmcs_config bit will advertise the feature to L2 and allow it to be
> enabled in vmcs12, but KVM will ultimately not honor the scaling in vmcs02:
> 
>       if (kvm_caps.has_tsc_control)
>               vmcs_write64(TSC_MULTIPLIER, vcpu->arch.tsc_scaling_ratio);
> 
> This series kinda sorta gets there with "KVM: x86: Remove pvclock_gtod_data 
> and
> private timekeeping code", but that change looks misplaced?  And I think 
> clearing
> the bit this late will lead to false failures in vmx_check_processor_compat() 
> due
> to the golden config clearing the bit, but the local config having it set.

Ack. Folded into v6:

https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/kvmclock6
https://git.infradead.org/?p=users/dwmw2/linux.git;a=commitdiff;h=144587d50edf

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to