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

Re: [PATCH v7 00/36] Cleaning up the KVM clock mess



On Tue, 2026-07-28 at 16:18 -0700, Sean Christopherson wrote:
> I'll post a new version up through here, get it applied soon-ish, and
> then get back to chipping away at the rest of the series.

Thanks. I'll leave that first part alone now, and rebase the remainder
on top of what lands. 

Not sure why Sashiko didn't reply to v6, but I've addressed the two
real bugs it found in v7:

 - "Re-synchronize TSC after KVM_SET_TSC_KHZ" made kvm_set_tsc_khz()
   call kvm_synchronize_tsc() with a non-NULL value, which set
   kvm->arch.user_set_tsc from the kernel's own vCPU-creation path and
   thus enabled the 1-second slop heuristic before userspace ever
   wrote a TSC — breaking restore of a guest with <1s of runtime.
   Fixed by making "user initiated" an explicit parameter instead of
   inferring it from the pointer being non-NULL. I've also added a
   selftest which fails on v7 and passes with the fix (first user
   write of a TSC value ~500ms of cycles from the kernel default gets
   snapped back to the default generation by the bug).

 - The S4 backwards-TSC adjustment in "Kill last_tsc_{nsec,write,
   offset} fields" adjusted cur_tsc_offset by the raw host-cycle delta
   while each vCPU's offset moves by the guest-scaled delta (via
   adjust_tsc_offset_host()), so they disagreed for scaled guests. And
   the cur_tsc_write adjustment shouldn't have existed at all — the
   guest TSC is kept continuous across S4 and the {cur_tsc_nsec,
   cur_tsc_write} pair lives in the wall-clock/guest-cycle domain.

Also fixed the unused-function breakage you hit in "Use
ktime_get_snapshot_id() for master clock" (the private readers are now
deleted in that patch, where their last callers go away), a stale
paragraph in the kvm_synchronize_tsc() changelog, the ΔT*freq unit
confusion in the TSC migration documentation, and a handful of
legitimate selftest nits from the same review.

All pushed to a kvmclock8 branch (which is identical up to commit
dcbe8dc4ca "Remove implicit rdtsc()"):
https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/kvmclock8

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.