From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] LoongArch: ptrace: Use UAPI types in UAPI header
Date: Sat, 8 Nov 2025 11:08:46 +0100 [thread overview]
Message-ID: <952efc87-2e1a-45b3-9ccb-e7f5120aba0d@t-8ch.de> (raw)
In-Reply-To: <CAAhV-H4c8_GdnCdHfX_bVQ+rrGRtNua1r2MR0n5rXgXfgte0Sw@mail.gmail.com>
On 2025-11-03 17:38:49+0800, Huacai Chen wrote:
> On Mon, Nov 3, 2025 at 5:27 PM Thomas Weißschuh <linux@weissschuh.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@weissschuh.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.
next prev parent reply other threads:[~2025-11-08 10:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 15:20 [PATCH] LoongArch: ptrace: Use UAPI types in UAPI header Thomas Weißschuh
2025-11-03 9:12 ` Huacai Chen
2025-11-03 9:27 ` Thomas Weißschuh
2025-11-03 9:38 ` Huacai Chen
2025-11-08 10:08 ` Thomas Weißschuh [this message]
2025-11-03 9:41 ` Arnd Bergmann
2025-11-14 4:41 ` Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=952efc87-2e1a-45b3-9ccb-e7f5120aba0d@t-8ch.de \
--to=linux@weissschuh.net \
--cc=chenhuacai@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox