lists.openwall.net   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  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:   Fri, 14 Feb 2020 11:54:59 +0000
From:   Vincenzo Frascino <vincenzo.frascino@....com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     x86@...nel.org, John Stultz <john.stultz@...aro.org>,
        Andy Lutomirski <luto@...nel.org>,
        Christophe Leroy <christophe.leroy@....fr>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Juergen Gross <jgross@...e.com>,
        Michael Kelley <mikelley@...rosoft.com>,
        Sasha Levin <sashal@...nel.org>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Paul Burton <paulburton@...nel.org>,
        James Hogan <jhogan@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Marc Zyngier <maz@...nel.org>, Andrei Vagin <avagin@...il.com>
Subject: Re: [patch V2 03/17] lib/vdso: Allow the high resolution parts to be
 compiled out

On 2/7/20 12:38 PM, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
> 
> 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 <tglx@...utronix.de>
> 

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@....com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@....com>

> ---
>  lib/vdso/gettimeofday.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -38,6 +38,13 @@ u64 vdso_calc_delta(u64 cycles, u64 last
>  }
>  #endif
>  
> +#ifndef __arch_vdso_hres_capable
> +static inline bool __arch_vdso_hres_capable(void)
> +{
> +	return true;
> +}
> +#endif
> +
>  #ifdef CONFIG_TIME_NS
>  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
>  	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
> 

-- 
Regards,
Vincenzo

Powered by blists - more mailing lists