[PATCH v4 02/20] powerpc: Use generic fallocate compatibility syscall
Arnd Bergmann
arnd at arndb.de
Mon Sep 12 21:07:56 AEST 2022
On Mon, Sep 12, 2022, at 1:00 PM, Christophe Leroy wrote:
> Le 12/09/2022 à 11:57, Arnd Bergmann a écrit :
>> On Mon, Sep 12, 2022, at 10:38 AM, Nicholas Piggin wrote:
>>
>> The powerpc difference is that in little-endian mode, only
>> the 'len' argument is swapped but the 'offset' argument is
>> still high/low:
>>
>> long compat_sys_fallocate(int fd, int mode, u32 offset1, u32 offset2,
>> u32 len1, u32 len2)
>> {
>> return ksys_fallocate(fd, mode, ((loff_t)offset1 << 32) | offset2,
>> merge_64(len1, len2));
>> }
>>
>> It's probably best to first fix this by using merge_64(offset1,
>> offset2) and allow that patch to be backported to stable kernels,
>> before changing it over to the generic code in a separate patch
>> within that series.
>>
>> A related issue seems to exist in ppc_fadvise64_64(), which
>> uses the wrong argument order on ppc32le compat tasks, in addition
>> to having at least three different calling conventions across
>> architectures.
>
> Do ppc32le exist at all ?
>
> Native ppc32 is be only, and I'm not aware that ppc64 is able to run
> ppc32le compat tasks.
I'm not aware of anyone using it, but commit 6e944aed8859
("powerpc/64: Make COMPAT user-selectable disabled on littleendian
by default.") added support to the kernel, and commit
57f48b4b74e7 ("powerpc/compat_sys: swap hi/lo parts of 64-bit
syscall args in LE mode") changed the compat syscall helpers
to pass 64-bit arguments correctly but apparently got fallocate()
and fadvise64_64() wrong.
With Rohan's series, we use generic implementation, which
is the sensible ABI but the change is technically an ABI
change for ppc32le, and it makes sense to split the change
that fixes the behavior from the cleanup.
Arnd
More information about the Linuxppc-dev
mailing list