Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

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


Hi Xiaoyao,

On Wed, Apr 24, 2024 at 11:57:11PM +0800, Xiaoyao Li wrote:
> Date: Wed, 24 Apr 2024 23:57:11 +0800
> From: Xiaoyao Li <>
> Subject: Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock
>  feature name
> On 3/29/2024 6:19 PM, Zhao Liu wrote:
> > From: Zhao Liu <zhao1.liu@xxxxxxxxx>
> > 
> > Hi list,
> > 
> > This series is based on Paolo's guest_phys_bits patchset [1].
> > 
> > Currently, the old and new kvmclocks have the same feature name
> > "kvmclock" in FeatureWordInfo[FEAT_KVM].
> > 
> > When I tried to dig into the history of this unusual naming and fix it,
> > I realized that Tim was already trying to rename it, so I picked up his
> > renaming patch [2] (with a new commit message and other minor changes).
> > 
> > 13 years age, the same name was introduced in [3], and its main purpose
> > is to make it easy for users to enable/disable 2 kvmclocks. Then, in
> > 2012, Don tried to rename the new kvmclock, but the follow-up did not
> > address Igor and Eduardo's comments about compatibility.
> > 
> > Tim [2], not long ago, and I just now, were both puzzled by the naming
> > one after the other.
> The commit message of [3] said the reason clearly:
>   When we tweak flags involving this value - specially when we use "-",
>   we have to act on both.
> So you are trying to change it to "when people want to disable kvmclock,
> they need to use '-kvmclock,-kvmclock2' instead of '-kvmclock'"
> IMHO, I prefer existing code and I don't see much value of differentiating
> them. If the current code puzzles you, then we can add comment to explain.

It's enough to just enable kvmclock2 for Guest; kvmclock (old) is
redundant in the presence of kvmclock2.

So operating both feature bits at the same time is not a reasonable
choice, we should only keep kvmclock2 for Guest. It's possible because
the oldest linux (v4.5) which QEMU i386 supports has kvmclock2.

Pls see:

With this in mind, I'm trying to implement a silky smooth transition to
"only kcmclock2 support".

This series is now separating kvmclock and kvmclock2, and then I plan to
go to the KVM side and deprecate kvmclock2, and then finally remove
kvmclock (old) in QEMU. Separating the two features makes the process

Continuing to use the same name equally would have silently caused the
CPUID to change on the Guest side, which would have hurt compatibility
as well.

> > So, this series is to push for renaming the new kvmclock feature to
> > "kvmclock2" and adding compatibility support for older machines (PC 9.0
> > and older).
> > 
> > Finally, let's put an end to decades of doubt about this name.
> > 
> > 
> > Next Step
> > =========
> > 
> > This series just separates the two kvmclocks from the naming, and in
> > subsequent patches I plan to stop setting kvmclock(old kcmclock) by
> > default as long as KVM supports kvmclock2 (new kvmclock).
> No. It will break existing guests that use KVM_FEATURE_CLOCKSOURCE.

Please refer to my elaboration on v4.5 above, where kvmclock2 is
available, it should be used in priority.

> > Also, try to deprecate the old kvmclock in KVM side.
> > 
> > [1]:
> > [2]:
> > [3]:
> > [4]:


[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