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: <20061101163043.GA2602@elf.ucw.cz>
Date:	Wed, 1 Nov 2006 17:30:43 +0100
From:	Pavel Machek <pavel@....cz>
To:	Paolo 'Blaisorblade' Giarrusso <blaisorblade@...oo.it>
Cc:	Andrew Morton <akpm@...l.org>, Andi Kleen <ak@....de>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] Make x86_64 udelay() round up instead of down.

Hi!

> From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@...oo.it>
> 
> Port two patches from i386 to x86_64 delay.c to make sure all rounding is done
> upward instead of downward.
> 
> There is no sign in commit messages that the mismatch was done on purpose, and
> "delay() guarantees sleeping at least for the specified time" is still a valid
> rule IMHO.

> diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
> index 50be909..7514df0 100644
> --- a/arch/x86_64/lib/delay.c
> +++ b/arch/x86_64/lib/delay.c
> @@ -40,13 +40,13 @@ EXPORT_SYMBOL(__delay);
>  
>  inline void __const_udelay(unsigned long xloops)
>  {
> -	__delay((xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32);
> +	__delay((xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32 + 1);

Well, if this should be *rounding* up, you should do 

(xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy + 0xffffffff) >> 32

, no? Not sure if it matters...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ