[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <952efc87-2e1a-45b3-9ccb-e7f5120aba0d@t-8ch.de>
Date: Sat, 8 Nov 2025 11:08:46 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: WANG Xuerui <kernel@...0n.name>, Jiaxun Yang <jiaxun.yang@...goat.com>,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: ptrace: Use UAPI types in UAPI header
On 2025-11-03 17:38:49+0800, Huacai Chen wrote:
> On Mon, Nov 3, 2025 at 5:27 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
> > On 2025-11-03 17:12:58+0800, Huacai Chen wrote:
> > > On Wed, Oct 29, 2025 at 11:20 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
> > > >
> > > > The kernel UAPI headers already contain fixed-width integer types,
> > > > there is no need to rely on libc types. There may not be a libc
> > > > available or it may not provide <stdint.h>, like for example on nolibc.
> > > >
> > > > This also aligns the header with the rest of the LoongArch UAPI headers.
> >
> > > Thank you for your patch, but could you please tell me some history
> > > and user guide about the three styles: u64, __u64 and unint64_t?
> >
> > uint64_t -> userspace type, should not be used within the kernel
> > can technically be used in UAPI it will be somewhat
> > nonstandard and introduce a dependency on libc with no
> > upsides.
> But a simple grep shows there are many uses of uint64_t in the kernel
> code, are they all wrong?
Yes, they are wrong. See also the explanation from Arnd.
> > u64 -> kernel-internal type, used for regular kernel code
> > defined in include/linux/types.h
> >
> > __u64 -> UAPI type usable from both kernel and userspace code
> > defined in include/uapi/linux/types.
> >
> > As a note: When applying the patch I want to clarify the commit message
> > a bit, as nolibc indeed has a stdint.h header. The real breakage comes
> > from a validation step we perform which does not add the libc include
> > directory to the include path.
Powered by blists - more mailing lists