Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1060048ybf; Thu, 27 Feb 2020 04:21:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxv7CNnjWIOSnfiFgttrgjiCx71oYK7egCHbPXA3vCmLvm7qbDzVq1m3+yh94d7POahzkSJ X-Received: by 2002:aca:1913:: with SMTP id l19mr2892731oii.47.1582806116933; Thu, 27 Feb 2020 04:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582806116; cv=none; d=google.com; s=arc-20160816; b=t7kDgwXbGmS+tky8oyqujw/o1kcLNSzjo8/4Fap85SrW0JGEeo7kl2mJi4fRlXEBT4 xLYnAU1vtoklfzJhU5seMeNpFZjoXbRASS4qYwAaK26xV2JQK47VBAXHJ4SNT2a9Nkd2 KdP9qqekKC9do+ZST47JtbP1eSV01IZg8Gx0NBtL4Q59eFioJcbh1X737kS90I1HH6+4 p8RhMZyQqDDCzUcV5JoorSB7aWhyVouVG/5LAZC5WYXRa9cc/wExP+p6CczhsHtitXx2 rAaZcB+DexApT834iuMhHq+KqVtMFhoj3Y3RedQ2G7cMAqrETaRQKBxO4uF5fES/9DaT fx4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SdM2505YTtX9t9epV34JQFPNJ4HrH8AlltImvvFnKoc=; b=nngRtmPQLV1hFCVzriEQZMj/M5SFCuVR7JULTAk1AO3Kud2J3ZyfEZhtoZRD6yiZMN eppD1pC9OBUlHcreAdfbsJheFdozZJElhjtZT2no2BPlrWFTr1d8c7r+Kdlz3p4IoZO1 BUvqaRB6bxKfaJGC3rKMgzNOU/Cv4V5m4kF00YeL34+tNkl2HRLhRQuFP3baVgYqtRyd EcuqvwOf0OvgGek4EVuykfA6dgOZcVNX7GGVe2+Pn2xxJ4fGCLI19pyf8hlv7/KfDDRN Z7KzmXLvYyQ4CF1j8XEQABDiaZq7uzmznc27ISkG21+DDF+XFUfa0ylvaa4YYNcC4foT 52yQ== 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 a64si1249457oif.256.2020.02.27.04.21.42; Thu, 27 Feb 2020 04:21:56 -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 S1728996AbgB0MT4 (ORCPT + 99 others); Thu, 27 Feb 2020 07:19:56 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:56424 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728929AbgB0MTz (ORCPT ); Thu, 27 Feb 2020 07:19:55 -0500 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j7I8v-0004CK-6h; Thu, 27 Feb 2020 12:19:53 +0000 Date: Thu, 27 Feb 2020 13:19:52 +0100 From: Christian Brauner To: Stafford Horne Cc: LKML , Openrisc , Jonas Bonn , Stefan Kristiansson , Christian Brauner , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal Subject: Re: [PATCH 1/3] openrisc: Convert copy_thread to copy_thread_tls Message-ID: <20200227121952.hywkuydswvdn3myc@wittgenstein> References: <20200226225625.28935-1-shorne@gmail.com> <20200226225625.28935-2-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200226225625.28935-2-shorne@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 07:56:23AM +0900, Stafford Horne wrote: > This is required for clone3 which passes the TLS value through a > struct rather than a register. > > Signed-off-by: Stafford Horne > --- > arch/openrisc/Kconfig | 1 + > arch/openrisc/kernel/process.c | 15 +++++---------- > 2 files changed, 6 insertions(+), 10 deletions(-) > > diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig > index 1928e061ff96..5debdbe6fc35 100644 > --- a/arch/openrisc/Kconfig > +++ b/arch/openrisc/Kconfig > @@ -14,6 +14,7 @@ config OPENRISC > select HANDLE_DOMAIN_IRQ > select GPIOLIB > select HAVE_ARCH_TRACEHOOK > + select HAVE_COPY_THREAD_TLS > select SPARSE_IRQ > select GENERIC_IRQ_CHIP > select GENERIC_IRQ_PROBE > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c > index b06f84f6676f..6695f167e126 100644 > --- a/arch/openrisc/kernel/process.c > +++ b/arch/openrisc/kernel/process.c > @@ -117,12 +117,13 @@ void release_thread(struct task_struct *dead_task) > extern asmlinkage void ret_from_fork(void); > > /* > - * copy_thread > + * copy_thread_tls > * @clone_flags: flags > * @usp: user stack pointer or fn for kernel thread > * @arg: arg to fn for kernel thread; always NULL for userspace thread > * @p: the newly created task > * @regs: CPU context to copy for userspace thread; always NULL for kthread > + * @tls: the Thread Local Storate pointer for the new process > * > * At the top of a newly initialized kernel stack are two stacked pt_reg > * structures. The first (topmost) is the userspace context of the thread. > @@ -148,8 +149,8 @@ extern asmlinkage void ret_from_fork(void); > */ > > int > -copy_thread(unsigned long clone_flags, unsigned long usp, > - unsigned long arg, struct task_struct *p) > +copy_thread_tls(unsigned long clone_flags, unsigned long usp, > + unsigned long arg, struct task_struct *p, unsigned long tls) > { > struct pt_regs *userregs; > struct pt_regs *kregs; > @@ -180,15 +181,9 @@ copy_thread(unsigned long clone_flags, unsigned long usp, > > /* > * For CLONE_SETTLS set "tp" (r10) to the TLS pointer passed to sys_clone. Maybe reword this to: For CLONE_SETTLS set "tp" (r10) to the TLS pointer. We probably shouldn't mention clone() explicitly anymore, since we now have clone3() and therefore two callers that pass in tls arguments. Thanks! Christian