From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 567ABC07E99 for ; Fri, 9 Jul 2021 08:45:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32152613CC for ; Fri, 9 Jul 2021 08:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbhGIIrs (ORCPT ); Fri, 9 Jul 2021 04:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbhGIIrq (ORCPT ); Fri, 9 Jul 2021 04:47:46 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC6EBC0613DD for ; Fri, 9 Jul 2021 01:45:03 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id o8so9470966ilf.12 for ; Fri, 09 Jul 2021 01:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MQcrFZfGoEUKQRvfZb5BdVn66QI0fqMmpjL918kSXsw=; b=QxfURs+1MDuCE3UfAZAiAgWcuOdHlsVu4n8PoAHbV6yxbI/BMuM5Bt8IawIhqi66kT ya+EIC7jQ2lcbubpmL6c7HO4CWQqkk/AuYqGxiU/qOS5IzGXf0MpbL6YJa17cfv1Hk+k efHwtexNZb9lL8sUtTTnEX3Hh14xAhFDmvj/jmjnkA31x54ea0ooN/KlPAXH8FUWeaMB O8QxywwcOnHDjL53oYZBL55akMefY7KEeKlHq6xqK1P9j3ElVyN6b7zdJRcVspm7sZk2 D6Od9nckCg2XzCuRIkEfPVLElnMNv9PWbdBmonNPz9fzIfG9qUPEd/p4YHsHWer6ZjQc REFQ== 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=MQcrFZfGoEUKQRvfZb5BdVn66QI0fqMmpjL918kSXsw=; b=MudFXJhsdJxsn80tY+vu8UmcEdr5M4hOt8nn3nfNVFnspnVeDURx33bwcvMzWE4vsX 6iK7JsSIsIpVePu5PnuJ5jNduawVKb5QozWzAUfwGo+oJ0M6FfY9qj81oEeYjDi931VI i3swa8oCDFEkfbARWf8914o2y51K86ItLw3FqyOTaFypJwi4PrwbPIjvTKc2oBualRVc YruRwDgu3xtyCivsf4p5abnOllJhtx9upMi22Y2453MIxUbyjazxCl81u0qL6BUbAiPt 8f8R9/FJAMYRswEz9zK3zFBaO9VrAWsmkNwPEzP3Yw31Y9S6XShVKu8xWLyw9KxIWShy J/LA== X-Gm-Message-State: AOAM530YWpROF/HM+z0G2o00hJX5MtiidiOUHDLkAlpGUtHNs026lo47 vkKOgRnn06bf5DYDrN7shFsWbb/neDiEbfnLy5EnrN+QuTfE92xj X-Google-Smtp-Source: ABdhPJzSQFhUkGkDP1dkZqtL5iXKL9TLgQIPIsuk5bl+TIT/zxXoyLXELP3KzZhPf6rhPLZMhY/6V7JeUx+RLaY394o= X-Received: by 2002:a92:6509:: with SMTP id z9mr25976829ilb.184.1625820303248; Fri, 09 Jul 2021 01:45:03 -0700 (PDT) MIME-Version: 1.0 References: <20210706041820.1536502-1-chenhuacai@loongson.cn> <20210706041820.1536502-10-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Fri, 9 Jul 2021 16:44:51 +0800 Message-ID: Subject: Re: [PATCH 09/19] LoongArch: Add system call support To: Arnd Bergmann Cc: Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Linus Torvalds , linux-arch , Xuefeng Li , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Hi, Arnd, On Wed, Jul 7, 2021 at 2:44 PM Arnd Bergmann wrote: > > On Wed, Jul 7, 2021 at 6:24 AM Huacai Chen wrote: > > On Tue, Jul 6, 2021 at 6:17 PM Arnd Bergmann wrote: > > > On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen wrote: > > > > diff --git a/arch/loongarch/include/uapi/asm/unistd.h b/arch/loongarch/include/uapi/asm/unistd.h > > > > new file mode 100644 > > > > index 000000000000..6c194d740ed0 > > > > --- /dev/null > > > > +++ b/arch/loongarch/include/uapi/asm/unistd.h > > > > @@ -0,0 +1,7 @@ > > > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > > > > +#define __ARCH_WANT_NEW_STAT > > > > > > Why do you need newstat? I think now that we have statx and the libc > > > emulation code on top of it, there is probably no need to support both > > > on the kernel side. > > > > > > > +#define __ARCH_WANT_SYS_CLONE > > > > +#define __ARCH_WANT_SYS_CLONE3 > > > > > > Similarly, if you have clone3, you should not need clone. > > > > > > > +#define __ARCH_WANT_SET_GET_RLIMIT > > > > > > And here for prlimit64 > > > > Is newstat()/clone()/setrlimit() completely unacceptable in a new > > arch? If not, I want to keep it here for compatibility, because there > > are some existing distros. > > I'd say they should go. None of these are normally called directly by > applications, so if you just update the C library to redirect the user > level interfaces to the new system calls, I expect no major problems > here as long as you update libc along with the kernel in the existing > distros. > Any application using seccomp to allow only the old system calls > may need a small update, but it would need that anyway to work > with future libc implementations. > > Generally speaking there should be no expectation that the > system call interface is stable until the port is upstream. Note that > you will face a similar problem with the libc port, which may also > change its interface from what you are using internally. I found that the latest glibc is not ready for clone3, the last patchset [1] still breaks something, so I think we should keep clone. For newstat, I found that the latest glibc only use statx for 32bit kernel, while 64bit kernel still use newstat. So, it seems that we can only remove __ARCH_WANT_SET_GET_RLIMIT. [1] https://patchwork.sourceware.org/project/glibc/patch/20210601145516.3553627-2-hjl.tools@gmail.com/ Huacai > > Arnd