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] [day] [month] [year] [list]
Date:	Mon, 02 Mar 2009 18:09:19 -0800
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Hellwig <hch@...radead.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Boaz Harrosh <bharrosh@...asas.com>
Subject: Re: [PATCH 1/2] byteorder: add load/store_{endian} API

On Mon, 2009-03-02 at 17:51 -0800, Linus Torvalds wrote:
> 
> On Mon, 2 Mar 2009, Harvey Harrison wrote:
> > 
> > OK, static inline it is then. Would you be opposed to an API like:
> > 
> > get_le16
> > put_le16
> > 
> > to match with 
> >
> > get_unaligned_le16
> > put_unaligned_le16
> > 
> > And make the existing unaligned helpers typesafe?
> 
> That sounds much better to me. That said, I'm also wondering what the 
> upside is of this all?
> 

1) Recognize that some drivers/subsystems want this, or already
implement it privately

2) [micro-optimization] Allow arches that do provide load/store swapped
instructions to be used more often.

3) make it more likely that people will actually use the unaligned
helpers rather than open-coding the byteswapping, allowing arches that
have no alignment constraints to just do regular loads if possible.

Disadvantages:

1) existing users of the get_unaligned bits may/will produce sparse
warnings on the flag day

2) the existing argument ordering of put_unaligned is opposite what
is usually expected in such a helper

3) [nitpicky] get/put almost always means reference taking/releasing,
load/store is the usual verb used for such an API.

Harvey

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