linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] KVM: x86: hyper-v: Fix TSC page update after KVM_SET_CLOCK(0) call
@ 2021-03-31 12:41 Vitaly Kuznetsov
  2021-03-31 12:41 ` [PATCH v3 1/2] KVM: x86: Prevent 'hv_clock->system_time' from going negative in kvm_guest_time_update() Vitaly Kuznetsov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vitaly Kuznetsov @ 2021-03-31 12:41 UTC (permalink / raw)
  To: kvm, Paolo Bonzini
  Cc: Sean Christopherson, Wanpeng Li, Jim Mattson, Marcelo Tosatti,
	linux-kernel

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(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-31 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 12:41 [PATCH v3 0/2] KVM: x86: hyper-v: Fix TSC page update after KVM_SET_CLOCK(0) call Vitaly Kuznetsov
2021-03-31 12:41 ` [PATCH v3 1/2] KVM: x86: Prevent 'hv_clock->system_time' from going negative in kvm_guest_time_update() Vitaly Kuznetsov
2021-03-31 12:41 ` [PATCH v3 2/2] selftests: kvm: Check that TSC page value is small after KVM_SET_CLOCK(0) Vitaly Kuznetsov
2021-03-31 15:08 ` [PATCH v3 0/2] KVM: x86: hyper-v: Fix TSC page update after KVM_SET_CLOCK(0) call Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).