Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2492339pxb; Fri, 17 Sep 2021 10:57:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy65VSW05dEWYi3N7nrut1jphtpBEqSYRbX5qr389ykzghaLWbLuJGppyxz54CCJH8L6gqM X-Received: by 2002:a05:6402:198:: with SMTP id r24mr13941169edv.93.1631901453902; Fri, 17 Sep 2021 10:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631901453; cv=none; d=google.com; s=arc-20160816; b=vm09Mm2X6lhqVx9HJ9AkLUi7HIxNqoP1REYZx4dz+ZkoAFdRFk+OGHpc0sWgRT03OQ l7h/YwLT5eQFz7PBbw6HRlBFQ9ZTFUgbGhPeRp+qaFmvRq6y9Su4fDZfmnUNrYepZ0Uw JLqUlQWnu3cbN2otAw6yBHm+YiNmqYz+SdwNCYM/gJ3Fm3hQqlj8w04SQ8ie1cH9YDjG ptO3a4hp/KdjR7twR2/XGmEwvSh67xVP1c5WYDKOg7VaGkiB0yRH+uBJVzY/PEaqAtkE l6W3g9GBbwKvVel2DriS/S4FVnWj0Q9OXuPIgTx1afslWGPs9s90PdLS4nsl9woC5WXj UZTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=71LYQCg8TBqroif47G0IL7B24HIaPYEBalYIFsIyF4Y=; b=jjoiSmbk+5gEsbLA79NRSn3Ikjd4rk0A+UtL7LZIptV37X8v8gl6+Jnj0s6HVQHtOm uav5LCeOuFuh5vKULbz/Bvt9g7PlMTJY7NJ0HyP5RainsrHiw/eyYV52mXiiGs9EN0pN L2smQniJgG+U/1IW8Zy7R/kwr2sAIV9Ir8/DPjZLXg1SSyyYb/tizrSy0PlnwJsPxnky l/2BsezHpfB8oVu6XeE1tqvans8gg/V02h6LamN20hyUNBBb8AuzTTp4g5J02IJz88hi xhqPMxcX6tBC7DhYoHjl48YuCcEE601ObadgCOq+riE691kALQYLCPTdtGNywCjBqIuN cHgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eo22si7399833ejc.690.2021.09.17.10.57.06; Fri, 17 Sep 2021 10:57:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239575AbhIQIZs (ORCPT + 99 others); Fri, 17 Sep 2021 04:25:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:46239 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbhIQIZq (ORCPT ); Fri, 17 Sep 2021 04:25:46 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Md6V3-1n1JGW1SwF-00aI2c; Fri, 17 Sep 2021 10:24:23 +0200 Received: by mail-wr1-f42.google.com with SMTP id t18so13863932wrb.0; Fri, 17 Sep 2021 01:24:23 -0700 (PDT) X-Gm-Message-State: AOAM533PAzr8zQK7VjOS3rUWivgV4hBA1ekdwD9fmWHEzdc2SZqdHTUD 9RFsNGBGn3Ss9VAN+t9kJGMvGNArCXO4KKMGQQE= X-Received: by 2002:a05:6000:1561:: with SMTP id 1mr1229158wrz.369.1631867062981; Fri, 17 Sep 2021 01:24:22 -0700 (PDT) MIME-Version: 1.0 References: <20210917035736.3934017-1-chenhuacai@loongson.cn> <20210917035736.3934017-14-chenhuacai@loongson.cn> In-Reply-To: <20210917035736.3934017-14-chenhuacai@loongson.cn> From: Arnd Bergmann Date: Fri, 17 Sep 2021 10:24:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 13/22] LoongArch: Add system call support To: Huacai Chen Cc: Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Huacai Chen , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:neJGTFHkscc1NAv6hwO1FuUBai5vvMKqfmhPIrXLcKuYH5LcNRn zgfyX6Ed4AE7kT7+Gi0AseizMEv7Su0CnQDb9AKDdkJjn62qVynhQb3w12JTQAqOBec/ZMY nBnSSL7C6cqy0cLnQxfTy2FSeKGdDvjYyJl011xUAGMqDe5Zbhg/rjko79sbzbMFB0dc8JY fu5u7YgaU+fD5qoCdAeiw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pzKiGr89jSo=:Kg/SDXl28Q9f0IxfdiBMQI wyAU2NJbnHMcAgyplrdfMTbKGqMtYGLXung9GJOyEeshgfuGweIIYHNQI+8iEdVigudvNueN4 ZudexgROqDHMAkfCn46R/85nYQmwHXI1E3sBC8s+Nm92zguUdkRJp0A16ni2GinzJGRCnB2c8 bci56JQYrwcmHNXc1kPHwFnGdyQ9QhH0/3U/XHi3s0M8ydqOJfblzG31Pec4dIL/OuvvwhQIP IFce7fAZdgwSFrHMvovyRkeZWWmRTBuhnnFKoWHjuOyH8Z+fuTG47vnz5ECcXaU8/Br6SONGa UOgfIBHoFJOy4Bqq9NUos5GymBiLwF/4hAe5ex8slK6zjZvuOwW5ekThsdGUk5RkeuWjxtbTO R6kw7/zXf+neKnMNkR6f9BZZDb3Jjdnfsl95qYWPAncjgDvI503jXa8pfFQkpsjoiFp8Bei2U 2AR/8wbJEVEVKSXQsb6CEg3YiGE/xljJkk6M5wrmoylzeptKStDZ1AB2yykZowwX3OSfl54w2 DySMbhzpe24eQnADjQ6aFTozZDojZ0SePY9/e9/OvUO5kx8JGDEj0hHgtGfewbFEr0eN7p1cf Ah61J4I+MLJUu5ofEs/SISu0AIAGnCStGDocAan6Y4zLTfnptm5/fT64MOEeXImNb+dUfCcT/ loBZf8MjVQu6OZkC/AGLneGJz8QMO0jXI10GPF1pHjcaYkqK6gnPhX+DKoQ+vIQn9COUO3xDL vExphipCtrWHdOD8BTFVokpExUaIjOoXGemf0zZmTdtJta6/b/lGTHN8BhGlX+RSrmgZj533V 5+s/hJ3IfI9WmpvYU1Awxac3yjwKPe2fVOpAzQ8PVXiy1R3REkiSo/JDMj8KlsIhXXW7a9Oox fGxJW48iMYo4olfKd96g== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 17, 2021 at 5:57 AM Huacai Chen wrote: > +#define NR_syscalls (__NR_syscalls) > diff --git a/arch/loongarch/include/uapi/asm/unistd.h b/arch/loongarch/include/uapi/asm/unistd.h > new file mode 100644 > index 000000000000..b344b1f91715 > --- /dev/null > +++ b/arch/loongarch/include/uapi/asm/unistd.h > @@ -0,0 +1,6 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +#define __ARCH_WANT_NEW_STAT > +#define __ARCH_WANT_SYS_CLONE > +#define __ARCH_WANT_SYS_CLONE3 I still think you need to remove __ARCH_WANT_NEW_STAT and __ARCH_WANT_SYS_CLONE here. I understand that those are needed for the transitional period when you still need to support your existing glibc library files, but you likely still have other kernel patches that are not part of this series, so I suggest you add those two lines as a custom patch there until you are ready to drop support for old libc. > + > +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, > + unsigned long, prot, unsigned long, flags, unsigned long, > + fd, off_t, offset) > +{ > + if (offset & ~PAGE_MASK) > + return -EINVAL; > + return ksys_mmap_pgoff(addr, len, prot, flags, fd, > + offset >> PAGE_SHIFT); > +} > + > +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, > + unsigned long, prot, unsigned long, flags, unsigned long, fd, > + unsigned long, pgoff) > +{ > + if (pgoff & (~PAGE_MASK >> 12)) > + return -EINVAL; > + > + return ksys_mmap_pgoff(addr, len, prot, flags, fd, > + pgoff >> (PAGE_SHIFT - 12)); > +} sys_mmap2() is only used on 32-bit architectures, you only need sys_mmap() here. Ideally we'd just move those two definitions you have here into mm/mmap.c and remove all the duplicate definitions. Maybe you can come up with a patch to do this? Note that some architectures use either nonstandard names, or shift value other than 12, so those need to keep their own versions. Arnd