Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2437737pxp; Mon, 21 Mar 2022 20:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTjujR96yyRAO+uAGmWocotV4BGpB1PHYnn39pJqIu/k1t5RgFBC+mhhRIZ+zkEKq86U+M X-Received: by 2002:a17:90b:3447:b0:1c6:fe01:675c with SMTP id lj7-20020a17090b344700b001c6fe01675cmr2503359pjb.59.1647919588577; Mon, 21 Mar 2022 20:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647919588; cv=none; d=google.com; s=arc-20160816; b=uut/8qDBVlYnTKH7JUcFFtBsQFKVKzB9AFKcw4RZvgMclreYlGWjbb8r045QFtjU1M 422ImwRyV2PfWUBxMyIHUYmzlKLaJBG0HghY/jQxItULgAqAW+grvi9VlbqfYTpHuHBg Ymc77c8XPVb15zL6d2apAmliBtynsUFy94vCr7T8L0xJnJHd2unu5TQxydCWVgqv0m87 minNCx0684V+7cziNzC95Jhguq7/N+Egvk2EcoNS5cSOEyt6GWcq0jpNIvQmKUm4fTzd H/jn7dB5RWH0RkQ10/C1NmMb+Pk9emZFcOULJa/6GHn9xPM55Zgazw8xz9rSKPPAs8il AFkg== 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=BVj3ZnLDMc1gPTt44QewNa7i0kYoDlhHg7R9fCPltD8=; b=lMsxN14pjWv+moKVYac9KUPsFJApOEN1/IGbWsNue/RFRbUoK2xu2hVi8Vlab+Ij32 xL1ATPNWNZxE8/bP3htJN2XgXX9SCTAzYbEtE3t/l1R4mdkHTw4qnWpQ8InGL0sNuN2C 0FTKDPfhiwkNFBG1mno6AemorYZ0+XF0L5HetsXF19Mu7jo6WllWm4xZSJu+rIuHBf8m XiJCpUONAeA0g9HCDY/zarsHRIfy9cTZL7qNy4ATXzJSuhJZRLG1i6rovkzNytaLiF2H 8UPO0kd2BrGT5+u7KSGVd6sUa7k+2IQMdm2qLVsMmeEnzUFF7JtUNrc06n/y5EcOf8pz Z11w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mDfQjkS2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o17-20020a639a11000000b003817672f2d4si17101655pge.316.2022.03.21.20.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 20:26:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mDfQjkS2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D36EF1C393B; Mon, 21 Mar 2022 19:57:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235787AbiCVC61 (ORCPT + 99 others); Mon, 21 Mar 2022 22:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235715AbiCVC6S (ORCPT ); Mon, 21 Mar 2022 22:58:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE3143FFD74; Mon, 21 Mar 2022 19:56:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A02D6113C; Tue, 22 Mar 2022 02:56:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE42EC340F3; Tue, 22 Mar 2022 02:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647917801; bh=YEpuCp2P6kjoBndK4Ea4E+BlNtN1oBALS8HZJrXyV2c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mDfQjkS2M5e69HcKlS1E5oQpk1kuGQsmejHzx93zyfw1Nm2XFLSavr5tZhJTifykA Z+AlC41AgnKpW0TH0GbCklwrbKffWX3EQCZ8nzGyZcuSdrE/q1OWFMUWhBJw1G4CC5 4cjYXe3h2/hPuKrQSa1KIk87zKVXlJ54sn1suUhzCPmOhKka1YsvAD0ZZyIfoZEolJ /i4TJ+Ch3OJlH3Nk2D6J+jB/TQqwOVFoeAL2fEF/NW8zF4hBgGbe8YJX0Bmph7cOsV EzT8JqdZW+2CpsOEvvwqI1nYy7DGcYyy/BTYimGfMetUsIpVpFpnabZz6/a4nljUdH J+Gd+ALJnv+zQ== Received: by mail-ua1-f52.google.com with SMTP id o26so6508913uap.4; Mon, 21 Mar 2022 19:56:41 -0700 (PDT) X-Gm-Message-State: AOAM531v/UWOfMXo++ObBRYR4ZkHF7alpPGmN9B7MvGssh0Z6UuU2/RG NQjbRw7lcGqK+zZSADF7TzfwymquS5ZtcBnWpkA= X-Received: by 2002:ab0:30b8:0:b0:356:c867:9283 with SMTP id b24-20020ab030b8000000b00356c8679283mr3724666uam.118.1647917800908; Mon, 21 Mar 2022 19:56:40 -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> In-Reply-To: From: Huacai Chen Date: Tue, 22 Mar 2022 10:56:32 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V8 13/22] LoongArch: Add system call support To: Arnd Bergmann Cc: 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" , Christian Brauner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi, Arnd, On Mon, Mar 21, 2022 at 5:48 PM 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. OK, wait a response, if arch_fork() will be moved to clone3(), then I will remove __ARCH_WANT_SYS_CLONE. Huacai > > > > > +#define __get_user(x, ptr) \ > > > > +({ \ > > > > + int __gu_err = 0; \ > > > > + \ > > > > + __chk_user_ptr(ptr); \ > > > > + __get_user_common((x), sizeof(*(ptr)), ptr); \ > > > > + __gu_err; \ > > > > +}) > > > > > > It would be good to also provide a > > > __kernel_kernel_nofault()/__put_kernel_nofault() > > > implementation, as the default based on __get_user()/__put_user is not > > > ideal. > > They are provided in this file below. > > Ok, I see them now, not sure what I did wrong when I looked earlier. > > Arnd