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: <65e57211-7983-477a-af94-1bdab57574b4@outer-limits.org>
Date: Mon, 3 Feb 2025 11:21:09 +0100
From: Julian Vetter <julian@...er-limits.org>
To: Arnd Bergmann <arnd@...db.de>,
 "James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
 Helge Deller <deller@....de>
Cc: linux-parisc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] parisc: Remove memcpy_fromio

On 1/31/25 08:28, Arnd Bergmann wrote:
> On Thu, Jan 30, 2025, at 14:48, Julian Vetter wrote:
>> Fully migrate parisc to the IO functions from lib/iomem_copy.c. In a
>> recent patch the functions memset_io and memcpy_toio were removed, but
>> the memcpy_fromio was kept, because for very short sequences it does
>> half word accesses, whereas the functions in lib/iomem_copy.c do byte
>> accesses until the memory is naturally aligned and then do machine word
>> accesses. But I don't think the single half-word access merits keeping
>> the arch specific implementation, so, remove it as well.
>>
>> Signed-off-by: Julian Vetter <julian@...er-limits.org>
> 
> Acked-by: Arnd Bergmann <arnd@...db.de>
> 
> This one looks fairly obvious. It might be nice to also
> clean up the {in,out}s{b,w,l} helper functions in the same
> file, but I don't understand why those are special
> in the first place.
> 
Not sure, either. But some comments contain: "just using the inlined 
version of the inw() breaks things". This is clear, and what you point 
out below already, these parisc specific functions deal with unaligned 
buffers, so using, e.g., the generic "inw()" will surely break things.

> Those functions have been unchanged since before the git
> history and there are some comments that I don't find helpful.
> One thing they do is to deal with unaligned memory buffers,
> which the generic ones don't, but that could be easily added
> using get_unaligned/put_unaligned, expecting the compiler
> to optimize the memory side of the transfer.

I'm not sure what you suggest. Do you mean adding 
get_unaligned/put_unaligned in the generic include/asm-generic/io.h 
functions, or just adding get_unaligned/put_unaligned to the body of the 
parisc specific functions? Instead of all the "switch... case 0x2..." code?

Julian

> 
>       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ