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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 14 Mar 2008 22:42:05 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Alexander van Heukelum <heukelum@...tmail.fm>
Cc:	Andi Kleen <andi@...stfloor.org>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Alexander van Heukelum <heukelum@...lshack.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: merge the simple bitops and move them to bitops.h

On Fri, Mar 14, 2008 at 10:33:29PM +0100, Alexander van Heukelum wrote:
> static inline int fls64(__u64 x)
> {
>         __u32 h = x >> 32;
>         if (h)
>                 return fls(h) + 32;
>         return fls(x);
> }
> 
> I just wanted to move the 64-bit version to that header, with some
> ifdefs to select the right one.

That's still far more than the single 64bit instruction fls64 uses

> In fact I just found out that it only had an effect for 64 bit
> machines. Still, setting it unconditionally feels wrong.

I don't think your feeling is correct.

> 
> > > x86_64 has a mysterious inline function set_bit_string, which is
> > > only used by pci-calgary_64.c and pci-gart_64.c. Not sure what to
> > > do with it.
> > 
> > It's generic and could really live in linux/bitops.h
> 
> It could. But it is a trivial (slow?) implementation. Probably fine

It is this way because the callers in 95+% of all cases only
set a single bit. For that case it is not slow.

-Andi
--
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