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:	Tue, 26 Jan 2016 11:31:03 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Johannes Berg <johannes@...solutions.net>,
	Simon Arlott <simon@...e.lp0.eu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Revert "regmap-mmio: Use native endianness for
 read/write"

On Tue, Jan 26, 2016 at 10:09:35AM +0100, Arnd Bergmann wrote:

> * On 32-bit architectures, you generally cannot do 64-bit atomic I/O
>   operations, and we have two implementations that do it nonatomically,
>   depending on how a device is wired to the bus, see
>   include/linux/io-64-nonatomic-{hi-lo,lo-hi}.h.
>   I think we should just not go there for regmap unless we absolutely
>   have to.

That's fine, we don't support 64 bit MMIO regmaps on 32 bit systems
anyway (they're ifdefed out and will generate an error if you try to use
them).  If someone wants that functionality they can sort it out.

> However, we have some freedom at the regmap-mmio level, which we can
> sanitize in 4.6 if we want to make it more consistent with the rest
> of regmap. We have around 50 callers of {devm_,}regmap_init_mmio()
> and almost all of them do not specify endianess but expect little-endian
> behavior. We can change all existing instances to set REGMAP_ENDIAN_NATIVE
> explicitly and change regmap_init_mmio() to return an error if the
> caller does not specify a particular endianess (big, little, native).

As far as I can tell almost all the users actually want little endian
(everyone except these MIPS users) so if we're going to go through and
change all the users we should be going for that.  Given that things
just won't work if they have the wrong endianness I'm reasonably
comfortable with keeping a default in the core - so long as the core is
explicit about what it's doing so unlikely to get confused I think we
are reasonably safe.

> This is a tradeoff between interface simplicity (defaulting to LE is
> convenient for most people) and consistency (all other regmap interfaces
> default to native if I understood Mark right).

All other regmaps default to either native or big endian (native for
things with explicit read and write operations, big for byte stream
buses).

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ