Skip to content

KVM: x86: hyper-v: Fix TSC page update after KVM_SET_CLOCK(0) call

Vitaly Kuznetsov kvm lkml 3 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v22 patches 10 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Fix the issue by using master_kernel_ns/get_kvmclock_base_ns() instead of get_kvmclock_ns() when handling KVM_SET_CLOCK.
- Rebase on Paolo's "KVM: x86: fix lockdep splat due to Xen runstate update" series and use spin_lock_irq()/spin_unlock_irq() [Paolo]

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: x86: Prevent 'hv_clock->system_time' from going negative in kvm_guest_time_update()arch/x86/kvm/x86.c+17 -20 replies
2/2selftests: kvm: Check that TSC page value is small after KVM_SET_CLOCK(0)tools/testing/selftests/kvm/x86_64/hyperv_clock.c+11 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] KVM: x86: hyper-v: Fix TSC page update after KVM_SET_CLOCK(0) call

Changes since v2:
- Fix the issue by using master_kernel_ns/get_kvmclock_base_ns() instead of get_kvmclock_ns() when handling KVM_SET_CLOCK.
- Rebase on Paolo's "KVM: x86: fix lockdep splat due to Xen runstate update" series and use spin_lock_irq()/spin_unlock_irq() [Paolo]

Original description:

I discovered that after KVM_SET_CLOCK(0) TSC page value in the guest can go through the roof and apparently we have a signedness issue when the update is performed. Fix the issue and add a selftest.

Vitaly Kuznetsov (2):
KVM: x86: Prevent 'hv_clock->system_time' from going negative in
kvm_guest_time_update()
selftests: kvm: Check that TSC page value is small after

    KVM_SET_CLOCK(0)
 arch/x86/kvm/x86.c                            | 19 +++++++++++++++++--
 .../selftests/kvm/x86_64/hyperv_clock.c       | 13 +++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
Signature · 1 line
2.30.2