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  linux-hardening  linux-cve-announce  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]
Message-ID: <efd92a03-f5a9-ba9b-338f-b9a5ad93174f@gentwo.org>
Date: Tue, 5 Nov 2024 11:42:58 -0800 (PST)
From: "Christoph Lameter (Ampere)" <cl@...two.org>
To: Haris Okanovic <harisokn@...zon.com>
cc: ankur.a.arora@...cle.com, catalin.marinas@....com, 
    linux-pm@...r.kernel.org, kvm@...r.kernel.org, 
    linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
    will@...nel.org, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, 
    dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com, 
    pbonzini@...hat.com, wanpengli@...cent.com, vkuznets@...hat.com, 
    rafael@...nel.org, daniel.lezcano@...aro.org, peterz@...radead.org, 
    arnd@...db.de, lenb@...nel.org, mark.rutland@....com, mtosatti@...hat.com, 
    sudeep.holla@....com, misono.tomohiro@...itsu.com, maobibo@...ngson.cn, 
    joao.m.martins@...cle.com, boris.ostrovsky@...cle.com, 
    konrad.wilk@...cle.com
Subject: Re: [PATCH 3/5] arm64: refactor delay() to enable polling for
 value

On Tue, 5 Nov 2024, Haris Okanovic wrote:

> -#define USECS_TO_CYCLES(time_usecs)			\
> -	xloops_to_cycles((time_usecs) * 0x10C7UL)
> -
> -static inline unsigned long xloops_to_cycles(unsigned long xloops)
> +static inline u64 xloops_to_cycles(u64 xloops)
>  {
>  	return (xloops * loops_per_jiffy * HZ) >> 32;
>  }
>
> -void __delay(unsigned long cycles)
> +#define USECS_TO_XLOOPS(time_usecs) \
> +	((time_usecs) * 0x10C7UL)
> +
> +#define USECS_TO_CYCLES(time_usecs) \
> +	xloops_to_cycles(USECS_TO_XLOOPS(time_usecs))
> +


> +#define NSECS_TO_XLOOPS(time_nsecs) \
> +	((time_nsecs) * 0x10C7UL)

The constant here is the same value as for microseconds. If I remember
correctly its 5UL for nanoseconds.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ