Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3962600imm; Mon, 17 Sep 2018 06:09:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYMtBV7QHSYOVB8PkqtIaO18SrKMBiWa6YoJmINoMDBE3GpWI08eJTc2FQkLsYcpUdcPOsD X-Received: by 2002:a63:f344:: with SMTP id t4-v6mr23740548pgj.428.1537189792063; Mon, 17 Sep 2018 06:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537189792; cv=none; d=google.com; s=arc-20160816; b=O4FMgi/vCvzCqMVcO/5vUOofBRCvg5ZBhtg4YSwEicPeWeehRHWEWmMj8TFLn78ZI7 9TCy8FNWkBuLB0K1xyEO131mAhAawe5gp5qfxEGAy5nc/fyVt/P18Goc0UL82EQQmM4e GDvi81rhKbWyJx391F/LUIv7ym1oDDQijGFEvtRmCNNxHUPTZ0yA1evGuq/Nsf9TNOuF 6z3PNhQgMgvpqzCqAf/jlXX3fPjLtAUgD2ZYRz3EUJrnA9HW/mGzioQSnP39UFzfAl+K BJn+rul2M4h9BsOnF93BYC50fe4mM4viX31PXC5opxZ0r5mWgMU3UFBLOx+2XP1cAt+A 0RIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id; bh=vNXreqRvAgV60NqImyKFUdkt3S4tI16qtArLgVfJpBc=; b=hTwHswBllXH2vZaUftKYlHdbIUZlN643yqH+fDt1v5TmqRB5BsMhAY7acYrjlZTuOu CxNree6t1WDF0CqayIFVPpsdIGuk68kdgzqu0ogoCFr8BCD+SBDYECnovSLMnPnWqc0k 3k4Ipm/vxmxaZ3TvNtq6u69ckH5VDHJXPeFXNIfMvRK+LPdYsRzOfeB7FLt02Ud+Sj/M Uh9x5Mb3KPkaB0fHiWTu0gvr4GW+o/yq3HYoqxWumR1k8k2MrEKwterAVbF+NTN3nYUd mU9w6lGBOjmv41JjZd5ZZpDtToaAp085/o2Uac898toKZtGM5lGn1Dhsfnp7cyQ/8Ixv E7pA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si16372503plr.120.2018.09.17.06.09.33; Mon, 17 Sep 2018 06:09:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728564AbeIQSgg (ORCPT + 99 others); Mon, 17 Sep 2018 14:36:36 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54837 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728526AbeIQSgf (ORCPT ); Mon, 17 Sep 2018 14:36:35 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1g1tHC-0005FU-4r; Mon, 17 Sep 2018 15:09:18 +0200 Message-Id: <20180917130707.823878601@linutronix.de> User-Agent: quilt/0.65 Date: Mon, 17 Sep 2018 14:45:44 +0200 From: Thomas Gleixner To: LKML Cc: Andy Lutomirski , x86@kernel.org, Peter Zijlstra , Matt Rickard , Stephen Boyd , John Stultz , Florian Weimer , "K. Y. Srinivasan" , Vitaly Kuznetsov , devel@linuxdriverproject.org, virtualization@lists.linux-foundation.org, Paolo Bonzini , Arnd Bergmann , Juergen Gross Subject: [patch V2 11/11] x66/vdso: Add CLOCK_TAI support References: <20180917124533.329334911@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=x66-vdso--Add-CLOCK_TAI-support.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the storage array in place it's now trivial to support CLOCK_TAI in the vdso. Extend the base time storage array and add the update code. Signed-off-by: Thomas Gleixner --- V2: Remove the masking trick arch/x86/entry/vsyscall/vsyscall_gtod.c | 4 ++++ arch/x86/include/asm/vgtod.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) --- a/arch/x86/entry/vsyscall/vsyscall_gtod.c +++ b/arch/x86/entry/vsyscall/vsyscall_gtod.c @@ -51,6 +51,10 @@ void update_vsyscall(struct timekeeper * base->sec = tk->xtime_sec; base->nsec = tk->tkr_mono.xtime_nsec; + base = &vdata->basetime[CLOCK_TAI]; + base->sec = tk->xtime_sec + (s64)tk->tai_offset; + base->nsec = tk->tkr_mono.xtime_nsec; + base = &vdata->basetime[CLOCK_MONOTONIC]; base->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec; nsec = tk->tkr_mono.xtime_nsec; --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h @@ -18,8 +18,8 @@ struct vgtod_ts { u64 nsec; }; -#define VGTOD_BASES (CLOCK_MONOTONIC_COARSE + 1) -#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC)) +#define VGTOD_BASES (CLOCK_TAI + 1) +#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | BIT(CLOCK_TAI)) #define VGTOD_COARSE (BIT(CLOCK_REALTIME_COARSE) | BIT(CLOCK_MONOTONIC_COARSE)) /*