Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp495754ybm; Fri, 29 May 2020 05:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRTYdghhAMIRVo0cSCEOtF+sD1H1knMTSsaA8gxJ4BmiHMCaBpSd+pEuTZUhT1yzfzk2n5 X-Received: by 2002:a17:906:2dc8:: with SMTP id h8mr7830104eji.108.1590755029624; Fri, 29 May 2020 05:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590755029; cv=none; d=google.com; s=arc-20160816; b=xiB3CevTg2GiV656tWfYJJZOhNYuC/YYOdsVxmxrfdZIvac9MD6zRDhqDlpLq1THMS IxtgTaTDe1IJ/SvDmAVsqDrrjIOm5u/qwpDmknqoA+rw5E7UzixHRGzVXa7Ol9A+mLx8 uhlqIHpkT6+HH3uMpNtU43IRxWuasUS7ij7J8ZpkB1FrRGXuum7ijsLlbr9oMGhbACut mm4KL3iw3WYWcYhiXdkz5RUaYI7xwuM8n+C02qgA8r2zceNAc6f4iS3VwUFLChhzjZQP iuoywmYebrA/jRaNnqJgCoFDDN+iNU7J/qs7AOZ8DATTQgu5R1pdXHC2lJdMHm+qBplz kSYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=jStWwmxjReIiWgbyLXuq8NotDR1kXol5rsD3it56dJs=; b=BaVm1ZVxgiDBPclsbIRrjCEBI9SXh9OVDNaG5o4NHTjaZxRGwiF8wbYfO7cX+B58DS bEdkyWpKNkhDWOcU6DJHoawetP5QkjUn4Jb2sTWJ4AQYAobRmOiry490IE8GyWBonQiD z/AzYBfJg1VpV+OkzKM8AflEjXUZ577/vX5Qc+9hoJVs9g72EhrfJJ9U0wieSD3Q5PaE LHfz0LZqJm51BdhXLmexnzP8xdiHjkUZjiy3XhpgDZeIAHfFedVI1oymmQLiUWlHlxAa w5dHTUAUcsrJ8tQ7x+CBJXSD/6i339t5ILutrvQLNICa4sIjrLWfHtpIeC+oqYJWabUC gqZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si5480897ejc.110.2020.05.29.05.23.26; Fri, 29 May 2020 05:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgE2MVk (ORCPT + 99 others); Fri, 29 May 2020 08:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgE2MVj (ORCPT ); Fri, 29 May 2020 08:21:39 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B85D2C03E969; Fri, 29 May 2020 05:21:39 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jee10-0003wZ-1U; Fri, 29 May 2020 14:21:34 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 48CEB100C2D; Fri, 29 May 2020 14:21:33 +0200 (CEST) From: Thomas Gleixner To: Miklos Szeredi Cc: kvm@vger.kernel.org, Paolo Bonzini , Vincenzo Frascino , Juergen Gross , linux-kernel@vger.kernel.org Subject: Re: system time goes weird in kvm guest after host suspend/resume In-Reply-To: References: <875zcfoko9.fsf@nanos.tec.linutronix.de> Date: Fri, 29 May 2020 14:21:33 +0200 Message-ID: <87r1v3lynm.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos, Miklos Szeredi writes: > On Fri, May 29, 2020 at 11:51 AM Miklos Szeredi wrote: >> On Thu, May 28, 2020 at 10:43 PM Thomas Gleixner wrote: >> > >> > Miklos Szeredi writes: >> > > Bisected it to: >> > > >> > > b95a8a27c300 ("x86/vdso: Use generic VDSO clock mode storage") >> > > >> > > The effect observed is that after the host is resumed, the clock in >> > > the guest is somewhat in the future and is stopped. I.e. repeated >> > > date(1) invocations show the same time. >> > >> > TBH, the bisect does not make any sense at all. It's renaming the >> > constants and moving the storage space and I just read it line for line >> > again that the result is equivalent. I'll have a look once the merge >> > window dust settles a bit. >> >> Yet, reverting just that single commit against latest linus tree fixes >> the issue. Which I think is a pretty good indication that that commit >> *is* doing something. A revert on top of Linus latest surely does something, it disables VDSO because clocksource.vdso_clock_mode becomes NONE. That's a data point maybe, but it clearly does not restore the situation _before_ that commit. >> The jump forward is around 35 minutes; that seems to be consistent as >> well. > > Oh, and here's a dmesg extract for the good case: > > [ 26.402239] clocksource: timekeeping watchdog on CPU0: Marking > clocksource 'tsc' as unstable because the skew is too large: > [ 26.407029] clocksource: 'kvm-clock' wd_now: > 635480f3c wd_last: 3ce94a718 mask: ffffffffffffffff > [ 26.407632] clocksource: 'tsc' cs_now: > 92d2e5d08 cs_last: 81305ceee mask: ffffffffffffffff > [ 26.409097] tsc: Marking TSC unstable due to clocksource watchdog > > and the bad one: > > [ 36.667576] clocksource: timekeeping watchdog on CPU1: Marking > clocksource 'tsc' as unstable because the skew is too large: > [ 36.690441] clocksource: 'kvm-clock' wd_now: > 89885027c wd_last: 3ea987282 mask: ffffffffffffffff > [ 36.690994] clocksource: 'tsc' cs_now: > 95666ec22 cs_last: 84e747930 mask: ffffffffffffffff > [ 36.691901] tsc: Marking TSC unstable due to clocksource watchdog And the difference is? It's 10 seconds later and the detection happens on CPU1 and not on CPU0. I really don't see what you are reading out of this. Can you please describe the setup of this test? - Host kernel version - Guest kernel version - Is the revert done on the host or guest or both? - Test flow is: Boot host, start guest, suspend host, resume host, guest is screwed correct? Thanks, tglx