Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp31833pxm; Tue, 22 Feb 2022 15:55:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7J0G8+FFhkVge+FfV00ykA8bNReJfXzIqv00VeDZK4NAE9JMWPn8VnkrsqxYwEP7qyPVQ X-Received: by 2002:a17:902:b204:b0:14d:a8c8:af37 with SMTP id t4-20020a170902b20400b0014da8c8af37mr25600673plr.108.1645574157182; Tue, 22 Feb 2022 15:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645574157; cv=none; d=google.com; s=arc-20160816; b=0daOLO2stY2rAPqkm0Ge7O1+v1LwpxyEDrdlaOcecrq0qvLo88rL3hR04EzcxvQoKX Kqxb6m4ho2H3fFlotqg7tKpPioQte4ShWNLl2GufpV4eSEbRerK7slzcvcbcgN4dPEM3 b+o75s9HaAF/xapWDv23NSOysxI5wS/GD4VKIVtOnzcHe5W9J4tcb7DzNhd4sycfrYu9 MzAukZaE9Tw1VD/1s8A4pP4wuBpZHlrFKF/HNDFfuKVzFW/do9VG7F3J0CZR/W2vLxXZ nkx/WNLawvELNgMjaaMCfZlAYIE77iB7r1OsTDsbGLhs+1KiRQ9/iFej/3CogVCn5NhH RJ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=mKX2ehwQx1rBrOY9dgJejssquU0nQTuF5xjXIt4Zbmo=; b=aWE56VGd4Jom24EkWZwD8r78B7dukU0dUcEcYV21H6ocO6MnbT9P1/cB+nrOXghuyz ezcaijOwMRo0AVozA7a32kLWbP8+Mzcr43sLT7HGUjf/MRUw6lVfgqczRWMKYt5NVKE+ ZzcS0oLr5NiixYVvHmshWS10zunpZd0CcwkA2QxotN3IzLAbWOjbwwaMIUqYoAWH4nCx +n8cpr6o8j8qAdcS1diK2XWgFfYSzChwR5786MUEdrtNabuuvt4c4UvEhkTwiyVWhEUE s3DrOFafbQRt8HFFQRDwB1uD5H5yae8mSr8XtnfrE7aHQNVS8vw9W7qWhQvZaUM2f6aj f1Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MMUcuWaG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17si12593333pfv.115.2022.02.22.15.55.41; Tue, 22 Feb 2022 15:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MMUcuWaG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235819AbiBVV1p (ORCPT + 99 others); Tue, 22 Feb 2022 16:27:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235788AbiBVV1a (ORCPT ); Tue, 22 Feb 2022 16:27:30 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 068E27B55B; Tue, 22 Feb 2022 13:27:04 -0800 (PST) Date: Tue, 22 Feb 2022 21:27:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1645565222; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mKX2ehwQx1rBrOY9dgJejssquU0nQTuF5xjXIt4Zbmo=; b=MMUcuWaGPR4kGXWGS821ZzKciXcBE06hkTt+8yLczoWfgvAC4benChoLvgU+3XOfh3xcmK Sv9ssNaL6G0eVW+/HLRd1Hsebtm0O5eLZcingp9Ju6R9n7vrW+z5tJMPEsNq5ZXULGjSJJ +r4aRxO6eZdv30/hWyoOkcLSyyc0TFpK5EFN2nx3XEr1LH4rZPvfmjacBqi4nBywXc+Kcw ye/sWevZ9V3Rib6F7ESX9PQp6c+m4nvTfjS315CpmVHll8WBnK8QsCTRcr+4GzqCCi1y8H QD8GdyAOl4DiBq4zIuXq9p/bYRCW3cqx4k1k0QhtT5hw+X/YjhmVQFS25D6CCw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1645565222; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mKX2ehwQx1rBrOY9dgJejssquU0nQTuF5xjXIt4Zbmo=; b=PYSYJ683y88FkbuOOagHA9EX06Uw16s0MDswapjw7UIz7blFlt3xQSCdOj//qj9mUUyT01 O5p4ZaSBxNkEsfCA== From: "tip-bot2 for Sebastian Andrzej Siewior" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/core] fork, IA64: Provide alloc_thread_stack_node() for IA64 Cc: Sebastian Andrzej Siewior , Thomas Gleixner , Andy Lutomirski , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220217102406.3697941-4-bigeasy@linutronix.de> References: <20220217102406.3697941-4-bigeasy@linutronix.de> MIME-Version: 1.0 Message-ID: <164556522143.16921.2330247822699922897.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The following commit has been merged into the core/core branch of tip: Commit-ID: 2bb0529c0bc0698f3baf3e88ffd61a18eef252a7 Gitweb: https://git.kernel.org/tip/2bb0529c0bc0698f3baf3e88ffd61a18eef252a7 Author: Sebastian Andrzej Siewior AuthorDate: Thu, 17 Feb 2022 11:24:01 +01:00 Committer: Thomas Gleixner CommitterDate: Tue, 22 Feb 2022 22:25:01 +01:00 fork, IA64: Provide alloc_thread_stack_node() for IA64 Provide a generic alloc_thread_stack_node() for IA64 and CONFIG_ARCH_THREAD_STACK_ALLOCATOR which returns stack pointer and sets task_struct::stack so it behaves exactly like the other implementations. Rename IA64's alloc_thread_stack_node() and add the generic version to the fork code so it is in one place _and_ to drastically lower the chances of fat fingering the IA64 code. Do the same for free_thread_stack(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220217102406.3697941-4-bigeasy@linutronix.de --- arch/ia64/include/asm/thread_info.h | 6 +++--- kernel/fork.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h index 51d20cb..1684716 100644 --- a/arch/ia64/include/asm/thread_info.h +++ b/arch/ia64/include/asm/thread_info.h @@ -55,15 +55,15 @@ struct thread_info { #ifndef ASM_OFFSETS_C /* how to get the thread information struct from C */ #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) -#define alloc_thread_stack_node(tsk, node) \ +#define arch_alloc_thread_stack_node(tsk, node) \ ((unsigned long *) ((char *) (tsk) + IA64_TASK_SIZE)) #define task_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) #else #define current_thread_info() ((struct thread_info *) 0) -#define alloc_thread_stack_node(tsk, node) ((unsigned long *) 0) +#define arch_alloc_thread_stack_node(tsk, node) ((unsigned long *) 0) #define task_thread_info(tsk) ((struct thread_info *) 0) #endif -#define free_thread_stack(tsk) /* nothing */ +#define arch_free_thread_stack(tsk) /* nothing */ #define task_stack_page(tsk) ((void *)(tsk)) #define __HAVE_THREAD_FUNCTIONS diff --git a/kernel/fork.c b/kernel/fork.c index 30c01ce..7b70c47 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -330,6 +330,23 @@ void thread_stack_cache_init(void) } # endif /* THREAD_SIZE >= PAGE_SIZE || defined(CONFIG_VMAP_STACK) */ +#else /* CONFIG_ARCH_THREAD_STACK_ALLOCATOR */ + +static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node) +{ + unsigned long *stack; + + stack = arch_alloc_thread_stack_node(tsk, node); + tsk->stack = stack; + return stack; +} + +static void free_thread_stack(struct task_struct *tsk) +{ + arch_free_thread_stack(tsk); + tsk->stack = NULL; +} + #endif /* !CONFIG_ARCH_THREAD_STACK_ALLOCATOR */ /* SLAB cache for signal_struct structures (tsk->signal) */