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: <5398CFA4.60202@zytor.com>
Date:	Wed, 11 Jun 2014 14:52:36 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Sam Ravnborg <sam@...nborg.org>
CC:	linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org,
	linux-arch@...r.kernel.org, Andy Lutomirski <luto@...capital.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH RFC 00/10] tools: Revamp the unaligned endian access functions

On 06/11/2014 12:21 PM, Sam Ravnborg wrote:
> On Tue, Jun 10, 2014 at 04:13:04PM -0700, H. Peter Anvin wrote:
>> After a recent problem in the x86 tree, which seems to be the heaviest
>> but not the only user of these functions, I went through and did a
>> patchset to revamp the *user space* unaligned/endian accessor
>> functions.  As much as I think it is downright pathetic that this
>> functionality still isn't part of the C standard, that is life and we
>> have to deal with it.  Furthermore, although glibc has a pretty nice
>> set of functions for byte swapping in <endian.h>, taken from FreeBSD I
>> believe, some older systems don't support them.
>>
>> This variant tries to fill in all the holes.  It assumes that
>> <endian.h> define the functions as macros if they exist, as I don't
>> know any other way of probing for them without reaching for autoconf,
>> but that should be valid enough of an assumption in this case.
>>
>> The hope is that this should give reasonable, if not optimal, code
>> generation on most processors, and give a hook where arch maintainers
>> can add their own changes if needed.
> 
> This looks like a very complex solution to a simple problem.
> We want a shared implementation of the *user space*
> unaligned/endian accessor functions.
> But do we really want *fast* versions for our use?
> 
> This is not a new libc that should generate optimal code,
> but only something were we want to provide e working
> implmentation for use in our user-space tools.
> 
> A much simpler approach without any fallback to arch specific
> version etc. is everything we need.

It doesn't matter so much for things that are just done for the kernel
compile, no, but there are some tools that are built to be used as
standalone things, and it could matter there.

Please note that the code currently doesn't have any arch-specific bits
at all... the code is somewhat complex in part because it is very
generic and handles several levels of fallback.  It *can* get
arch-specific overrides if it matters, but the intent is that it
shouldn't be necessary in the vast majority of the cases.

	-hpa

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