On 7/24/2026 2:42 PM, Helge Deller wrote:
> On 7/24/26 18:48, Pierrick Bouvier wrote:
>> On 7/24/2026 9:01 AM, no92 via qemu development wrote:
>>> The members are declared as __kernel_pid_t in Linux UAPI headers.
>>> Analogous members in struct target_shmid_ds (shm_[cl]pid) are also
>>> declared as abi_int.
>>>
>>> Fixes: 1c54ff97bbde ("linux-user: fix and cleanup IPCOP_msg* ipc
>>> calls handling")
>>> Signed-off-by: no92 <[email protected]>
>>> ---
>>> linux-user/syscall.c | 12 ++++++------
>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>>> index 3da5530d42..616d543c7f 100644
>>> --- a/linux-user/syscall.c
>>> +++ b/linux-user/syscall.c
>>> @@ -4234,8 +4234,8 @@ struct target_msqid_ds
>>> abi_ulong __msg_cbytes;
>>> abi_ulong msg_qnum;
>>> abi_ulong msg_qbytes;
>>> - abi_ulong msg_lspid;
>>> - abi_ulong msg_lrpid;
>>> + abi_int msg_lspid;
>>> + abi_int msg_lrpid;
>> ...
>>
>> The change looks correct in itself.
>
> No.
> abi_ulong is wrong, but abi_int isn't much better either if you look at
> the kernel sources:
>
I wrongly assumed the definition we had on bsd-user side was correct,
but didn't really think about checking it in linux sources, sorry.
> grep -r __kernel_ipc_pid_t arch/
>
> arch/sparc/include/uapi/asm/posix_types.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/sparc/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/m68k/include/uapi/asm/posix_types.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/m68k/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/parisc/include/uapi/asm/posix_types.h:typedef unsigned
> short __kernel_ipc_pid_t;
> arch/parisc/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/arm/include/uapi/asm/posix_types.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/arm/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/s390/include/uapi/asm/posix_types.h:typedef int
> __kernel_ipc_pid_t;
> arch/s390/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/xtensa/include/uapi/asm/posix_types.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/xtensa/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/x86/include/uapi/asm/posix_types_32.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/x86/include/uapi/asm/posix_types_32.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/sh/include/uapi/asm/posix_types_32.h:typedef unsigned short
> __kernel_ipc_pid_t;
> arch/sh/include/uapi/asm/posix_types_32.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
> arch/powerpc/include/uapi/asm/posix_types.h:typedef short
> __kernel_ipc_pid_t;
> arch/powerpc/include/uapi/asm/posix_types.h:#define __kernel_ipc_pid_t
> __kernel_ipc_pid_t
>
> So, we probably need to differntiate between platforms and use either
> abi_int or abi_short.
>
> Helge