Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp48561pxb; Tue, 28 Sep 2021 15:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhEgGwEC1lxJEEYUnPVwNQ80ahDBHnQpFoleY9fgyBJwdKBpLAElCBec8xh5OZiu2myDZu X-Received: by 2002:a17:90b:3ca:: with SMTP id go10mr2487641pjb.37.1632866941165; Tue, 28 Sep 2021 15:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632866941; cv=none; d=google.com; s=arc-20160816; b=IQezZj6q8jISUfatY0ys2pe2/XRF12E1H4BdbTNAnUrEM2hH7w3LMLc8bjK6F/8K7v a4eRkoy6q5nLDwNGoSSjBEtTRgkYCrHf9gvLjXOF9Bqbd+IhiYa9aXgZvvH+tldA3rgW nWJSH/LZcr1Bof2QeaFWaZ0yG+T4QjElhJpDnAIpTs33yUZb4syDSncyjI9bGje3Yrwc Wof+VS141URpNwuUulYhRiEeN75MrEt7LGfSNaSOANubw8FYk+oesgQVdakHkIToLHej O5jGDXd+PyQPud72zz5uEKOwgUAfwjFsr1sV0j8PwuvGxeLnDbI5ccXcPYG1moHesQxb hciw== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=hqLpx7Wm6Aikf3yaBVZ1DfYqAohja9hoxxDTJ4xjS7o=; b=iA1bJUOHtB2Q+Kcew892kI1g3z4O24PAdi1I6wS0HMKrwkNOqisE+bosH9tWHR3AO3 8y/BtPVpDWwuMN6hiNJzrn3XU0Al3CyvE09Z3OYeCp8Qb64i+bbaCy0LU9U97MGAdiWd +TUYLHuCBdXbacKf4Vf0cmdh0QjwCWrRzJthY3mKAVTDbbdNxHxKUwFP48ZyM3JXUrca r9IxnmNkc0WSRj2AWeb9THH1s9V6tueIkU6wUFz7kCtmgUII8zuAmrcnyYBKEiTJYHSQ EmYf+ecc/rawx2Vz27XvfjVIcGrfZLU3g3JCXPLh9caICiDT/wyGKz5b108+gzyHvub6 xrWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=I79TXBee; 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 p8si278624plb.408.2021.09.28.15.08.48; Tue, 28 Sep 2021 15:09:01 -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=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=I79TXBee; 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 S242870AbhI1WJY (ORCPT + 99 others); Tue, 28 Sep 2021 18:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243010AbhI1WJV (ORCPT ); Tue, 28 Sep 2021 18:09:21 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4071DC061745 for ; Tue, 28 Sep 2021 15:07:41 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id q125so302337qkd.12 for ; Tue, 28 Sep 2021 15:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=hqLpx7Wm6Aikf3yaBVZ1DfYqAohja9hoxxDTJ4xjS7o=; b=I79TXBeeKhqw/PkSZBawchrYJxCClh648BkPzWLbNa1UkVvlTTkBiT5/9JZ+EP89Ho guh8PRCNJ/vUJtFdxBjphdv3bgHIkUSsNWXSjlUDvsWO3HOrWnzDZvk/lFdojijY2jBm 97fJyoUUndoubaQUCmKy2tXrCNSbPLATypEeOetRkXaSK7lLYOl8+AdZseYJPanJiAoB KfXAL15/M4xU3OTAtvuix3kZ1MqdcjRGfyiy9wFV2n8BOIJUv9Q4ppd4p+p0P7dD6qbE GLziTGb2w4zMAPXS6NDZ4GbcEi892+RAgDw4uV9gr7Gi4UuGL6DvBJ3bjf+mUAn+Yeim ooKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=hqLpx7Wm6Aikf3yaBVZ1DfYqAohja9hoxxDTJ4xjS7o=; b=ul7ITVeVDz1WBiYVWhH6vly4YFAGB5dCcQG/apBruwVqIMqGj3ElNyq0qiebwiiUTP foRwdIcdtJIey7vG4848q6O2or7YIqs/5lEe3fZ2sn+ujmvATsyU9Lmsh827M3b1Yjcf LlUWl+TaMJSPdCB8VdzRNqY5iLXfklxiX6oMgMHE8BTpqVBr9FHOR0eCXCnacrp2jfua luJ8SeP6t/MPOXF+0btMOYcfhp6ERI7fO2KWZcJyFsW9/VgdC0BFXw5dnoKH8HzvvmSt Xj9oHUFlhL/EQabgLas01ulAG1U6q7dQPBKU1JsSeLHiPylwxgupTUA1az85daAzRpq1 dIfQ== X-Gm-Message-State: AOAM531JzZ3rqL1KzRwtrhjxP8uGAzapjnxVH8z9Gm3b7uoR6zQOlhgO jxvAVG1U+knY0mHPdoSaG6PXFKVntR6+OA== X-Received: by 2002:ae9:de86:: with SMTP id s128mr2452630qkf.146.1632866860009; Tue, 28 Sep 2021 15:07:40 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id e16sm332752qtq.18.2021.09.28.15.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 15:07:39 -0700 (PDT) Date: Tue, 28 Sep 2021 15:07:39 -0700 (PDT) X-Google-Original-Date: Tue, 28 Sep 2021 15:07:35 PDT (-0700) Subject: Re: [RFC PATCH 7/8] riscv: rely on core code to keep thread_info::cpu updated In-Reply-To: <20210914121036.3975026-8-ardb@kernel.org> CC: linux-kernel@vger.kernel.org, ardb@kernel.org, keithpac@amazon.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, christophe.leroy@csgroup.eu, paulus@samba.org, Paul Walmsley , aou@eecs.berkeley.edu, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, peterz@infradead.org, keescook@chromium.org, luto@kernel.org, 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 From: Palmer Dabbelt To: ardb@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Sep 2021 05:10:35 PDT (-0700), ardb@kernel.org wrote: > 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 > --- > arch/riscv/kernel/asm-offsets.c | 1 - > arch/riscv/kernel/entry.S | 5 ----- > arch/riscv/kernel/head.S | 1 - > 3 files changed, 7 deletions(-) > > diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c > index 90f8ce64fa6f..478d9f02dab5 100644 > --- a/arch/riscv/kernel/asm-offsets.c > +++ b/arch/riscv/kernel/asm-offsets.c > @@ -33,7 +33,6 @@ void asm_offsets(void) > OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count); > OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp); > OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp); > - OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu); > > OFFSET(TASK_THREAD_F0, task_struct, thread.fstate.f[0]); > OFFSET(TASK_THREAD_F1, task_struct, thread.fstate.f[1]); > diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S > index 98f502654edd..459eb1714353 100644 > --- a/arch/riscv/kernel/entry.S > +++ b/arch/riscv/kernel/entry.S > @@ -544,11 +544,6 @@ ENTRY(__switch_to) > REG_L s9, TASK_THREAD_S9_RA(a4) > REG_L s10, TASK_THREAD_S10_RA(a4) > REG_L s11, TASK_THREAD_S11_RA(a4) > - /* Swap the CPU entry around. */ > - lw a3, TASK_TI_CPU(a0) > - lw a4, TASK_TI_CPU(a1) > - sw a3, TASK_TI_CPU(a1) > - sw a4, TASK_TI_CPU(a0) > /* The offset of thread_info in task_struct is zero. */ > move tp, a1 > ret > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S > index fce5184b22c3..d5ec30ef6f5d 100644 > --- a/arch/riscv/kernel/head.S > +++ b/arch/riscv/kernel/head.S > @@ -317,7 +317,6 @@ clear_bss_done: > call setup_trap_vector > /* Restore C environment */ > la tp, init_task > - sw zero, TASK_TI_CPU(tp) > la sp, init_thread_union + THREAD_SIZE > > #ifdef CONFIG_KASAN Acked-by: Palmer Dabbelt Thanks!