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:	Fri, 8 Feb 2013 09:24:11 +0100
From:	Michal Simek <monstr@...str.eu>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	linux-kernel@...r.kernel.org,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Arnd Bergmann <arnd@...db.de>,
	Will Deacon <will.deacon@....com>, linux-arch@...r.kernel.org
Subject: Re: [PATCH] asm-generic: io: Fix ioread16/32be and iowrite16/32be

2013/2/8 Geert Uytterhoeven <geert@...ux-m68k.org>:
> On Thu, Feb 7, 2013 at 3:18 PM, Michal Simek <michal.simek@...inx.com> wrote:
>> Fix ioreadXXbe and iowriteXXbe functions which did
>> additional little endian conversion on native big endian systems.
>> Using be_to_cpu (cpu_to_be) conversions with __raw_read/write
>> functions have resolved it.
>>
>> Signed-off-by: Michal Simek <michal.simek@...inx.com>
>> CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>
>> CC: Arnd Bergmann <arnd@...db.de>
>> CC: Geert Uytterhoeven <geert@...ux-m68k.org>
>> CC: Will Deacon <will.deacon@....com>
>> CC: linux-arch@...r.kernel.org
>
> I have one question (see below). Apart from that:
> Acked-by: Geert Uytterhoeven <geert@...ux-m68k.org>
>
>> -#define ioread16be(addr)       be16_to_cpu(ioread16(addr))
>> +#define ioread16be(addr)       __be16_to_cpu(__raw_readw(addr))
>
> Why did you change it to the __beX_to_cpu variant with underscores?

The question could be probably different. Why are they even defined?
I have grepped the kernel and all archs use these generic macros

include/linux/byteorder/generic.h:94:#define be32_to_cpu __be32_to_cpu
include/linux/byteorder/generic.h:106:#define be32_to_cpup __be32_to_cpup
include/linux/byteorder/generic.h:118:#define be32_to_cpus __be32_to_cpus

What about to remove them?

Back to you question. I can't remember particular reason for that maybe
just experience that __ versions should be the fastest kernel implementation.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
--
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