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: <193a81555a87a6d499fbe889406eeb2014465ec5.camel@amazon.com>
Date: Wed, 6 Nov 2024 17:42:38 +0000
From: "Okanovic, Haris" <harisokn@...zon.com>
To: "cl@...two.org" <cl@...two.org>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "rafael@...nel.org"
	<rafael@...nel.org>, "sudeep.holla@....com" <sudeep.holla@....com>,
	"boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
	"ankur.a.arora@...cle.com" <ankur.a.arora@...cle.com>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
	"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>, "wanpengli@...cent.com"
	<wanpengli@...cent.com>, "joao.m.martins@...cle.com"
	<joao.m.martins@...cle.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "catalin.marinas@....com"
	<catalin.marinas@....com>, "mingo@...hat.com" <mingo@...hat.com>,
	"pbonzini@...hat.com" <pbonzini@...hat.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "misono.tomohiro@...itsu.com"
	<misono.tomohiro@...itsu.com>, "daniel.lezcano@...aro.org"
	<daniel.lezcano@...aro.org>, "arnd@...db.de" <arnd@...db.de>,
	"lenb@...nel.org" <lenb@...nel.org>, "will@...nel.org" <will@...nel.org>,
	"hpa@...or.com" <hpa@...or.com>, "peterz@...radead.org"
	<peterz@...radead.org>, "maobibo@...ngson.cn" <maobibo@...ngson.cn>,
	"vkuznets@...hat.com" <vkuznets@...hat.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "Okanovic, Haris"
	<harisokn@...zon.com>, "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"bp@...en8.de" <bp@...en8.de>, "mtosatti@...hat.com" <mtosatti@...hat.com>,
	"x86@...nel.org" <x86@...nel.org>, "mark.rutland@....com"
	<mark.rutland@....com>
Subject: Re: [PATCH 3/5] arm64: refactor delay() to enable polling for value

On Tue, 2024-11-05 at 11:42 -0800, Christoph Lameter (Ampere) wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
> 
> 
> 
> 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.
> 

You're right, good catch. Should be `nsecs * 0x5UL` per old code.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ