All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Christophe Leroy" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Christophe Leroy <christophe.leroy@c-s.fr>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	x86 <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [tip: timers/core] lib/vdso: Allow fixed clock mode
Date: Mon, 17 Feb 2020 19:18:47 -0000	[thread overview]
Message-ID: <158196712757.13786.8896334064344185928.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200207124403.748756829@linutronix.de>

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     ae12e08539de6717502c2f9f83bd60df939b5c08
Gitweb:        https://git.kernel.org/tip/ae12e08539de6717502c2f9f83bd60df939b5c08
Author:        Christophe Leroy <christophe.leroy@c-s.fr>
AuthorDate:    Fri, 07 Feb 2020 13:39:02 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 17 Feb 2020 20:12:18 +01:00

lib/vdso: Allow fixed clock mode

Some architectures have a fixed clocksource which is known at compile time
and cannot be replaced or disabled at runtime, e.g. timebase on
PowerPC. For such cases the clock mode check in the VDSO code is pointless.

Move the check for a VDSO capable clocksource into an inline function and
allow architectures to redefine it via a macro.

[ tglx: Removed the #ifdef mess ]

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.748756829@linutronix.de



---
 lib/vdso/gettimeofday.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index a76ac8d..8eb6d1e 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -46,6 +46,13 @@ static inline bool __arch_vdso_hres_capable(void)
 }
 #endif
 
+#ifndef vdso_clocksource_ok
+static inline bool vdso_clocksource_ok(const struct vdso_data *vd)
+{
+	return vd->clock_mode != VDSO_CLOCKMODE_NONE;
+}
+#endif
+
 #ifdef CONFIG_TIME_NS
 static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
 			  struct __kernel_timespec *ts)
@@ -66,7 +73,7 @@ static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
 	do {
 		seq = vdso_read_begin(vd);
 
-		if (unlikely(vd->clock_mode == VDSO_CLOCKMODE_NONE))
+		if (unlikely(!vdso_clocksource_ok(vd)))
 			return -1;
 
 		cycles = __arch_get_hw_counter(vd->clock_mode);
@@ -134,7 +141,7 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
 		}
 		smp_rmb();
 
-		if (unlikely(vd->clock_mode == VDSO_CLOCKMODE_NONE))
+		if (unlikely(!vdso_clocksource_ok(vd)))
 			return -1;
 
 		cycles = __arch_get_hw_counter(vd->clock_mode);

  parent reply	other threads:[~2020-02-17 19:19 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 12:38 [patch V2 00/17] VDSO consolidation Thomas Gleixner
2020-02-07 12:38 ` [patch V2 01/17] x86/vdso: Mark the TSC clocksource path likely Thomas Gleixner
2020-02-14 12:00   ` Vincenzo Frascino
2020-02-17 15:12   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 02/17] ARM: vdso: Remove unused function Thomas Gleixner
2020-02-14 10:21   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 03/17] lib/vdso: Allow the high resolution parts to be compiled out Thomas Gleixner
2020-02-14 11:54   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 04/17] ARM: vdso: Compile high resolution parts conditionally Thomas Gleixner
2020-02-14 11:55   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 05/17] MIPS: " Thomas Gleixner
2020-02-14 11:55   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 06/17] clocksource: Cleanup struct clocksource and documentation Thomas Gleixner
2020-02-14 11:57   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 07/17] x86/vdso: Move VDSO clocksource state tracking to callback Thomas Gleixner
2020-02-14 11:58   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 08/17] clocksource: Add common vdso clock mode storage Thomas Gleixner
2020-02-17 10:36   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 09/17] x86/vdso: Use generic VDSO " Thomas Gleixner
2020-02-14 10:32   ` Paolo Bonzini
2020-02-17 10:57   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 10/17] mips: vdso: " Thomas Gleixner
2020-02-17 10:52   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-17 19:18   ` tip-bot2 for Thomas Gleixner
2020-02-07 12:38 ` [patch V2 11/17] ARM/arm64: vdso: Use common vdso " Thomas Gleixner
2020-02-17 10:43   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-17 19:18   ` tip-bot2 for Thomas Gleixner
     [not found]   ` <CGME20200221115643eucas1p12ecb95c6161853a0e7dfe9207db079be@eucas1p1.samsung.com>
2020-02-21 11:56     ` [patch V2 11/17] " Marek Szyprowski
2020-02-21 11:56       ` Marek Szyprowski
2020-02-21 13:08       ` Vincenzo Frascino
2020-02-21 13:08         ` Vincenzo Frascino
2020-02-21 18:24       ` Vincenzo Frascino
2020-02-21 18:24         ` Vincenzo Frascino
2020-02-07 12:38 ` [patch V2 12/17] lib/vdso: Cleanup clock mode storage leftovers Thomas Gleixner
2020-02-17 11:04   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-17 19:18   ` tip-bot2 for Thomas Gleixner
2020-02-07 12:39 ` [patch V2 13/17] lib/vdso: Avoid highres update if clocksource is not VDSO capable Thomas Gleixner
2020-02-17 11:07   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-17 19:18   ` tip-bot2 for Thomas Gleixner
2020-02-07 12:39 ` [patch V2 14/17] lib/vdso: Move VCLOCK_TIMENS to vdso_clock_modes Thomas Gleixner
2020-02-17 11:12   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-02-17 19:18   ` tip-bot2 for Thomas Gleixner
2020-02-07 12:39 ` [patch V2 15/17] lib/vdso: Allow fixed clock mode Thomas Gleixner
2020-02-17 11:14   ` Vincenzo Frascino
2020-02-17 15:11   ` [tip: timers/core] " tip-bot2 for Christophe Leroy
2020-02-17 19:18   ` tip-bot2 for Christophe Leroy [this message]
2020-02-07 12:39 ` [patch V2 16/17] lib/vdso: Allow architectures to override the ns shift operation Thomas Gleixner
2020-02-17 11:15   ` Vincenzo Frascino
2020-02-07 12:39 ` [patch V2 17/17] lib/vdso: Allow architectures to provide the vdso data pointer Thomas Gleixner
2020-02-17 12:09   ` Vincenzo Frascino

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=158196712757.13786.8896334064344185928.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.