Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp504123ybm; Fri, 29 May 2020 05:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7JmeqE/3ergbqkPkdDbooKlBB3MBwkrzxcv2HIq0/htNDXclxQXDcE5uR57fbswGhokUM X-Received: by 2002:a05:6402:22a5:: with SMTP id cx5mr8490493edb.246.1590755790739; Fri, 29 May 2020 05:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590755790; cv=none; d=google.com; s=arc-20160816; b=Nk20ng8TQcbxn+65+u1eYVMA4n8ooQtTl9iVh9+oEovBz6EpDQB/IS33NxLyWOsQEB SV8Wd+0I1rS7PIMtx54ND1W4O0PF6Y/MmdccqcJTkkkXaSR1CrtNApH7Ofif3h34Lc/G HM8EjKvxCt7YBc+5zUwtkMlFA9FKZGhKP5hxRLd14FP9SDWYizPcs5MyPpFU7tUiF0RE pk/QHJjGYtF/+mvGVv0lVfFWoVVU6wQWwbrddaAlkIX+s6LsZh1KHcmSEQ3EzrG5q6km xAnhLEh+NGjigI91f2d+qbIbV3Z0TozzDOrIvS8WbyvLp2vCRZToAFlZrP5IBsYlCp9l Rs3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BSX+fgALxeDo66TlmBZRvGUGpirIUX7OaMfEiJ8VgVc=; b=myIA4clXgtm4r/mfpzzPNC2e7PP9uEZaCNt5s6s/lvGglQQ6BPo3l1kpUtYPd+S+Gu yr+W5vM62fb0+yqosrv9wFKOEkdSlYs4gkWjnZDjY8fTkUvWhCiJFfJPjCAuJZx1PXsQ +DRv2W0P2oOvqMChNx9lUDCfaAtXr+RZCwRtfTs9QFTndOVgA+i0UN4otHtgQ5ydY9VJ 7mDNfxHah8BSmx3lYLCmLpFnf6o4lmLJ9vWin5sBf7/yMtt25TUd23UHkphouEuQTNDi ineBEi4RkOQol4M7uIqihgN4Wet5/RxgPs74SdiEwQVc+cH6gIx0ih6ccCJ0tdnr8Hva CxSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Ed756vTx; 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 a4si5574456ejr.560.2020.05.29.05.36.06; Fri, 29 May 2020 05:36:30 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Ed756vTx; 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 S1726629AbgE2Mb6 (ORCPT + 99 others); Fri, 29 May 2020 08:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgE2Mb5 (ORCPT ); Fri, 29 May 2020 08:31:57 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1308FC03E969 for ; Fri, 29 May 2020 05:31:57 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id e10so1626683edq.0 for ; Fri, 29 May 2020 05:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BSX+fgALxeDo66TlmBZRvGUGpirIUX7OaMfEiJ8VgVc=; b=Ed756vTx8vjBHmmtuSvsE+s5/eTQIQZkHdjkSOIvH5dbxiRq4xJ49dIXhAxD2nncE8 imzXFTYbRNqurkW4gOK3fXeFbv1M8bCQ/VYojaotKpmsr9kkG5NaJefAsy3Ss1vlVDgj XiK/n7NHoaT6ELCXRMWt57emfy3wGlO5DEzHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BSX+fgALxeDo66TlmBZRvGUGpirIUX7OaMfEiJ8VgVc=; b=NTWkriNNSyKzgtyv5CuitE62Fex6kLelvXbaqIBPZc1tEl5LdwTq3ERwgCObE5EVIi dPGglUekdT18w0yZ/WpwCtwn8373fvi7u+ybn2JB2yqWjjjFA3rDZwwVnngXXfDCZjiw AydPK5Ol2z/W3xKuY4fK4AH2U9bb6jNYBmYm+xF5MzEUheDZuo1DNxNazt5gAzK44/k0 C90HmPFTS4r94mQz/WhPuRWLtxqSFiHxhye1DDS8jIFQjfELWiKwbSZvUTV2PByda5qa ZOcraIWUHk/EfCWjr7KfY6Do3CiER36QxwnQyGY1FzO+OgpFqoyDTHTXwhVy+B4U1QFP lz2g== X-Gm-Message-State: AOAM5335pNgpR4/puQLMfWbvMdvh38mjKzGOiLMFWuE556KovhYgLFKD uYdENjEzqcynWwocjwTdWDh0v1OxTsAUFT3W0069cA== X-Received: by 2002:a50:d785:: with SMTP id w5mr7827583edi.212.1590755515767; Fri, 29 May 2020 05:31:55 -0700 (PDT) MIME-Version: 1.0 References: <875zcfoko9.fsf@nanos.tec.linutronix.de> <87r1v3lynm.fsf@nanos.tec.linutronix.de> In-Reply-To: <87r1v3lynm.fsf@nanos.tec.linutronix.de> From: Miklos Szeredi Date: Fri, 29 May 2020 14:31:44 +0200 Message-ID: Subject: Re: system time goes weird in kvm guest after host suspend/resume To: Thomas Gleixner Cc: kvm@vger.kernel.org, Paolo Bonzini , Vincenzo Frascino , Juergen Gross , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 2:21 PM Thomas Gleixner wrote: > > 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. I didn't even try to interpret this. Just reporting what I'm seeing. > 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? Yep. Thanks, Miklos