[PATCH] ARM: fix memset64() on big-endian

David Laight david.laight.linux at gmail.com
Fri Jan 2 15:05:33 PST 2026


On Fri, 2 Jan 2026 15:22:20 +0000
Matthew Wilcox <willy at infradead.org> wrote:

> On Fri, Jan 02, 2026 at 08:15:46AM +0100, Thomas Weißschuh wrote:
> > On big-endian systems the 32-bit low and high halves need to be swapped,
> > for the underlying assembly implemenation to work correctly.  
> 
> Heh.  In my heart, ARM will always be a litte-endian architecture.
> I'm not really surprised this bug took, er, 8 years to show up; big-endian
> arm is rare enough and memset64() isn't much used on 32-bit systems.
> And it turns out that many of the users pass a constant 0 as the value,
> which was kind of not the point, but it seems to be an easier API to
> use than memset, so whatever ;-)

I'd have thought that part of the point of memset64() was to remove
all the 'alignment' and 'tail handling' that a normal memset() has.
Clearly someone thought otherwise :-)

	David

> 
> > Fixes: fd1d362600e2 ("ARM: implement memset32 & memset64")
> > Cc: stable at vger.kernel.org
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>  
> 
> Reviewed-by: Matthew Wilcox (Oracle) <willy at infradead.org>
> 




More information about the linux-arm-kernel mailing list