public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Sean Christopherson <seanjc@google.com>
Subject: [GIT PULL] KVM: x86: PV clock changes for 6.15
Date: Tue, 18 Mar 2025 11:02:58 -0700	[thread overview]
Message-ID: <20250318180303.283401-4-seanjc@google.com> (raw)
In-Reply-To: <20250318180303.283401-1-seanjc@google.com>

Fix a variety of bugs, flaws, and warts related to KVM's handling of PV clocks
and the associated PVCLOCK_GUEST_STOPPED flag.  Note, there are still a pile of
issues with KVM's PV clock code; hopefully the next version of those changes[*]
comes along sooner than later.

[*] https://lore.kernel.org/all/20240522001817.619072-1-dwmw2@infradead.org

The following changes since commit a64dcfb451e254085a7daee5fe51bf22959d52d3:

  Linux 6.14-rc2 (2025-02-09 12:45:03 -0800)

are available in the Git repository at:

  https://github.com/kvm-x86/linux.git tags/kvm-x86-pvclock-6.15

for you to fetch changes up to 1b3c38050b5cc07f6873f244f845fb6c8549ce85:

  KVM: x86: Override TSC_STABLE flag for Xen PV clocks in kvm_guest_time_update() (2025-02-12 10:45:55 -0800)

----------------------------------------------------------------
KVM PV clock changes for 6.15:

 - Don't take kvm->lock when iterating over vCPUs in the suspend notifier to
   fix a largely theoretical deadlock.

 - Use the vCPU's actual Xen PV clock information when starting the Xen timer,
   as the cached state in arch.hv_clock can be stale/bogus.

 - Fix a bug where KVM could bleed PVCLOCK_GUEST_STOPPED across different
   PV clocks.

 - Restrict PVCLOCK_GUEST_STOPPED to kvmclock, as KVM's suspend notifier only
   accounts for kvmclock, and there's no evidence that the flag is actually
   supported by Xen guests.

 - Clean up the per-vCPU "cache" of its reference pvclock, and instead only
   track the vCPU's TSC scaling (multipler+shift) metadata (which is moderately
   expensive to compute, and rarely changes for modern setups).

----------------------------------------------------------------
Sean Christopherson (11):
      KVM: x86: Don't take kvm->lock when iterating over vCPUs in suspend notifier
      KVM: x86: Eliminate "handling" of impossible errors during SUSPEND
      KVM: x86: Drop local pvclock_flags variable in kvm_guest_time_update()
      KVM: x86: Process "guest stopped request" once per guest time update
      KVM: x86/xen: Use guest's copy of pvclock when starting timer
      KVM: x86: Don't bleed PVCLOCK_GUEST_STOPPED across PV clocks
      KVM: x86: Set PVCLOCK_GUEST_STOPPED only for kvmclock, not for Xen PV clock
      KVM: x86: Pass reference pvclock as a param to kvm_setup_guest_pvclock()
      KVM: x86: Remove per-vCPU "cache" of its reference pvclock
      KVM: x86: Setup Hyper-V TSC page before Xen PV clocks (during clock update)
      KVM: x86: Override TSC_STABLE flag for Xen PV clocks in kvm_guest_time_update()

 arch/x86/include/asm/kvm_host.h |   3 +-
 arch/x86/kvm/x86.c              | 115 ++++++++++++++++++++--------------------
 arch/x86/kvm/xen.c              |  69 +++++++++++++++++++++---
 3 files changed, 121 insertions(+), 66 deletions(-)

  parent reply	other threads:[~2025-03-18 18:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 18:02 [GIT PULL] KVM: x86: Changes for 6.15 Sean Christopherson
2025-03-18 18:02 ` [GIT PULL] KVM: x86: Misc changes " Sean Christopherson
2025-03-18 18:02 ` [GIT PULL] KVM: x86: MMU " Sean Christopherson
2025-03-18 18:02 ` Sean Christopherson [this message]
2025-03-18 18:02 ` [GIT PULL] KVM: Selftests changes for 6.15, part 2 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: Selftests changes for 6.15, part 1 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: SVM changes for 6.15 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: VMX " Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: Xen " Sean Christopherson
2025-03-19 17:53 ` [GIT PULL] KVM: x86: Changes " Paolo Bonzini
2025-03-19 19:42   ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250318180303.283401-4-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox