Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp587265imm; Thu, 6 Sep 2018 07:13:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYVC7nx+/R+b3P7um4hQFAJH9U1HZE0BqFhz+9fdJZ7RziH4fb8j685iIX1S3VS0voq5NzE X-Received: by 2002:a63:ee56:: with SMTP id n22-v6mr2954848pgk.402.1536243206000; Thu, 06 Sep 2018 07:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536243205; cv=none; d=google.com; s=arc-20160816; b=P6eF360PhOqbAyTVbeTdtmv8NyS7CosDRWZ8pBWR6eM0npMU2ed3Mt1jstx8vAURw2 haWDpUmXWhK0VzAOHGanZ8tzn4JFT5d/stTiXh7bTMoCCqe2xyiYlfgkT641eF/tlnEU 8r1dwx7dDwq5f6LjZ8oVWyZ4S8DRqi7jIPM4I6I+Djog627I3lUQYM7nohUKhxquqzK9 BJBFpqEQcRzSh3OrFHJbkXOQza4O9iAKjOJoHrlHDH9a28oHtgQNIzqGYqwuMuSysM5l 4JGyFdmmVTWlBqaGcLwtGBeIJvkB4tsiziyQ/rsWYMcUEEAp8LfZTEkVVl3uj0gdY0bN lj7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Z3oM06lmWNJgiB/R5oFcZh9AMqGJwo4dOOsATyJhVGo=; b=c+ddGRIlfn0bjwBNovAKA7EHdBGX8m+RMXLjg+fjSO7brQnDdbw62ejWzgPBffpfOh aOGufl8fz7PneiBZFb9sI6SvFPt3gDcrEVgV4k0QNY8pQZdSKL5owusQcarXR7YqXnkF 6/8w640DDhoSP3A0XKjVRAHsu40q/0USZXeViaenIp/5qDHGTrGFeg17qgDlYXeXkAQz ztnKz8q+ojJe4zTjK8C/1Kbg+yKWsA52Cz93jf8tYrp048irh64f3ZfxtC8y0kCLif8f CMszJBkQTUW2LaBax5hfueCI8fC/VWx0cuXcQZj83erxu7xwyP64gFny3qEqO9cBYdtK fZow== 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 s3-v6si5400473plb.270.2018.09.06.07.13.10; Thu, 06 Sep 2018 07:13:25 -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 S1729312AbeIFSqu (ORCPT + 99 others); Thu, 6 Sep 2018 14:46:50 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:34829 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728929AbeIFSqu (ORCPT ); Thu, 6 Sep 2018 14:46:50 -0400 Received: by mail-qt0-f193.google.com with SMTP id j7-v6so12404782qtp.2; Thu, 06 Sep 2018 07:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z3oM06lmWNJgiB/R5oFcZh9AMqGJwo4dOOsATyJhVGo=; b=qQlekQPG3q/l3XGdG0Av0YcGCsRtNXqozObYMGZGDV9dnlQcbNQYWdJ2D5Oag3Q8Lj ii+iwWoAVqhgHzM6dsSdeFJSFdWXyqD2y63jAgZ6mBOnXarqVS+fykFwZsyjuftgvumq BWynF7f7sEczOo6PfflJcHdbyoTYT/o4v3qMN67HVY46ink798hmEUTrh2dvAWkDVJYk rDw5SlvK9HAOY3KnzoOWHiWQW1hgQ2j8wOuUkjGLPi++W2BxrgMKRmXjOwJ82WIoYfUL Upp0FElAJ8dxdRWfng8wveJdwjUGGq8vl0GCQJkCVDDRtVTh0VLG49McwgwOfzDvPf/c O4TQ== X-Gm-Message-State: APzg51AEAz3iFIVXZYcmt2BmpH2J2bwZCVo4PUsqopOYlMH3/5grr2Ud 3oJcY02z2kTvDlqkSz27fhaINLBwxMsyZ8FzqzwGhILa X-Received: by 2002:a0c:885b:: with SMTP id 27-v6mr2188732qvm.115.1536243065551; Thu, 06 Sep 2018 07:11:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Thu, 6 Sep 2018 16:10:49 +0200 Message-ID: Subject: Re: [PATCH V3 05/26] csky: System Call To: Guo Ren 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The prototype in include/asm-generic/syscalls.h uses 'unsigned long' for the last argument as well, not off_t. > +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. > +/* > + * 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); > +} And call ksys_fadvise64_64() here. > +#undef __SYSCALL > +#define __SYSCALL(nr, call) [nr] = (call), > + > +#define sys_fadvise64_64 sys_csky_fadvise64_64 > +void * const sys_call_table[__NR_syscalls] __page_aligned_data = { > + [0 ... __NR_syscalls - 1] = sys_ni_syscall, > +#include > +}; This looks good now. Arnd