Re: [PATCH v2 0/3] Support "generic" CPUID timing leaf as KVM guest and host

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

 



On Tue, 2025-09-02 at 10:49 -0700, Sean Christopherson wrote:
> 
> > So even if a VMM has set the TSC frequency VM-wide with KVM_SET_TSC_KHZ
> > instead of doing it the old per- vCPU way, how can it get the results for a
> > specific VM?
> 
> I don't see any need for userspace to query per-VM support.  What I'm proposing
> is that KVM advertise the feature if the bare metal TSC is constant and the CPU
> supports TSC scaling.  Beyond that, _KVM_ doesn't need to do anything to ensure
> the guest sees a constant frequency, it's userspace's responsibility to provide
> a sane configuration.
> 
> And strictly speaking, CPUID is per-CPU, i.e. it's architecturally legal to set
> per-vCPU frequencies and then advertise a different frequency in CPUID for each
> vCPU.  That's all but guaranteed to break guests as most/all kernels assume that
> TSC operates at the same frequency on all CPUs, but as above, that's userspace's
> responsibility to not screw up.

Sure, but doesn't that make this whole thing orthogonal to the original
problem being solved? Because userspace still doesn't *know* the actual
effective TSC frequency, whether it's scaled or not.

Or are you suggesting that we add the leaf (with unscaled values) in
KVM_GET_SUPPORTED_CPUID and *also* 'correct' the values if userspace
does pass that leaf to its guests, as I had originally proposed?

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


[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