Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7657277ybl; Thu, 16 Jan 2020 03:27:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxvwIo2GvHOLiUQPDat+UPyV0NvXuv154ah0XlL2L16BngYEQMygUtGMy9N6s8iQ3qeHBHq X-Received: by 2002:a9d:1d02:: with SMTP id m2mr1448293otm.45.1579174053641; Thu, 16 Jan 2020 03:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579174053; cv=none; d=google.com; s=arc-20160816; b=uDxJpY6Jsrpd3wgqv7OBAlsI3hAwuYLPrd8mrKiKVt9cf7ItZ2TziXDumIOZkJP/KP JYQzssTrrX00A7cu0Hvux+oDeJZ8wL69y9Pju/NzzjcCe9lzyfW9J4iukrYgV7X6+lX9 TcP91S7c1DMxdgNkQd2M8JcPcUdYZudG/k2Lc8Hx8p0vgKGX2zYHADygT5I9rJP2u4Ov U94UEz4xcAl/1vYpi1iQ5uWZ8fSv3u8ZnvqlkQfQKulWcntavPCoSEjDT2AIJZNMo4N4 6Y/HOvmlgjff9fvCVRWpbO2GIJ06w6QTUKfkFZBh+m42q4XraECBDXHDe6doq8I7GapV qN/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Fqjf0r41krDy/IUaRCct+43uXALGKFDSPehnZ8vjFqQ=; b=rYZbnCK8HNt/OlCZfbXuJD2UHfm+zHvjjCAAS5VupTtRGia4A1mjM7lMY3lLH2+5cj VjzxTEjDYgm6lVcarZAaPNTm0KgsGTVb0o5FQgaje7A9Du+6elkOraecs+Qklfjdt/bG CSQDzy/Sc5uI/fhIwA5yZUhHg7qH6Tz8eLxa2E5ZTOXNirVPcQFhu3d0vVgtu6MUsjFB wVT1qmFGo8hN/AX47mxHmYoXKFkseWjyfzJ8VbAA8epp/kEA75BNJm54kvQzPZ6pjdF8 ZPwDDrLtMxW06RKfJS576dBw+DMxnVWQw0vvfHBA/aD/PQ95gdYxgbQNcJCTas95zPfK olBA== 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 e22si12662741otj.38.2020.01.16.03.27.21; Thu, 16 Jan 2020 03:27:33 -0800 (PST) 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 S1726535AbgAPLZY (ORCPT + 99 others); Thu, 16 Jan 2020 06:25:24 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:35004 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgAPLZY (ORCPT ); Thu, 16 Jan 2020 06:25:24 -0500 Received: from ip5f5bd663.dynamic.kabel-deutschland.de ([95.91.214.99] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1is3H5-0001S8-FE; Thu, 16 Jan 2020 11:25:19 +0000 Date: Thu, 16 Jan 2020 12:25:18 +0100 From: Christian Brauner To: Vineet Gupta Cc: Christian Brauner , Arnd Bergmann , 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 , arcml Subject: Re: clone3 on ARC (was Re: [PATCH v3 2/2] arch: wire-up clone3() syscall) Message-ID: <20200116112517.53luv7qolevtqjpu@wittgenstein> References: <20190604160944.4058-1-christian@brauner.io> <20190604160944.4058-2-christian@brauner.io> <20190604212930.jaaztvkent32b7d3@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2020 at 10:41:20PM +0000, Vineet Gupta wrote: > On 6/4/19 2:29 PM, Christian Brauner wrote: > > On Tue, Jun 04, 2019 at 08:40:01PM +0200, Arnd Bergmann wrote: > >> On Tue, Jun 4, 2019 at 6:09 PM Christian Brauner wrote: > >>> > >>> Wire up the clone3() call on all arches that don't require hand-rolled > >>> assembly. > >>> > >>> Some of the arches look like they need special assembly massaging and it is > >>> probably smarter if the appropriate arch maintainers would do the actual > >>> wiring. Arches that are wired-up are: > >>> - x86{_32,64} > >>> - arm{64} > >>> - xtensa > >> > >> The ones you did look good to me. I would hope that we can do all other > >> architectures the same way, even if they have special assembly wrappers > >> for the old clone(). The most interesting cases appear to be ia64, alpha, > >> m68k and sparc, so it would be good if their maintainers could take a > >> look. > > > > Yes, agreed. They can sort this out even after this lands. > > > >> > >> What do you use for testing? Would it be possible to override the > >> internal clone() function in glibc with an LD_PRELOAD library > >> to quickly test one of the other architectures for regressions? > > > > I have a test program that is rather horrendously ugly and I compiled > > kernels for x86 and the arms and tested in qemu. The program basically > > looks like [1]. > > I just got around to fixing this for ARC (patch to follow after we sort out the > testing) and was trying to use the test case below for a qucik and dirty smoke > test (so existing toolchain lacking with headers lacking NR_clone3 or struct > clone_args etc). I did hack those up, but then spotted below > > uapi/linux/sched.h > > | struct clone_args { > | __aligned_u64 flags; > | __aligned_u64 pidfd; > | __aligned_u64 child_tid; > | __aligned_u64 parent_tid; > .. > .. > > Are all clone3 arg fields supposed to be 64-bit wide, even things like @child_tid, > @tls .... which are traditionally ARCH word wide ? This is just the kernel ABI we expose to userspace with the intention to make it easy for us to handle 32 and 64 bit. A libc like glibc is expected to expose a properly typed struct to userspace. The kernel struct kernel_clone_args has "correct" typing. Christian