Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1319939imm; Thu, 6 Sep 2018 20:51:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYMMNLIziPMlBGERVcoLu2uc2UOu3W6pNzk4r+uMIlRPkZUtEVhlCVEsAJh6zAgAluSTYnJ X-Received: by 2002:a17:902:583:: with SMTP id f3-v6mr5941271plf.115.1536292263205; Thu, 06 Sep 2018 20:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536292263; cv=none; d=google.com; s=arc-20160816; b=RTGs8/OY3PFvUHuy7OjSoeG1QezqmSWdBZAVM4jJMP7jkxNRWDzTAtrMbPEqL3Ljct Ck3A01Qu0eZYPOxOO8oG/VJHGn0O5dz2rkAA/hhUWKd20smAzprLL2fPDIotVBULLjg0 qcQxGyCfyeu7MKdZ5mAmXWeZLyajj15S+yK0R3H+IK+LjCLKhxewC6CN8kY/PHPVJgNz RdA/nvnkxjXgZmeqEUZ7HWetCEXNGe1nJkTEaQEXjroO3LCcrlxbtibpl306ONFgXnhc IoQRsVlAkO3GafL+GWdu5MoxRDCKoPi5tsX40D48xDCHq3FyuL5/sM54uXP1ORMabv/h rogQ== 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; bh=9bzGGmnaSod666snoKCgBbg2CSNQrFjfO/sJ8EyIORU=; b=jvSf9B5BvfZ2DeHFFoLkwDIDmUrvFJOq/KJ6U1qbrJuSe+i1mytv4ToDTRpcjxwkOQ XJFKVlDUL5RK1LM4uU6YXkoHIuuHw01Jo4sFWnRdyC0+VZZCGMfrEeF1bjLTiF4H/ws2 u4dj4QDiLG7HwekwI/aCEdnDgxzRmGkavNrGh30iRrF+FMs3SRH76kkH/l5RRIkFvo50 9yeTSWF4J3h03r4o7sLZjqvEXlgm48WuMcebuiEn7LAx9khJ1mPizBLIaf90rxSvAbYr ja2X9zhNHfalH0M6Vfa5KNvPnsFd33XWfYHaUcrEXbLZ+PPOwDUqJClx1FMPEYmy0CzO 81sQ== 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 j1-v6si7382496pgh.160.2018.09.06.20.50.47; Thu, 06 Sep 2018 20:51:03 -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 S1728651AbeIGG1r (ORCPT + 99 others); Fri, 7 Sep 2018 02:27:47 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:39875 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbeIGG1r (ORCPT ); Fri, 7 Sep 2018 02:27:47 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07651889|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03272;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.CnUOxOu_1536284878; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CnUOxOu_1536284878) by smtp.aliyun-inc.com(10.147.41.231); Fri, 07 Sep 2018 09:47:58 +0800 Date: Fri, 7 Sep 2018 09:47:57 +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 , wbx@uclibc-ng.org, Greentime Hu Subject: Re: [PATCH V3 05/26] csky: System Call Message-ID: <20180907014757.GB8288@guoren-Inspiron-7460> References: 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 Thu, Sep 06, 2018 at 04:10:49PM +0200, Arnd Bergmann wrote: > On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote: > > > +SYSCALL_DEFINE6(mmap2, > > + unsigned long, addr, > > + unsigned long, len, > > + unsigned long, prot, > > + unsigned long, flags, > > + unsigned long, fd, > > + off_t, offset) > > +{ > > + if (unlikely(offset & (~PAGE_MASK >> 12))) > > + return -EINVAL; > > + return sys_mmap_pgoff(addr, len, prot, flags, fd, > > + offset >> (PAGE_SHIFT - 12)); > > +} > > Please call ksys_mmap_pgoff() instead of sys_mmap_pgoff() here. Ok. > The prototype in include/asm-generic/syscalls.h uses 'unsigned long' > for the last argument as well, not off_t. Ok, unsigned long for last argument. > > +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) > > Something is still wrong here, there should be no way to > call sys_mmap(), since it's not in the syscall table. You are right, remove it. > > + return sys_fadvise64_64(fd, offset, len, advice); > > +} > > And call ksys_fadvise64_64() here. Ok. Guo Ren