Skip to content

Commit 315f28f

Browse files
committed
x66/vdso: Add CLOCK_TAI support
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 <tglx@linutronix.de> Tested-by: Matt Rickard <matt@softrans.com.au> Acked-by: Andy Lutomirski <luto@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephen Boyd <sboyd@kernel.org> Cc: John Stultz <john.stultz@linaro.org> Cc: Florian Weimer <fweimer@redhat.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: devel@linuxdriverproject.org Cc: virtualization@lists.linux-foundation.org Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Juergen Gross <jgross@suse.com> Link: https://lkml.kernel.org/r/20180917130707.823878601@linutronix.de
1 parent 3e89bf3 commit 315f28f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/x86/entry/vsyscall/vsyscall_gtod.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ void update_vsyscall(struct timekeeper *tk)
5151
base->sec = tk->xtime_sec;
5252
base->nsec = tk->tkr_mono.xtime_nsec;
5353

54+
base = &vdata->basetime[CLOCK_TAI];
55+
base->sec = tk->xtime_sec + (s64)tk->tai_offset;
56+
base->nsec = tk->tkr_mono.xtime_nsec;
57+
5458
base = &vdata->basetime[CLOCK_MONOTONIC];
5559
base->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec;
5660
nsec = tk->tkr_mono.xtime_nsec;

arch/x86/include/asm/vgtod.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struct vgtod_ts {
1818
u64 nsec;
1919
};
2020

21-
#define VGTOD_BASES (CLOCK_MONOTONIC_COARSE + 1)
22-
#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC))
21+
#define VGTOD_BASES (CLOCK_TAI + 1)
22+
#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | BIT(CLOCK_TAI))
2323
#define VGTOD_COARSE (BIT(CLOCK_REALTIME_COARSE) | BIT(CLOCK_MONOTONIC_COARSE))
2424

2525
/*

0 commit comments

Comments
 (0)