Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp715771imm; Wed, 4 Jul 2018 04:51:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUL4DseuDWQ3LDYX/3Eh1t+lVcl2jFHC3SxDbc20DZNIk6qzm0WRQJM445YdcLHbdPOp3I X-Received: by 2002:a63:ad07:: with SMTP id g7-v6mr1613674pgf.19.1530705101348; Wed, 04 Jul 2018 04:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530705101; cv=none; d=google.com; s=arc-20160816; b=MDc2u417Vw98Asl1JZwk5ah++GebProqr9PKUYO2Qp+BLh5kW+6TOIvZCcXC8tBJBt rEfE40fmZ2Jd7kkpKHOKQuitGQSF7LIxYIT7gR97pqPQdcG9w0UPbJEgCoqpRqhZYygD v/bMo8bopfzDsM48nusxh83BdvMIz0hYTQ2PeNAZZQRUb3/0VfZEK8Z14bLz+AXEihbf dPxKtzGFZ4DAhlC5OhdB3it6KvtTOJRKKE7rVxten8Kh9JxS2oVmZEgk9KZ2408oKxy3 umsqlJ99gFNN5mjJTEQ2SfPbt1gTX46PXrQV6SlmvDyuSePcjFsVJFigVzsd4il/apbv Fw4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zkP96iDs9aIVB/mUQ3oyH46KeNVOZqp/mitvEiZV4CU=; b=RETKHdhvWTE/ub/glaR6lHnSX8IOkq2a9Aw+azv6ji9jnD/3bBYeh7CMUxtDjNlbUx x5CzbIhJJLWaQHh17peN8kw1yipiYHLr1ZVfnSu3cOGhdq2owkHckcbO4EmocuhWEwAZ xXF5r77gvRedDxrHMADlIG6XDD2LaN1Jl5CEJCt5qejcbxrG6zslAFQt8lEoVhhs8YDw hcfwoHgDwa2X+WKO5ZAx52hgeMLejhRqgzJfrZbXIVcU3zEYD0zgfr68McXPRyVQ1Nyn rWx0sSdEwwGTSDsUlZoCSf97mAbZeEpSY+l89lXgusSTFGVjDYe9XNIs9so7W4ISmB7Z umuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16-v6si3547179pfy.169.2018.07.04.04.51.26; Wed, 04 Jul 2018 04:51:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934117AbeGDLuF (ORCPT + 99 others); Wed, 4 Jul 2018 07:50:05 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:56001 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933160AbeGDLuB (ORCPT ); Wed, 4 Jul 2018 07:50:01 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07453626|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e01l07440;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.CMCe9R8_1530704992; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CMCe9R8_1530704992) by smtp.aliyun-inc.com(10.147.44.118); Wed, 04 Jul 2018 19:49:52 +0800 Date: Wed, 4 Jul 2018 19:49:52 +0800 From: Guo Ren To: Arnd Bergmann Cc: linux-arch , Linux Kernel Mailing List , Thomas Gleixner , Daniel Lezcano , Jason Cooper , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org, Greentime Hu Subject: Re: [PATCH V2 05/19] csky: System Call Message-ID: <20180704114952.GB22857@guoren> References: <1005fef6031efbee4b5041ee286c053dd97670e6.1530465326.git.ren_guo@c-sky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 03, 2018 at 09:53:48PM +0200, Arnd Bergmann wrote: > We really need all new architectures to use the generic syscall ABI, > see below for the details. Ok, follow the rules. > > +#define __ARCH_WANT_OLD_READDIR > > +#define __ARCH_WANT_RENAMEAT > > +#define __ARCH_WANT_STAT64 > > +#define __ARCH_WANT_SYS_ALARM > > +#define __ARCH_WANT_SYS_CLONE > > +#define __ARCH_WANT_SYS_FORK > > +#define __ARCH_WANT_SYS_GETHOSTNAME > > +#define __ARCH_WANT_SYS_GETPGRP > > +#define __ARCH_WANT_SYS_IPC > > +#define __ARCH_WANT_SYS_LLSEEK > > +#define __ARCH_WANT_SYS_NICE > > +#define __ARCH_WANT_SYS_OLD_GETRLIMIT > > +#define __ARCH_WANT_SYS_OLDUMOUNT > > +#define __ARCH_WANT_SYS_PAUSE > > +#define __ARCH_WANT_SYS_SIGNAL > > +#define __ARCH_WANT_SYS_SIGPENDING > > +#define __ARCH_WANT_SYS_SIGPROCMASK > > +#define __ARCH_WANT_SYS_SOCKETCALL > > +#define __ARCH_WANT_SYS_TIME > > +#define __ARCH_WANT_SYS_UTIME > > +#define __ARCH_WANT_SYS_VFORK > > +#define __ARCH_WANT_SYS_WAITPID > > I think these all need to be removed, with the exception of > __ARCH_WANT_SYS_CLONE. It would be nice though to change > the imlpementation in the kernel so we no longer need to set that > either. Ok. > > +#define __NR_set_thread_area (__NR_arch_specific_syscall + 0) > > +__SYSCALL(__NR_set_thread_area, sys_set_thread_area) > > +#define __NR_ipc (__NR_arch_specific_syscall + 1) > > +__SYSCALL(__NR_ipc, sys_ipc) > > +#define __NR_socketcall (__NR_arch_specific_syscall + 2) > > +__SYSCALL(__NR_socketcall, sys_socketcall) > > +#define __NR_ugetrlimit (__NR_arch_specific_syscall + 3) > > +__SYSCALL(__NR_ugetrlimit, sys_getrlimit) > > +#define __NR_cacheflush (__NR_arch_specific_syscall + 4) > > +__SYSCALL(__NR_cacheflush, sys_cacheflush) > > +#define __NR_sysfs (__NR_arch_specific_syscall + 5) > > +__SYSCALL(__NR_sysfs, sys_sysfs) > > + > > +__SYSCALL(__NR_fadvise64_64, sys_csky_fadvise64_64) > > We definitely don't want ipc, socketcall, ugetrlimit, or sysfs. Ok, remove them. > For fadvise64_64, please redefine the symbol name so the > table points at the right entry. We need exchange the args for abiv1. loff_t is 64bit and abiv1 need 8-bytes align in args. /* * for abiv1 the 64bits args should be even th, So we need mov the advice forward. */ SYSCALL_DEFINE4(csky_fadvise64_64, int, fd, int, advice, loff_t, offset, loff_t, len) { return sys_fadvise64_64(fd, offset, len, advice); } > > I'm not completely sure about set_thread_area, can you explain > what you need that for? In abiv1 there is no tls register, so we use "trap 3" for csky_get_tls defined in arch/csky/kernel/entry.S to get tls. Also we use set_thread_area to set tls in kernel. For abiv2 it has r31 for tls-reg, but we still keep the mechanism. > > +#define __NR_setgroups32 __NR_setgroups > > +#define __NR_getgid32 __NR_getgid > > +#define __NR_getgroups32 __NR_getgroups > > +#define __NR_setuid32 __NR_setuid > > +#define __NR_setgid32 __NR_setgid > > +#define __NR_getresgid32 __NR_getresgid > > +#define __NR_setfsuid32 __NR_setfsuid > > +#define __NR_setfsgid32 __NR_setfsgid > > +#define __NR_fchown32 __NR_fchown > > +#define __NR_geteuid32 __NR_geteuid > > +#define __NR_getegid32 __NR_getegid > > +#define __NR_getresuid32 __NR_getresuid > > +#define __NR_setresuid32 __NR_setresuid > > +#define __NR_setresgid32 __NR_setresgid > > +#define __NR_setreuid32 __NR_setreuid > > +#define __NR_setregid32 __NR_setregid > > +#define __NR__llseek __NR_llseek > > These should also get removed. Ok. > > +struct mmap_arg_struct { > > + unsigned long addr; > > + unsigned long len; > > + unsigned long prot; > > + unsigned long flags; > > + unsigned long fd; > > + unsigned long offset; > > +}; > > + > > +SYSCALL_DEFINE1(mmap, > > + struct mmap_arg_struct *, arg) > > +{ > > + struct mmap_arg_struct a; > > + > > + if (copy_from_user(&a, arg, sizeof(a))) > > + return -EINVAL; > > + > > + if (unlikely(a.offset & ~PAGE_MASK)) > > + return -EINVAL; > > + > > + return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); > > +} > > This can be removed since there is mmap2() Ok. Guo Ren