Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp616154pxb; Tue, 14 Sep 2021 05:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5XzcwsnpuXq/+/jJDpsJbHjxUu2boKFwOBldRYq5hppIvEKm9dehumurA7ilYdD8wgKLv X-Received: by 2002:a6b:b4ce:: with SMTP id d197mr13522962iof.69.1631621609012; Tue, 14 Sep 2021 05:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631621609; cv=none; d=google.com; s=arc-20160816; b=0VvWLMNzH/+NechHefticY2ouJqd6A0WknbRLGsa7abg7n9VCRKMH7E9JkAzHCITZY wZ9z6r2+57PgdkSbnpD7SW4SA0jz2SP2vXDAAK3ieKyXHhePCuvs7w12aNa3GVE0/ppN sw521PGLoI2JJNPNOpn8+Kyx4GFI3n4L3CdXcRL+u2NHqboqAdC9M/SsXHDuzgwSOD8B Ax7/w8G9rk7ZenNo9oBFpq9GW42cuvtI+NGbw0jG4liJcUiwDv8qNp2OgNeu+ekk70wd 3WoQVUDHQDqJmiOcxsmHRVDoCo7uRxN3A+cOPPlupD6+D9nmahelUv/Me2B6ZbjJnjEg we0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dpK9awB31weMi5dKjlA25OYVDkV8jYiOevADZK8MJM8=; b=O4hx2nJrCpNB/fCVL0XBwXEdR5R1NSYfM/KSXJw0+o695AYMaxaDPl69zHfGPOgcy2 HhS0G+XpXD04ObHI7dvWBKrs6AcdXSjBu7dgU4WWUc9szpDxAb4FOBhkGcGCsEokXQQs Kw1FEiC0Oyn0Cqi9ekRkyth/JQEi8yrIc1is9yz4r9cqZoomBY322OkIYlWX1VE121p1 olq+X8s2LUxRNd8i5UfVOHPcWON9LK3AtMUxA3tL/LfsEAv/4J7YOj54T6Hpmynh6BNr RIFJAtNMh99dTVm6zl/nITYo0yN+nopHltABEzGDClpxmHqyD23WE7o+mHODAPdqUc1B uA+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ig+JhbgZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si11339033iln.136.2021.09.14.05.13.17; Tue, 14 Sep 2021 05:13:29 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ig+JhbgZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232663AbhINMM5 (ORCPT + 99 others); Tue, 14 Sep 2021 08:12:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232695AbhINMMv (ORCPT ); Tue, 14 Sep 2021 08:12:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C83CF6113B; Tue, 14 Sep 2021 12:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631621494; bh=Un8y/D+KQ7QnI5WCuToXds/wfl/En/jtOwh4rNfj9R8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ig+JhbgZYvBpoEkePCkGJri/drWhd/zNQud4qJwR8VAt84t30tIDeaFs97pqovpnU WCFrlyeMm6+1wzrVATtgyga9C5qWYHs1yX99yykHrOJ3pCi9FXJKirLieFGvLxzC0K Mywhpb0yr9NkpYWBDViktx8s3C+pE5TggWsvKK4IyjcPZc1m8gjUT/JKfmfVm6FX8H CX7KnVaCKBdHWEu2l+bHSQiZ1f1aWajC83sfiAJLI1WCxOKfU4PeSC6JVYfKKmXY+Q NIiIwTM/plhEKszesgnnR42HGaTtjXF+XLsz785RrqO0IDw4DjfEQpDioB90gj8vwG AVBFyfowsQ6nQ== From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Keith Packard , Russell King , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Christophe Leroy , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Kees Cook , Andy Lutomirski , Linus Torvalds , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC PATCH 8/8] ARM: rely on core code to keep thread_info::cpu updated Date: Tue, 14 Sep 2021 14:10:36 +0200 Message-Id: <20210914121036.3975026-9-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210914121036.3975026-1-ardb@kernel.org> References: <20210914121036.3975026-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the core code switched back to using thread_info::cpu to keep a task's CPU number, we no longer need to keep it in sync explicitly. So just drop the code that does this. Signed-off-by: Ard Biesheuvel --- This patch applies onto [0], which we hope to get merged for v5.16 [0] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm32-ti-in-task-v5 arch/arm/include/asm/switch_to.h | 14 -------------- arch/arm/kernel/smp.c | 3 --- 2 files changed, 17 deletions(-) diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h index db2be1f6550d..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 = p->cpu; -#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