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: <20070307172449.GR16509@flower.upol.cz>
Date:	Wed, 7 Mar 2007 18:24:49 +0100
From:	Oleg Verych <olecom@...wer.upol.cz>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	David Howells <dhowells@...hat.com>,
	Al Viro <viro@....linux.org.uk>, akpm@...ux-foundation.org,
	benh@...nel.crashing.org, linux-kernel@...r.kernel.org,
	hpa@...or.com, johannes@...solutions.net
Subject: Re: ALIGN via ilog2 without gccisms (Re: [PATCH] Fix get_order())

On Wed, Mar 07, 2007 at 08:38:27AM -0800, Linus Torvalds wrote:
> 
> 
> On Wed, 7 Mar 2007, Oleg Verych wrote:
> >
> > Probably it can be used to get rid of gccisms and "type fluff" due to
> > bitwise arithmetics in ALIGN?
> 
> Hell no.
> 
> The typeof is there to make sure we have the right type, and it's simple.
> 
> The current ALIGN() macro is efficient as hell (generating just a simple 
> mask+add). Turning it into some kind of horrible thing that uses ilog2() 
> would be a total mistake.

GCC's assembler version of this macro is optimized as needed.

But i wanted to address Al's statement about using typeof():

,-*- [ Message-ID: <20061127044138.GA3078@....linux.org.uk> ]
|IOW, gcc allows type to leak out of scope it's been defined in (and
|typeof adds even more fun to the picture).  It not only goes against
|a _lot_ in C, it's actually not thought through by gcc folks.  Just
|try to mix that with variable-length arrays and watch it blow up
|in interesting ways...
`-*-

As for me, this is example of assembler's need, that very hard to
implement in C. Also, i doubt, C's shift doing any "type fluff" on its
only argument.

> Also, your ALIGN() macro was broken. That's not how ALIGN() is supposed to 
> work.

Yes, maybe so.
____

-
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