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]
Date:	Fri, 01 Aug 2008 14:23:37 -0700
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Grant Grundler <grundler@...isc-linux.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Kyle McMartin <kyle@...artin.ca>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 14/20] parisc: use the new byteorder headers

On Fri, 2008-08-01 at 10:06 -0600, Grant Grundler wrote:
> On Thu, Jul 17, 2008 at 05:09:43PM -0700, Harvey Harrison wrote:
> > Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
> > ---
> >  include/asm-parisc/byteorder.h |   37 ++++++++++++-------------------------
> >  1 files changed, 12 insertions(+), 25 deletions(-)
> > 
> > diff --git a/include/asm-parisc/byteorder.h b/include/asm-parisc/byteorder.h
> > index db14831..5e56b1b 100644
> > --- a/include/asm-parisc/byteorder.h
> > +++ b/include/asm-parisc/byteorder.h
> > @@ -4,9 +4,10 @@
> >  #include <asm/types.h>
> >  #include <linux/compiler.h>
> >  
> > -#ifdef __GNUC__
> > +#define __LITTLE_ENDIAN
> 
> Sorry, this looks wrong. parisc is big endian.

Sorry, it is wrong.  It of course should be __BIG_ENDIAN

> > +#define __SWAB_64_THRU_32__
> 
> Should this only be defined if BITS_PER_LONG is <=32  ?
> 

The new byteorder headers only uses this if no __arch_swab64 is defined.

Further down in the parisc version, an __arch_swab64 is defined in the
BITS_PER_LONG >=32 case, making this moot.

>>From the new linux/swab.h:

static inline __attribute_const__ __u64 ___swab64(__u64 val)
{
#ifdef __arch_swab64
	return __arch_swab64(val);
#elif defined(__arch_swab64p)
	return __arch_swab64p(&val);
#elif defined(__SWAB_64_THRU_32__)
	__u32 h = val >> 32;
	__u32 l = val & ((1ULL << 32) - 1);
	return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h)));
#else
	return __const_swab64(val);
#endif
}

Other than the endianness, any other concerns?

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