public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Huw Davies <huw@codeweavers.com>
To: linux kernel <linux-kernel@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>, Andy Lutomirski <luto@kernel.org>
Subject: [PATCH 3/3] x86/vdso: Add support for CLOCK_MONOTONIC_RAW in the vDSO
Date: Thu, 11 Apr 2019 11:12:05 +0100	[thread overview]
Message-ID: <20190411101205.10006-4-huw@codeweavers.com> (raw)
In-Reply-To: <20190411101205.10006-1-huw@codeweavers.com>

This is particularly useful for Wine which needs to implement Win32
API clock functions whose values do not get adjusted by adjtimex().

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
---
 arch/x86/entry/vsyscall/vsyscall_gtod.c | 6 ++++++
 arch/x86/include/asm/vgtod.h            | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_gtod.c b/arch/x86/entry/vsyscall/vsyscall_gtod.c
index ddc6a71df87c..fe3458caf301 100644
--- a/arch/x86/entry/vsyscall/vsyscall_gtod.c
+++ b/arch/x86/entry/vsyscall/vsyscall_gtod.c
@@ -68,6 +68,12 @@ void update_vsyscall(struct timekeeper *tk)
 	base->mult = tk->tkr_mono.mult;
 	base->shift = tk->tkr_mono.shift;
 
+	base = &vdata->basetime[CLOCK_MONOTONIC_RAW];
+	base->sec = tk->raw_sec;
+	base->nsec = tk->tkr_raw.xtime_nsec;
+	base->mult = tk->tkr_raw.mult;
+	base->shift = tk->tkr_raw.shift;
+
 	base = &vdata->basetime[CLOCK_REALTIME_COARSE];
 	base->sec = tk->xtime_sec;
 	base->nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift;
diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index ae0d76491595..0b76ba884e25 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -30,7 +30,8 @@ struct vgtod_ts {
 };
 
 #define VGTOD_BASES	(CLOCK_TAI + 1)
-#define VGTOD_HRES	(BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | BIT(CLOCK_TAI))
+#define VGTOD_HRES	(BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | \
+			BIT(CLOCK_MONOTONIC_RAW) | BIT(CLOCK_TAI))
 #define VGTOD_COARSE	(BIT(CLOCK_REALTIME_COARSE) | BIT(CLOCK_MONOTONIC_COARSE))
 
 /*
-- 
2.17.1


      parent reply	other threads:[~2019-04-11 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 10:12 [PATCH 0/3] x86/vdso: Add support for CLOCK_MONOTONIC_RAW in the vDSO Huw Davies
2019-04-11 10:12 ` [PATCH 1/3] x86/vdso: Remove unused 'mask' member Huw Davies
2019-04-14 10:36   ` Thomas Gleixner
2019-04-11 10:12 ` [PATCH 2/3] x86/vdso: Allow clock specific mult and shift values Huw Davies
2019-04-14 10:53   ` Thomas Gleixner
2019-04-15  9:30     ` Huw Davies
2019-04-15  9:51       ` Thomas Gleixner
2019-04-15 10:15         ` Vincenzo Frascino
2019-04-15 12:14           ` Huw Davies
2019-05-30 14:21             ` Vincenzo Frascino
2019-04-11 10:12 ` Huw Davies [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190411101205.10006-4-huw@codeweavers.com \
    --to=huw@codeweavers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox