Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp463893ybi; Fri, 21 Jun 2019 02:40:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/f4WgWMx1sN+ITDVX2qJr07dClyJDxSOYNKNWmpL1kBp9lN1Na9d7d1ZGC9YnWsuq441X X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr5248097pjc.23.1561110019209; Fri, 21 Jun 2019 02:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561110019; cv=none; d=google.com; s=arc-20160816; b=cx3kru9/nNhMJmoMZW7gxnfwu/IpVEn+IsYdTA4qRpAvDh52BTvPTU7g0kUhuNM0xw Q5AoXr2m1Oi9ZU1IcHhh/jthxCf6wczXffT5NEguGsH9iVpt8V/WvbrGqSmEq2scj7xp fwL1sBYefJ0AZBSpgxLAOvMroYkoOOrcCVPumjRrf4ZcGIxbqIseIY4ITjoEE2vIMhqe NcN1ONE1QW/weBUbSLzzdQyKsP7YAQTJSrDl/OCDwqdkaMzrzHFD65POgZ9PDCiM0vPj xV9ksLY9wAjZBYUUnXgvQGxAzCqyQmihp30KFQVsQFrx4Ho87FDvEEzxGLjorQqr1uda +mUg== 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=2FEpr/HTFcZTm84CTGTRQ7vot2qZMrXbzR3E1H7td1Y=; b=AhVkkYTVkSS97MB0avD42U2ktGt1V6M2limFkZL8cVcK9UHPJ9ejvrD7mmg8IBSJOE H2UZDbpu1ALryBoSwBiODL7d2Q/ZADcrwdPLZhgHVHZU6QExqfB3nsf19ZU8qbSpxGDE IRr8V9wbiKx1GIGmmVcDEotjass6yTR8Sydnr3C+psvDsfZ6IWHqQel4HIoKDfe5xJoE Awi3fNnxZ1DJ613QfnxwsH1P5KCckVoyoGsCHqRecAttw1wPOCv29GkuEPj1klwYzu/z qYcKKZHHr9kHkosuRwuWYXRPmwJM7tEibfl9bYMdDAgk3uHSKUAXfWo6c6SlZ8Q6BkfW RUvw== 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 p17si2276641plo.310.2019.06.21.02.40.03; Fri, 21 Jun 2019 02:40:19 -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 S1726558AbfFUJiJ (ORCPT + 99 others); Fri, 21 Jun 2019 05:38:09 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33086 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbfFUJiJ (ORCPT ); Fri, 21 Jun 2019 05:38:09 -0400 Received: by mail-qk1-f194.google.com with SMTP id r6so3963560qkc.0; Fri, 21 Jun 2019 02:38:08 -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=2FEpr/HTFcZTm84CTGTRQ7vot2qZMrXbzR3E1H7td1Y=; b=SJlqq79/sQy4z1pGNEszIyefch+9nPWjNa5pIvVOv5cpZN39HPRWrK7gbrkt5cPU5D SEIM1rHI+caxqklyXGVnu/pTwQ62Xz6REbk3xPJgRSVLG5sMULj0K3IKqXsgjMZ+ENby ehMPPjz71mwa+zaeIq0ZA6+psF8vgrld6oy0nO8OnOEtafAXq/7/1Khlw+Xyn7G7nkVC U+kQOrxkZ5Ae3Bc2ZHQUOl5r3w8x71lCMqzweB/kNHfQAxuaiQeJbmxe3y0F9QAS9V00 R/n7cUgVEMBpEbvpInVmom2oHJ7PcHI4poxqf5NYeycC1/FaaKvaRvdXnwxDtHN6QK7T xurA== X-Gm-Message-State: APjAAAVmHtQE7793zZou5tfG86mSID+bvNk1RtUngck7W8/JaXxACtlT UjZJAhA38SQK1xqE6jDAZ9vNLSx4UtfwATKvc5s= X-Received: by 2002:a37:dcc7:: with SMTP id v190mr110347907qki.286.1561109887787; Fri, 21 Jun 2019 02:38:07 -0700 (PDT) MIME-Version: 1.0 References: <20190604160944.4058-1-christian@brauner.io> <20190604160944.4058-2-christian@brauner.io> <20190620184451.GA28543@roeck-us.net> <20190620221003.ciuov5fzqxrcaykp@brauner.io> In-Reply-To: <20190620221003.ciuov5fzqxrcaykp@brauner.io> From: Arnd Bergmann Date: Fri, 21 Jun 2019 11:37:50 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] arch: wire-up clone3() syscall To: Christian Brauner Cc: Guenter Roeck , Al Viro , Linux Kernel Mailing List , Linus Torvalds , Jann Horn , Kees Cook , Florian Weimer , Oleg Nesterov , David Howells , Andrew Morton , Adrian Reber , Linux API , linux-arch , "the arch/x86 maintainers" 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 Fri, Jun 21, 2019 at 12:10 AM Christian Brauner wrote: > On Thu, Jun 20, 2019 at 11:44:51AM -0700, Guenter Roeck wrote: > > On Tue, Jun 04, 2019 at 06:09:44PM +0200, Christian Brauner wrote: > > clone3() was placed under __ARCH_WANT_SYS_CLONE. Most architectures > simply define __ARCH_WANT_SYS_CLONE and are done with it. > Some however, such as nios2 and h8300 don't define it but instead > provide a sys_clone stub of their own because of architectural > requirements (or tweaks) and they are mostly written in assembly. (That > should be left to arch maintainers for sys_clone3.) > > The build failures were on my radar already. I hadn't yet replied > since I haven't pushed the fixup below. > The solution is to define __ARCH_WANT_SYS_CLONE3 and add a > cond_syscall(clone3) so we catch all architectures that do not yet > provide clone3 with a ENOSYS until maintainers have added it. > > diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h > index 7a39e77984ef..aa35aa5d68dc 100644 > --- a/arch/arm/include/asm/unistd.h > +++ b/arch/arm/include/asm/unistd.h > @@ -40,6 +40,7 @@ > #define __ARCH_WANT_SYS_FORK > #define __ARCH_WANT_SYS_VFORK > #define __ARCH_WANT_SYS_CLONE > +#define __ARCH_WANT_SYS_CLONE3 I never really liked having __ARCH_WANT_SYS_CLONE here because it was the only one that a new architecture needed to set: all the other __ARCH_WANT_* are for system calls that are already superseded by newer ones, so a new architecture would start out with an empty list. Since __ARCH_WANT_SYS_CLONE3 replaces __ARCH_WANT_SYS_CLONE for new architectures, how about leaving __ARCH_WANT_SYS_CLONE untouched but instead coming up with the reverse for clone3 and mark the architectures that specifically don't want it (if any)? Arnd