Re: [PATCH v1] LoongArch: Handle CONFIG_32BIT in syscall_get_arch()

From: Huacai Chen

Date: Thu Apr 09 2026 - 08:34:26 EST


Applied, thanks.

Huacai

On Tue, Apr 7, 2026 at 2:33 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
> If CONFIG_32BIT is set, it should return AUDIT_ARCH_LOONGARCH32 instead of
> AUDIT_ARCH_LOONGARCH64 in syscall_get_arch().
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
> ---
> arch/loongarch/include/asm/syscall.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/loongarch/include/asm/syscall.h b/arch/loongarch/include/asm/syscall.h
> index 81d2733f7b94..8b5f3a1598af 100644
> --- a/arch/loongarch/include/asm/syscall.h
> +++ b/arch/loongarch/include/asm/syscall.h
> @@ -78,7 +78,11 @@ static inline void syscall_set_arguments(struct task_struct *task,
>
> static inline int syscall_get_arch(struct task_struct *task)
> {
> +#ifdef CONFIG_64BIT
> return AUDIT_ARCH_LOONGARCH64;
> +#else
> + return AUDIT_ARCH_LOONGARCH32;
> +#endif
> }
>
> static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> --
> 2.42.0
>
>