From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge Date: Fri, 05 Sep 2014 18:39:49 +0200 Message-ID: <5409E755.4040905@redhat.com> References: <1409835487-14371-1-git-send-email-pbonzini@redhat.com> <5408D815.9090105@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: linux-kernel@vger.kernel.org, chris.j.arges@canonical.com, kvm@vger.kernel.org, John Stultz To: Thomas Gleixner Return-path: Received: from mail-wi0-f175.google.com ([209.85.212.175]:42126 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbaIEQj5 (ORCPT ); Fri, 5 Sep 2014 12:39:57 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 05/09/2014 17:14, Thomas Gleixner ha scritto: > So that means the code is correct. Now where is the bug? In kernel/time/timekeeping.c? We know that we should have base_mono = wall_to_monotonic + xtime_sec Instead it is base_mono = wall_to_monotonic + xtime_sec - seconds from boot time which is... zero. Given this is the only use of base_mono in a notifier, I wonder if it is as simple as this (which I don't have time to test right now): diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index fb4a9c2cf8d9..f6807a85b8c9 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -443,9 +443,9 @@ static void timekeeping_update(struct timekeeper *tk, unsigned int action) ntp_clear(); } update_vsyscall(tk); - update_pvclock_gtod(tk, action & TK_CLOCK_WAS_SET); tk_update_ktime_data(tk); + update_pvclock_gtod(tk, action & TK_CLOCK_WAS_SET); if (action & TK_MIRROR) memcpy(&shadow_timekeeper, &tk_core.timekeeper, :) Paolo > Well hidden and still so obvious that it's even visible through the > brown paperpag I'm wearing ...