Re: [PATCH v3 00/21] KVM: x86: Fix nested TSC scaling edge cases
From: Sean Christopherson
Date: Fri Oct 02 2026 - 17:12:32 EST
On Wed, 30 Sep 2026 10:36:14 -0700, Sean Christopherson wrote:
> Amirmohammad's fix to saturate L2's TSC frequency when stacking scale up/down
> ratios across L1+L2 yields a final scaling ratio that can't be plugged into
> hardware. The actual fix is functionally the same as v2, but I rewrote the
> comments and changelog to try and make them more approachable to KVM developers
> (AI has a habit of generating extremely verbose, "mathy" descriptions of bugs
> and fixes).
>
> [...]
Applied to kvm-x86 selftests. Yes, shoving KVM commits into the selftests
branch is awful, but the KVM changes are tiny in comparison, I don't want to
deal with the massive nVMX selftests conflicts, and this is at the very end of
the branch (I don't anticipate pulling anything else in at this point).
[01/21] KVM: x86: Saturate L2's TSC frequency if it exceeds hardware supports
https://github.com/kvm-x86/linux/commit/b701a8139fd6
[02/21] KVM: SVM: Fallback to the default TSC ratio if KVM tries to use a bad multiplier
https://github.com/kvm-x86/linux/commit/967e40fb1b08
[03/21] KVM: x86: Allow userspace to set KVM's max supported guest TSC frequency
https://github.com/kvm-x86/linux/commit/95eaeb7f202b
[04/21] KVM: selftests: Use KVM's pRNG to randomize L1's TSC ratio in TSC scaling test
https://github.com/kvm-x86/linux/commit/ed95a2725719
[05/21] KVM: selftests: Drop redundant VMWRITE of TSC_MULTIPLIER_HIGH
https://github.com/kvm-x86/linux/commit/b955d8fdabfe
[06/21] KVM: selftests: Drop unnecessary use of PRIu64 in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/17919fe61684
[07/21] KVM: selftests: Randomize L2's scale factor in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/19d963ed9a40
[08/21] KVM: selftests: Rename TSC freq checkers in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/771902aecbb4
[09/21] KVM: selftests: Extract guts of nested TSC scaling test to helper function
https://github.com/kvm-x86/linux/commit/6ab38c295d06
[10/21] KVM: selftests: Track L2 multiplier, not scale-up factor, in nested TSC test
https://github.com/kvm-x86/linux/commit/ff18d56a08b2
[11/21] KVM: selftests: Print out the failing L{0,1,2} level in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/df1613249f6f
[12/21] KVM: selftests: Allow +/- 1 tolerance if expected TSC frequency is <100
https://github.com/kvm-x86/linux/commit/faa4f010187c
[13/21] KVM: selftests: Use KVM's reported TSC KHz as L0's frequency (sanity checked)
https://github.com/kvm-x86/linux/commit/43f58b1ee6fe
[14/21] KVM: selftests: Explicitly pass TSC frequencies to guts of TSC scaling test
https://github.com/kvm-x86/linux/commit/b77a34ac9d8f
[15/21] KVM: selftests: Sanity check KVM's default TSC freq in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/6760d12380a4
[16/21] KVM: selftests: Test L1 "up" and L2 "down" in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/245932d3880c
[17/21] KVM: selftests: Verify that KVM saturates L2 TSC freq on {under,over}flow
https://github.com/kvm-x86/linux/commit/c2d3a10b90b1
[18/21] KVM: selftests: Test non-zero TSC offset on SVM in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/baada72b9c01
[19/21] KVM: selftests: Randomize L2's TSC offset in the nested TSC scaling test
https://github.com/kvm-x86/linux/commit/5f13a511c782
[20/21] KVM: selftests: Use GUEST_SYNC2() in nested TSC scaling test
https://github.com/kvm-x86/linux/commit/a744d1c1655d
[21/21] KVM: selftests: Spell out UCALL in nested TSC scaling test's enums
https://github.com/kvm-x86/linux/commit/bef953c06980
--
https://github.com/kvm-x86/linux/tree/next