linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* possible bug in powerpc LE compat syscalls with 64-bit args
@ 2016-06-16 15:36 Chris Metcalf
  2016-06-16 15:56 ` Adhemerval Zanella
  2016-06-17  1:52 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Metcalf @ 2016-06-16 15:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	linuxppc-dev, Adhemerval Zanella, Mike Frysinger

Adhemerval Zanella is cleaning up the preadv/pwritev implementation in glibc
and came across an issue with the tilepro/tilegx32 implementation of argument
passing for 64-bit arguments in split register pairs.

The glibc code base uses __LONG_LONG_PAIR to split 64-bit arguments,
passing "hi, lo" for BE systems and "lo, hi" for LE systems.  Tile is almost uniformly
LE, but we do support BE for specific customers.  The 32-bit compat mode on
tilegx was getting passed "hi, lo" arguments by glibc but looking for them to
be "lo, hi" arguments on the kernel side.  I fixed this here:

https://lkml.kernel.org/g/1466019219-10462-1-git-send-email-cmetcalf@mellanox.com

Reviewing what other platforms do, it seems like powerpc compat mode may
have the opposite problem in little-endian mode, since arguments are passed
in "hi, lo" order unconditionally in arch/powerpc/kernel/sys_ppc32.c.  You may
want to adopt the solution in the patch cited above, or similar solutions
elsewhere, eg regs_to_64 in arch/arm64/include/asm/assembler.h, or
merge_64 in arch/mips/kernel/linux32.c.

Here's the email thread from libc-alpha:

https://sourceware.org/ml/libc-alpha/2016-06/msg00638.html

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <28c367c1-0f60-cd1d-b443-d3876798a627__12262.0927206755$1466112970$gmane$org@mellanox.com>]

end of thread, other threads:[~2016-06-17 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 15:36 possible bug in powerpc LE compat syscalls with 64-bit args Chris Metcalf
2016-06-16 15:56 ` Adhemerval Zanella
2016-06-17  1:52 ` Michael Ellerman
     [not found] <28c367c1-0f60-cd1d-b443-d3876798a627__12262.0927206755$1466112970$gmane$org@mellanox.com>
2016-06-16 21:42 ` Andreas Schwab
2016-06-17 20:46   ` Chris Metcalf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).