Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 699F5C433EF for ; Thu, 4 Nov 2021 08:52:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2448560E9C for ; Thu, 4 Nov 2021 08:52:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2448560E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JVrXw9oPXv3wCCV/0Zu8bE7PtRlewpKDDmpAJnUig7I=; b=fQxjQ7EtXSm/j0 VDUWnouNMPqvWSnJ5imub2RYSeh5ANjEJ+eVKA1PLCM6tkjNL60eYnk9OoOKyGU7Jx68w6fC9rAYt caHU4qpVD3cE6bQRwgoTE/y0GGKEx8B9oeZPJJrl7DN7GCveC+qe+JGkh1Ks+gH7I/xnq0R+MVbpY LWsta9v1JcEA28vWn0umGNdGvbIrR9jrxJuBvHO+jpcnyklwNLy+wu23x46cGgv9rfaQwDJCTuOfB K/LR4230Bq0ShWZ1i0sRQH7swB2msIQDFnp/7DGYV+jUwTRZ/Qyk6y8SiePrmsvhV0DTrd3GSK3mn Svbnv4Ktcm6Q26r1hduQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1miYSa-008Mhe-5M; Thu, 04 Nov 2021 08:51:00 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1miYSV-008Mgj-O7 for linux-arm-kernel@lists.infradead.org; Thu, 04 Nov 2021 08:50:57 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBA666112D; Thu, 4 Nov 2021 08:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636015855; bh=2FfD7gCctbR/LgRTSogQfmjFgpXGvsFc6ycLUwBmm04=; h=From:To:Cc:Subject:Date:From; b=pAU/saydZ0znBIc52vpM1wuTby+OX+6KeDmz/fmTiaLrspqaTb8JdVDJ2mYHwrGQd DzCvkw8yvJaxxNZxvpMaioN0Zt+6rwUQ42DK0Moh5uAOARkKk7eBiba1UnbJyyOuOz O5tsRsrRKJCfVb7Ux/oGDUGbNVPRpn9KRg4dZJqcu+pgK1qBtG9O2r3o6F2G0pTQ4A zLdzWEIVaiWIxdNvT4iIkWANjLZwfIpfnjJtdlKQdJaMMPdWy/8PRsTOyBBYYXoshM 2xj8WbPwgCK+6VSCadPgetYVg+D2Qra7zLdopdaeANdM9fZPOsACnEJCYZyV//OxrK UT98DE6Xs0WgQ== From: Ard Biesheuvel To: linux@armlinux.org.uk Cc: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH] ARM: leave it to core code to manage thread_info::cpu Date: Thu, 4 Nov 2021 09:50:49 +0100 Message-Id: <20211104085049.2794169-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2771; h=from:subject; bh=2FfD7gCctbR/LgRTSogQfmjFgpXGvsFc6ycLUwBmm04=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBhg57osIm48psy6X9HuRJu0uRe6wF4iLFnGoOGbiUQ OmSaf+6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYYOe6AAKCRDDTyI5ktmPJPYRC/ 9mffE6rQeQ3kMgImab2kYftWY1DYNXbuXKYLgXBPOvqoIIIWdaoeHtn77dnDJ6OFCdgEblI2ynWXJ0 MoolnAnEZ4MurqYcrniEpNYS0ohPQP43RY6I6ZGLBkJbRyYFuMiqeYWE63rTwcx30UD4fegPa002Pw jGtMgnHRFBeZDvf3kJND6opYQX//8wDDFBFklVd5hcQzXJcWSKJFjLSZtKLzEX9CBbYUYbJ+h/a2pB TMONOT7s8P39IoEKs74GOClgG8OnZw3D6qPmtUHg2Gdipt6/hqR44K98Tx17FqQYtCSYvmlktRZsml J1uPzPu+fDAIhCNaC9d/E/5CQO6tE8A5LHT7TqdzTv15TXEZnHK3UpZEZfIrdLV/YvkHF6L1h1oncd MYCqXEWvmDLLndEZRgRLekW8U54HPpz1zrsXlalMXONtaNmkM6qgQAwZ0hp5dUGZ1O2HfXkBMjHWOh ztyWpampBLCXQQtiVWomyz65Vb/O5EIJOxUK4shttzuJI= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211104_015055_867904_596ED780 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since commit bcf9033e5449 ("sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y"), the CPU field in thread_info went back to being managed by the core code, so we no longer have to keep it in sync in arch code. While at it, mark THREAD_INFO_IN_TASK as done for ARM in the documentation. Signed-off-by: Ard Biesheuvel --- .../core/thread-info-in-task/arch-support.txt | 2 +- arch/arm/include/asm/switch_to.h | 14 -------------- arch/arm/kernel/smp.c | 3 --- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Documentation/features/core/thread-info-in-task/arch-support.txt b/Documentation/features/core/thread-info-in-task/arch-support.txt index 3361e86b0958..bc74d8beea72 100644 --- a/Documentation/features/core/thread-info-in-task/arch-support.txt +++ b/Documentation/features/core/thread-info-in-task/arch-support.txt @@ -8,7 +8,7 @@ ----------------------- | alpha: | TODO | | arc: | TODO | - | arm: | TODO | + | arm: | ok | | arm64: | ok | | csky: | TODO | | h8300: | TODO | diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h index b55c7b2755e4..61e4a3c4ca6e 100644 --- a/arch/arm/include/asm/switch_to.h +++ b/arch/arm/include/asm/switch_to.h @@ -23,23 +23,9 @@ */ extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *); -static inline void set_ti_cpu(struct task_struct *p) -{ -#ifdef CONFIG_THREAD_INFO_IN_TASK - /* - * The core code no longer maintains the thread_info::cpu field once - * CONFIG_THREAD_INFO_IN_TASK is in effect, but we rely on it for - * raw_smp_processor_id(), which cannot access struct task_struct* - * directly for reasons of circular #inclusion hell. - */ - task_thread_info(p)->cpu = task_cpu(p); -#endif -} - #define switch_to(prev,next,last) \ do { \ __complete_pending_tlbi(); \ - set_ti_cpu(next); \ if (IS_ENABLED(CONFIG_CURRENT_POINTER_IN_TPIDRURO)) \ __this_cpu_write(__entry_task, next); \ last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index cde5b6d8bac5..97ee6b1567e9 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -154,9 +154,6 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) secondary_data.swapper_pg_dir = get_arch_pgd(swapper_pg_dir); #endif secondary_data.task = idle; - if (IS_ENABLED(CONFIG_THREAD_INFO_IN_TASK)) - task_thread_info(idle)->cpu = cpu; - sync_cache_w(&secondary_data); /* -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel