possible bug in powerpc LE compat syscalls with 64-bit args

Adhemerval Zanella adhemerval.zanella at linaro.org
Fri Jun 17 01:56:57 AEST 2016



On 16/06/2016 12:36, Chris Metcalf wrote:
> 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
> 

I am not fully familiar with kernel policy regarding ABI so is this considered
an ABI breakage or a real defect?


More information about the Linuxppc-dev mailing list