Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3155638ybt; Mon, 22 Jun 2020 16:50:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9iS24M3v1i9TlPrlXWSYehVyTxGbfaMRg4x8XtylGWAT18J9G/3Lsw/AmhCwl/+sgV7jj X-Received: by 2002:a17:906:278e:: with SMTP id j14mr10481822ejc.365.1592869837486; Mon, 22 Jun 2020 16:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592869837; cv=none; d=google.com; s=arc-20160816; b=VNP1nknSfySkgyXe2fYiBbt6fI5gCbqRXq0N4kAWQvnBszEs2a05NGbxGcfIhvWIWl fnrrZJJiR8pqK0GbUyfhJqWZk1YbVC2uJlNWXa2U6FvZ8T3440FNWBX7CaRg005EKTZN o26lcU8NF3YbNNWSh2iZGu/S7h9LfM1Y6lArEJxNGsPzhKPSWwlp3Tx4ZxHPX7f9M/IA sRaZpY9fLaMmL4Z3rGKtszejTp18ey6OVGC4iqwQpTTgOVukBmI0Tk+aH6pyu/UwGMFI 75DqJpfjGHPd5kWVKX2xTsixkpEzTjn1FryDG88fFp8ECveUfARvvCprszgF8PfxNehL epXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mlXKRmRSgNkQjjEJbb/HPi61b8+wd4UaDOkLkY61Mfs=; b=jRHI4pPGon/PVPK8OaDC7gdL99OvLncLJfpdlt6CuRVspajwMc2U7ZufJBrkEQltmI LLSYEJ1PYn7cJRPCs1hIgr3AyAgCYWa+LtWft8uEG6ALiux0E4d0hlfxyikvrVrbc//X fM/JQ52r94WQ7lJz5Aqm/ZQWn3Q8hQxh5jdFTGSSuOOslt+F2cWoMuTp3S33Djl5sijj YYoILxcfej4gaqOrNOmaHendsNHEukfqUeJGIo9QqH2kSOgRYweRay87uKasJxk77O7J Ig29QoxeQbQ+Y6ntjq7hodXW1+6uZh1cUkcwfOxTW2gOg8OZGtInw8P2zpLYCCK/Ns01 7rpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si1810405edl.330.2020.06.22.16.50.15; Mon, 22 Jun 2020 16:50:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731209AbgFVXqS (ORCPT + 99 others); Mon, 22 Jun 2020 19:46:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54809 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731110AbgFVXqM (ORCPT ); Mon, 22 Jun 2020 19:46:12 -0400 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jnW8g-0005DO-Er; Mon, 22 Jun 2020 23:46:10 +0000 From: Christian Brauner To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Christian Brauner , Greentime Hu , Nick Hu , Vincent Chen Subject: [PATCH 13/17] nds32: switch to copy_thread_tls() Date: Tue, 23 Jun 2020 01:43:22 +0200 Message-Id: <20200622234326.906346-14-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622234326.906346-1-christian.brauner@ubuntu.com> References: <20200622234326.906346-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the copy_thread_tls() calling convention which passes tls through a register. This is required so we can remove the copy_thread{_tls}() split and remove the HAVE_COPY_THREAD_TLS macro. Cc: Greentime Hu Cc: Nick Hu Cc: Vincent Chen Signed-off-by: Christian Brauner --- arch/nds32/Kconfig | 1 + arch/nds32/kernel/process.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/nds32/Kconfig b/arch/nds32/Kconfig index e30298e99e1b..7b6eaca81cce 100644 --- a/arch/nds32/Kconfig +++ b/arch/nds32/Kconfig @@ -48,6 +48,7 @@ config NDS32 select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FTRACE_MCOUNT_RECORD select HAVE_DYNAMIC_FTRACE + select HAVE_COPY_THREAD_TLS help Andes(nds32) Linux support. diff --git a/arch/nds32/kernel/process.c b/arch/nds32/kernel/process.c index 9712fd474f2c..7dbb1bf64165 100644 --- a/arch/nds32/kernel/process.c +++ b/arch/nds32/kernel/process.c @@ -149,8 +149,9 @@ void flush_thread(void) DEFINE_PER_CPU(struct task_struct *, __entry_task); asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); -int copy_thread(unsigned long clone_flags, unsigned long stack_start, - unsigned long stk_sz, struct task_struct *p) +int copy_thread_tls(unsigned long clone_flags, unsigned long stack_start, + unsigned long stk_sz, struct task_struct *p, + unsigned long tls) { struct pt_regs *childregs = task_pt_regs(p); @@ -170,7 +171,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, childregs->uregs[0] = 0; childregs->osp = 0; if (clone_flags & CLONE_SETTLS) - childregs->uregs[25] = childregs->uregs[3]; + childregs->uregs[25] = tls; } /* cpu context switching */ p->thread.cpu_context.pc = (unsigned long)ret_from_fork; -- 2.27.0