mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32
@ 2025-12-15  3:34 Xi Ruoyao
  2025-12-16  7:03 ` Jiaxun Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Xi Ruoyao @ 2025-12-15  3:34 UTC (permalink / raw)
  To: Huacai Chen, WANG Xuerui, Arnd Bergmann
  Cc: Mingcong Bai, loongarch, Xi Ruoyao, Jiaxun Yang, open list

While on LA64 we had added __ARCH_WANT_NEW_STAT back for technological
aesthetics reason, on LA32 the newstat family suffers Y2038 issue and it
should not be used at all, as the commit 82b355d161c9 ("y2038: Remove
newstat family from default syscall set") has already pointed out.

Fixes: 14338e631afd ("LoongArch: Adjust system call for 32BIT/64BIT")
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 arch/loongarch/include/asm/unistd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/loongarch/include/asm/unistd.h b/arch/loongarch/include/asm/unistd.h
index e2c0f3d86c7b..4a7e4a6b6627 100644
--- a/arch/loongarch/include/asm/unistd.h
+++ b/arch/loongarch/include/asm/unistd.h
@@ -8,7 +8,10 @@
 
 #include <uapi/asm/unistd.h>
 
+#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
 #define __ARCH_WANT_NEW_STAT
+#endif
+
 #define __ARCH_WANT_SYS_CLONE
 
 #define NR_syscalls (__NR_syscalls)
-- 
2.52.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32
  2025-12-15  3:34 [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32 Xi Ruoyao
@ 2025-12-16  7:03 ` Jiaxun Yang
  2025-12-16  7:21 ` Arnd Bergmann
  2026-02-14 13:21 ` Ping: " Xi Ruoyao
  2 siblings, 0 replies; 4+ messages in thread
From: Jiaxun Yang @ 2025-12-16  7:03 UTC (permalink / raw)
  To: Xi Ruoyao, Huacai Chen, Xuerui Wang, Arnd Bergmann
  Cc: Mingcong Bai, loongarch, open list



On Mon, 15 Dec 2025, at 11:34 AM, Xi Ruoyao wrote:
> While on LA64 we had added __ARCH_WANT_NEW_STAT back for technological
> aesthetics reason, on LA32 the newstat family suffers Y2038 issue and it
> should not be used at all, as the commit 82b355d161c9 ("y2038: Remove
> newstat family from default syscall set") has already pointed out.
>
> Fixes: 14338e631afd ("LoongArch: Adjust system call for 32BIT/64BIT")
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>

That makes sense, we certainly don't want any y2038 syscall.

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

Thanks!

> ---
>  arch/loongarch/include/asm/unistd.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/loongarch/include/asm/unistd.h 
> b/arch/loongarch/include/asm/unistd.h
> index e2c0f3d86c7b..4a7e4a6b6627 100644
> --- a/arch/loongarch/include/asm/unistd.h
> +++ b/arch/loongarch/include/asm/unistd.h
> @@ -8,7 +8,10 @@
> 
>  #include <uapi/asm/unistd.h>
> 
> +#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
>  #define __ARCH_WANT_NEW_STAT
> +#endif
> +
>  #define __ARCH_WANT_SYS_CLONE
> 
>  #define NR_syscalls (__NR_syscalls)
> -- 
> 2.52.0

-- 
- Jiaxun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32
  2025-12-15  3:34 [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32 Xi Ruoyao
  2025-12-16  7:03 ` Jiaxun Yang
@ 2025-12-16  7:21 ` Arnd Bergmann
  2026-02-14 13:21 ` Ping: " Xi Ruoyao
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-12-16  7:21 UTC (permalink / raw)
  To: Xi Ruoyao, Huacai Chen, WANG Xuerui
  Cc: Mingcong Bai, loongarch, Jiaxun Yang, open list

On Mon, Dec 15, 2025, at 04:34, Xi Ruoyao wrote:
> While on LA64 we had added __ARCH_WANT_NEW_STAT back for technological
> aesthetics reason, on LA32 the newstat family suffers Y2038 issue and it
> should not be used at all, as the commit 82b355d161c9 ("y2038: Remove
> newstat family from default syscall set") has already pointed out.
>
> Fixes: 14338e631afd ("LoongArch: Adjust system call for 32BIT/64BIT")
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>

The patch looks good to me.

Note that unlike the referenced 82b355d161c9 patch, this is no
longer needed for correctness, since modern kernels generate
the asm/unistd.h from the syscall.tbl based on 
arch/loongarch/kernel/Makefile.syscalls, which leaves out the
references to newstat.

The patch is still useful of course, but only to slightly reduce
the size of the kernel image by eliminating dead code.

     Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Ping: [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32
  2025-12-15  3:34 [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32 Xi Ruoyao
  2025-12-16  7:03 ` Jiaxun Yang
  2025-12-16  7:21 ` Arnd Bergmann
@ 2026-02-14 13:21 ` Xi Ruoyao
  2 siblings, 0 replies; 4+ messages in thread
From: Xi Ruoyao @ 2026-02-14 13:21 UTC (permalink / raw)
  To: Huacai Chen, WANG Xuerui, Arnd Bergmann
  Cc: Mingcong Bai, loongarch, Jiaxun Yang, open list

Ping.

On Mon, 2025-12-15 at 11:34 +0800, Xi Ruoyao wrote:
> While on LA64 we had added __ARCH_WANT_NEW_STAT back for technological
> aesthetics reason, on LA32 the newstat family suffers Y2038 issue and it
> should not be used at all, as the commit 82b355d161c9 ("y2038: Remove
> newstat family from default syscall set") has already pointed out.
> 
> Fixes: 14338e631afd ("LoongArch: Adjust system call for 32BIT/64BIT")
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
>  arch/loongarch/include/asm/unistd.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/loongarch/include/asm/unistd.h b/arch/loongarch/include/asm/unistd.h
> index e2c0f3d86c7b..4a7e4a6b6627 100644
> --- a/arch/loongarch/include/asm/unistd.h
> +++ b/arch/loongarch/include/asm/unistd.h
> @@ -8,7 +8,10 @@
>  
>  #include <uapi/asm/unistd.h>
>  
> +#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
>  #define __ARCH_WANT_NEW_STAT
> +#endif
> +
>  #define __ARCH_WANT_SYS_CLONE
>  
>  #define NR_syscalls (__NR_syscalls)

-- 
Xi Ruoyao <xry111@xry111.site>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-14 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-15  3:34 [PATCH] LoongArch: Don't define __ARCH_WANT_NEW_STAT for LA32 Xi Ruoyao
2025-12-16  7:03 ` Jiaxun Yang
2025-12-16  7:21 ` Arnd Bergmann
2026-02-14 13:21 ` Ping: " Xi Ruoyao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®