Changes since v1: - Fix the issue by casting 'hv_clock->system_time' to s64 in compute_tsc_page_parameters() instead of clamping its value to zero in kvm_guest_time_update() [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: hyper-v: Properly divide maybe-negative 'hv_clock->system_time' in compute_tsc_page_parameters() selftests: kvm: Check that TSC page value is small after KVM_SET_CLOCK(0) arch/x86/kvm/hyperv.c | 9 ++++++--- tools/testing/selftests/kvm/x86_64/hyperv_clock.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) -- 2.30.2