Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1988699imm; Sat, 6 Oct 2018 15:28:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV61N6iEQKJlcUEpP7qfSOao4PgegGymb7zlw4Y7aKRIwfURPlmaER5JcZW34oaXnRglZYgX5 X-Received: by 2002:a17:902:ab8a:: with SMTP id f10-v6mr17784722plr.203.1538864935948; Sat, 06 Oct 2018 15:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538864935; cv=none; d=google.com; s=arc-20160816; b=WtrWa249UnFgeb3t31J1Dq6dM0BsgEb/+aJ3NmlaiKVxV4k7piKNfS9RxGyvu7ueGm DXrDkgtKsnSJmvW6vYHb1JHavHxlk3146trMCo90MplMtzvIlksoKLNRXFrmsLoGK26s pK6BCO0AQI0w+WATmvOq9/kazUOlEiLm1L7lwHi//FIPao6dCu/bvFVlm2nuUKCORvka UlhTSAEK5UtUf0BTrEgRQubmpcs5k+7KpDJ56HkxQVHA3MJqLTYgRIbM35Fiek7OitR3 8cYaf2VSQCfEW2TqzlsOqEjxUpm+1m2103Ytlx2vDbpAbG8yqZO/dY1DKGH22cyWKQ09 BrBw== 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=XwZkXmYpOotWIvIPYI9LhCXR+qIQd/hnlkrtjsv8Cmo=; b=t/iVvr278w37/U+J65dXXSXvhIGJ+XemqREH6hjJi/BrWMQDO0wfFIYJ5JhnfQptkS 2bQxd5iNbsyCklnE1TuuzhCGHP4U0CyM5NwZ0aiVE6wQM6js7dt3HHLYBInsDkmUFzGV tYtJGy8X3ymn1Gl21yt04hEflxw9aB6aIw4CTZ/ruCwgx9/VOd4tpiortYqumIgY+q1w 8qZ0HMKzHTDidFaVicGJ/XBiaBTNE2dkRfI9MB51OOYBTTyPkGYV2ZAurWS0+31Ro+pz TkmJ3OlEx8QqeOSGJ7Jkk/y0OP6jz+y58esmRFSs8xjJCtyFbZ05IheJ6hAcibdfHBKq H2iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DPId6INq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c184-v6si13915797pfg.215.2018.10.06.15.28.23; Sat, 06 Oct 2018 15:28:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DPId6INq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726117AbeJGFdT (ORCPT + 99 others); Sun, 7 Oct 2018 01:33:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:54964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbeJGFdT (ORCPT ); Sun, 7 Oct 2018 01:33:19 -0400 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B6EB214FF for ; Sat, 6 Oct 2018 22:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538864899; bh=Pm4HyIK0Lnie+pFEWmr9H5YcN4c27rPEanb+Nmc75fI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DPId6INqcQj+KYzwi9TdJSv4rQX1V+el09roRnbKpeLAEYOxjDaD6Ad9rQ5LfPBZY 6k5k3leig2G8/IFYmkv3H5C8dYDxA46MHIy9QSYFsbm7CHFw1dhm7TVspl6ArXE40A IhtK0nvfMfxfAg5WZMuXUtxsDEhYXafeyDhP/yUM= Received: by mail-wr1-f42.google.com with SMTP id 61-v6so16183450wrb.6 for ; Sat, 06 Oct 2018 15:28:19 -0700 (PDT) X-Gm-Message-State: ABuFfojL8QTI2oME7N7vJhnivrrXhnf/zFYFnRGS0BFjR1MIyjTKcWoa dPxabTCz3cItGfpw7DHkOpn55+WhzGomkCAG/jE2XQ== X-Received: by 2002:adf:e387:: with SMTP id e7-v6mr12207669wrm.94.1538864897441; Sat, 06 Oct 2018 15:28:17 -0700 (PDT) MIME-Version: 1.0 References: <20180914125006.349747096@linutronix.de> <87sh1ne64t.fsf@vitty.brq.redhat.com> <20181003190617.GC21381@amt.cnet> <87k1mycfju.fsf@vitty.brq.redhat.com> <20181004081100.GI19272@hirez.programming.kicks-ass.net> <20181004193150.GQ19272@hirez.programming.kicks-ass.net> <499807AB-E779-40C3-AA3F-E8C77A7770EC@amacapital.net> <20181006202731.GC7129@amt.cnet> In-Reply-To: <20181006202731.GC7129@amt.cnet> From: Andy Lutomirski Date: Sat, 6 Oct 2018 15:28:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support To: Marcelo Tosatti Cc: Andrew Lutomirski , Peter Zijlstra , Vitaly Kuznetsov , Thomas Gleixner , Paolo Bonzini , Radim Krcmar , Wanpeng Li , LKML , X86 ML , Matt Rickard , Stephen Boyd , John Stultz , Florian Weimer , KY Srinivasan , devel@linuxdriverproject.org, Linux Virtualization , Arnd Bergmann , Juergen Gross 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 Sat, Oct 6, 2018 at 1:29 PM Marcelo Tosatti wrote: > > On Thu, Oct 04, 2018 at 03:15:32PM -0700, Andy Lutomirski wrote: > > For better or for worse, I'm trying to understand this code. So far, > > I've come up with this patch: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/vdso-tglx&id=14fd71e12b1c4492a06f368f75041f263e6862bf > > > > Is it correct, or am I missing some subtlety? > > The master clock, when initialized, has a pair > > masterclockvalues=(TSC value, time-of-day data). > > When updating the guest clock, we only update relative to (TSC value) > that was read on masterclock initialization. I don't see the problem. The masterclock data is updated here: host_tsc_clocksource = kvm_get_time_and_clockread( &ka->master_kernel_ns, &ka->master_cycle_now); kvm_get_time_and_clockread() gets those values from do_monotonic_boot(), which, barring bugs, should cause get_kvmclock_ns() to return exactly the same thing as ktime_get_boot_ns() + ka->kvmclock_offset, albeit in a rather roundabout manner. So what am I missing? Is there actually something wrong with my patch? > > See the following comment on x86.c: I read that comment, and it's not obvious to me how it's related.