Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2202662pxb; Fri, 25 Mar 2022 12:58:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvuwweZHwVM69gk8eQx4yOkGosrAaUVPCgq6vgLjswHasmFrPPHJq0nQJ83hLK0bWvH6u2 X-Received: by 2002:a05:6a02:184:b0:373:a24e:5ab with SMTP id bj4-20020a056a02018400b00373a24e05abmr947303pgb.400.1648238313874; Fri, 25 Mar 2022 12:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648238313; cv=none; d=google.com; s=arc-20160816; b=eBprmmlcHolC/JryRn2ggFgh0p2FMOeYCmOc4nyWQr0O8iK1yPQ5Sx/FmVxXWr5pNE tfKhM5j6M45s7kekv5NYfoP2ndJJ9iE92tmmLz49SyaqxgEUa3Gh2iOIARWD8flFOa7/ OF+vcOod8dguz6R+Ktp2X5qh5juBOkmPzn238kbxRPtkBNfy7fcV9YljbrrfDCufafOc f0qt97A1OiZHcBWIgwlHBiiMMPrx9t8pwoXqhZhFrlivUJJbVAT1/1hXdyZEHRiNw4bG /X1O1PmFSyW+73SnJARpE5Wl9Pv/9Eu0QiAIDpdJoletCHvNwtvGP9zwEkSj2cMvQQuR C3LA== 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:dkim-signature; bh=0JCu2rchO2mLo2ocjFa7FXnEzu0+qIWGmr+CpcJYkME=; b=CA35nScwQBQlHnATy4c0RAx9VklGoukEuyewImd/nN0xnGfHDwRLUZrQ8NDD7w3GHj hBcMCng/UcsduoZlzMiRFYuXf15q4kKyFRsHLenKWTBGS8fafImlrsRa+7+9NsQwlkq+ YJzIzmlsjzDSe4XH1Nprr4wj3jDXlA+rouAYz3vkKA5Bl0V4mUyUUvMsODujy4aJbjPJ AV2L3WwOoiESnR3zWf6vjW8jBXX13sqpDPNCQ2UFLl6oJPU6nt+4PLC76EYbzqsLC3rO TjNrvmlUmo5TXrSHS3Xn+31yqJ4qDeWy/3eJohHBiQDJy/y5vs6yUfQJy7iozLEVa9H0 2KgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=omFiFyrB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r13-20020a63d90d000000b003816043ef3bsi3139794pgg.304.2022.03.25.12.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:58:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=omFiFyrB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 151AC1C2333; Fri, 25 Mar 2022 11:47:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347761AbiCXCeJ (ORCPT + 99 others); Wed, 23 Mar 2022 22:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234745AbiCXCeI (ORCPT ); Wed, 23 Mar 2022 22:34:08 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D51939B1; Wed, 23 Mar 2022 19:32:34 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id k14so2740136pga.0; Wed, 23 Mar 2022 19:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0JCu2rchO2mLo2ocjFa7FXnEzu0+qIWGmr+CpcJYkME=; b=omFiFyrBIaDd9kG2A8zDsIjZricwiOad7au0Id2doy9ddFqy8Ez55YIQlO2T5Aradx SydyoSdKGKqmae7v8YDImg9Sp975lTYxFMn8DdYIkkOCCT3pDt9a/1OYryomUkYPAa0v FEkBNpEjKjfetnegTq1FVqOlqhqTjRuFBHOOTdSCYePx4WkFeRd4eRsrd3GdkzzaWf9w XBioUYa/2dV7xuvLD/CzWzYJ7RcJglipJPd5ve8jxcBiRcc5I1okYlV3BKKuvNB+49uv wA0GGDYk9C/muZ4Vhk4ymS1cpqAQa8KE7z1Dl3qiKDVoZR1ZYOVYmLkZJhUb7jtYNRL9 Gbnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0JCu2rchO2mLo2ocjFa7FXnEzu0+qIWGmr+CpcJYkME=; b=RRnTE+FgfK/BTrWFpZV8hZcS994Zi5y4a83gWRo7q+kmt10O6zndlBU3v+MjEplXbj TuAOjD33H+qz4R1vxxcsAvMcC8q8572VlnYC7GOc1l7XI8p8hzTb4j9ZvBbVxORdz66L 21wY6VsYTCtgRModPv/tejnEnEJAW4G5F5SVEiInr6apRKuQcCHR5hb+NjYjrPhOaJrm GR3DJNnlr7rd/KDX3aknggBFraCZwnpmekns0aoysU8aK6WnHQkNl9F2nbK5ZRZzX5hz xL1DVZ3kNYBlsko9dA75A9maRn5dSXRXM07l0HdHcUtK019DAL70sS6bGEz1kxm4Z3/G AzbQ== X-Gm-Message-State: AOAM532oHHeBDFAKFHTS6GWRsB/ePiwa6m831R8AVCzMCRCnPN6/M0F2 q+dHCSh8uEJBwN9zhhMKUXjIt0/QGvfgA4hzURuicCPHjCCHqQ== X-Received: by 2002:a05:6a00:890:b0:4f6:686e:a8a9 with SMTP id q16-20020a056a00089000b004f6686ea8a9mr2958051pfj.83.1648089153763; Wed, 23 Mar 2022 19:32:33 -0700 (PDT) MIME-Version: 1.0 References: <20220319142759.1026237-1-chenhuacai@loongson.cn> <20220319143817.1026708-1-chenhuacai@loongson.cn> <20220319143817.1026708-6-chenhuacai@loongson.cn> <20220322160234.hxyiugzm3qstyun2@wittgenstein> In-Reply-To: <20220322160234.hxyiugzm3qstyun2@wittgenstein> From: Feiyang Chen Date: Thu, 24 Mar 2022 10:32:22 +0800 Message-ID: Subject: Re: [PATCH V8 13/22] LoongArch: Add system call support To: Arnd Bergmann , Christian Brauner Cc: Huacai Chen , 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 , Jiaxun Yang , Huacai Chen , "H.J. Lu" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Mar 2022 at 00:02, Christian Brauner wrote: > > On Mon, Mar 21, 2022 at 10:47:49AM +0100, Arnd Bergmann wrote: > > On Mon, Mar 21, 2022 at 10:41 AM Huacai Chen wrote: > > > On Mon, Mar 21, 2022 at 5:01 PM Arnd Bergmann wrote: > > > > > > > > On Sat, Mar 19, 2022 at 3:38 PM Huacai Chen wrote: > > > > > > > > > > This patch adds system call support and related uaccess.h for LoongArch. > > > > > > > > > > Q: Why keep __ARCH_WANT_NEW_STAT definition while there is statx: > > > > > A: Until the latest glibc release (2.34), statx is only used for 32-bit > > > > > platforms, or 64-bit platforms with 32-bit timestamp. I.e., Most 64- > > > > > bit platforms still use newstat now. > > > > > > > > > > Q: Why keep _ARCH_WANT_SYS_CLONE definition while there is clone3: > > > > > A: The latest glibc release (2.34) has some basic support for clone3 but > > > > > it isn't complete. E.g., pthread_create() and spawni() have converted > > > > > to use clone3 but fork() will still use clone. Moreover, some seccomp > > > > > related applications can still not work perfectly with clone3. > > > > > > > > Please leave those out of the mainline kernel support though: Any users > > > > of existing glibc binaries can keep using patched kernels for the moment, > > > > and then later drop those pages when the proper glibc support gets > > > > merged. > > > The glibc commit d8ea0d0168b190bdf138a20358293c939509367f ("Add an > > > internal wrapper for clone, clone2 and clone3") modified nearly > > > everything in order to move to clone3(), except arch_fork() which used > > > by fork(). And I cannot find any submitted patches to solve it. So I > > > don't think this is just a forget, maybe there are other fundamental > > > problems? > > > > I don't think there are fundamental issues, they probably did not consider > > it necessary because so far all architectures supported clone(). > > > > Adding Christian Brauner and H.J. Lu for clarificatoin. > > Probably, yes. I don't know of any fundamental problems there either. > Hi, Arnd, Christian, As far as I know, software that uses the linux sandbox is still using clone(), such as chromium: commit 218438259dd795456f0a48f67cbe5b4e520db88b Author: Matthew Denton Date: Thu Jun 3 20:06:13 2021 +0000 Linux sandbox: return ENOSYS for clone3 Because clone3 uses a pointer argument rather than a flags argument, we cannot examine the contents with seccomp, which is essential to preventing sandboxed processes from starting other processes. So, we won't be able to support clone3 in Chromium. This CL modifies the BPF policy to return ENOSYS for clone3 so glibc always uses the fallback to clone. Bug: 1213452 Change-Id: I7c7c585a319e0264eac5b1ebee1a45be2d782303 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2936184 Reviewed-by: Robert Sesek Commit-Queue: Matthew Denton Cr-Commit-Position: refs/heads/master@{#888980} Besides arch_fork(), I think removing clone() may lead to more problems. Thanks, Feiyang