[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2XOVYB1Fm5TBdjtKx9DXoG93Zrw7TiquYL_Zy916dLwQ@mail.gmail.com>
Date: Tue, 21 Dec 2021 18:15:37 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Guo Ren <guoren@...nel.org>
Cc: Palmer Dabbelt <palmer@...belt.com>, Arnd Bergmann <arnd@...db.de>,
Anup Patel <anup.patel@....com>,
gregkh <gregkh@...uxfoundation.org>,
liush <liush@...winnertech.com>, wefu@...hat.com,
Drew Fustini <drew@...gleboard.org>, wangjunqiang@...as.ac.cn,
Wei Wu (吴伟) <lazyparser@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
linux-csky@...r.kernel.org, Guo Ren <guoren@...ux.alibaba.com>
Subject: Re: [PATCH 05/13] riscv: compat: syscall: Add compat_sys_call_table implementation
On Tue, Dec 21, 2021 at 5:35 PM <guoren@...nel.org> wrote:
>
> From: Guo Ren <guoren@...ux.alibaba.com>
>
> Implement compat_syscall_table.c with compat_sys_call_table & fixup
> system call such as truncate64,pread64,fallocate which need two
> regs to indicate 64bit-arg (copied from arm64).
>
> Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
> ---
> arch/riscv/include/asm/syscall.h | 3 +
> arch/riscv/kernel/compat_syscall_table.c | 84 ++++++++++++++++++++++++
Same here, I think most of these should go next to the actual syscalls, with the
duplicates removed from other platforms,
> +#define __SYSCALL_COMPAT
> +#undef __LP64__
What is the #undef for?
> +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
> + unsigned long, prot, unsigned long, flags,
> + unsigned long, fd, unsigned long, offset)
> +{
> + if ((prot & PROT_WRITE) && (prot & PROT_EXEC))
> + if (unlikely(!(prot & PROT_READ)))
> + return -EINVAL;
> +
> + return ksys_mmap_pgoff(addr, len, prot, flags, fd, offset);
> +}
This is one that we may have to deal with separately, introducing
sys_mmap_pgoff() was a mistake in my opinion, and we should just have
added a sys_mmap2() for all architectures that don't explicitly override it.
Arnd
Powered by blists - more mailing lists