lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Feb 2020 15:11:59 -0000
From:   "tip-bot2 for Thomas Gleixner" <>
Cc:     Thomas Gleixner <>,
        Vincenzo Frascino <>,
        x86 <>, LKML <>
Subject: [tip: timers/core] lib/vdso: Allow the high resolution parts to be
 compiled out

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

Commit-ID:     1dff4156d1f63b525c54aea7f097a657cbbbf837
Author:        Thomas Gleixner <>
AuthorDate:    Fri, 07 Feb 2020 13:38:50 +01:00
Committer:     Thomas Gleixner <>
CommitterDate: Mon, 17 Feb 2020 14:40:20 +01:00

lib/vdso: Allow the high resolution parts to be compiled out

If the architecture knows at compile time that there is no VDSO capable
clocksource supported it makes sense to optimize the guts of the high
resolution parts of the VDSO out at build time. Add a helper function to
check whether the VDSO should be high resolution capable and provide a stub
which can be overridden by an architecture.

Signed-off-by: Thomas Gleixner <>
Tested-by: Vincenzo Frascino <>
Reviewed-by: Vincenzo Frascino <>

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

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index f8b8ec5..5804e4e 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -38,6 +38,13 @@ u64 vdso_calc_delta(u64 cycles, u64 last, u64 mask, u32 mult)
+#ifndef __arch_vdso_hres_capable
+static inline bool __arch_vdso_hres_capable(void)
+	return true;
 static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
 			  struct __kernel_timespec *ts)
@@ -101,6 +108,10 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
 	u64 cycles, last, sec, ns;
 	u32 seq;
+	/* Allows to compile the high resolution parts out */
+	if (!__arch_vdso_hres_capable())
+		return -1;
 	do {
 		 * Open coded to handle VCLOCK_TIMENS. Time namespace

Powered by blists - more mailing lists