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-next>] [day] [month] [year] [list]
Date:	Sat, 1 Aug 2009 19:37:18 +0200
From:	Loïc Grenié <loic.grenie@...il.com>
To:	linux-kernel <linux-kernel@...r.kernel.org>,
	Ralf Baechle <ralf@...ux-mips.org>
Subject: Strange arch/mips/delay.c

  I could not compile for mips without something similar to the
following patch. As far as I can say __udelay and __ndelay
are costly nops (with __ndelay not compiling at all) without
the patch.

  At that point, it might be interesting to change
the 0x00000005uLL by 0x00000045uLL and the >> 32
by >> 36 (the precision is much better and the cost
should be the same -- obviously there is a slightly higher
risk of overlow).

    Thanks,

           Loïc Grenié

Signed-off-by: Loic Grenie <loic.grenie@...il.com>

--- a/arch/mips/lib/delay.c
+++ b/arch/mips/lib/delay.c
@@ -43,7 +43,7 @@ void __udelay(unsigned long us)
 {
        unsigned int lpj = current_cpu_data.udelay_val;

-       __delay((us * 0x000010c7 * HZ * lpj) >> 32);
+       __delay((us * 0x000010c7uLL * HZ * lpj) >> 32);
 }
 EXPORT_SYMBOL(__udelay);

@@ -51,6 +51,6 @@ void __ndelay(unsigned long ns)
 {
        unsigned int lpj = current_cpu_data.udelay_val;

-       __delay((us * 0x00000005 * HZ * lpj) >> 32);
+       __delay((ns * 0x00000005uLL * HZ * lpj) >> 32);
 }
 EXPORT_SYMBOL(__ndelay);
--
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