Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp615912pxb; Tue, 14 Sep 2021 05:13:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpx57vObaiKLYnKjGW7p5gerXOvsMm8Ll1RgmiJfikiCAXpNUZO0LUxmjK5vLuI5AuBK11 X-Received: by 2002:a92:c70a:: with SMTP id a10mr11172057ilp.109.1631621590633; Tue, 14 Sep 2021 05:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631621590; cv=none; d=google.com; s=arc-20160816; b=m0iiWbFLboSli9iJli9MtByVmsCYxk/zb7CMvZCGpgPlKwbEVz5biU8SHU/xwc+eNR lurls2FN67bK0Ny7YI5ORGvYc0XmFsk644535A3WKjOb4E78VeJoBDp1ktmat9PKwmGJ 2iEPUS44GfYt0jzp4inuLLJ23dEWuUMmTHmUzd0b1ZRaBATg4f/FL4CK17szdn617+Pc 0qYnj6y0qTQXhy0secdqF5Z5faD+4phI6JTBHhDGHi/AVhgUyYBpH6x2IiDi/AJkFTV2 vZk7rNiwPiAUm76DhFK1R9SNjptZam4Tu3sWRDUkPSSfKRYBKYGRdgqZt3oSBgVwg91V 0d5Q== 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=2a+fI11DzkLJADeycyCQHtaLuvkHuc1zKPDNfEvwbPY=; b=Q+RpdtzhTVkKoUwmXaSGq4fa0jVut1vPybrOrb+8oGullbj17ba4EcqfAQSZoKK7oa 2Rd70t+U50p//kA3ls+k0wn85hOpEfMwFSoUFwxLgF3VTjmDE3O2lpAzyLA/Uxg4IH1q fDLhI1GkyeixEvFv8roDkD8cXNoMs1HuPYHHY+Wwvrf6bMLhgPaRLjWsdLaJ95twtAcr ujIn8/C1+czJvTD1xkiV/yFnWMuD0kWOvCs06r7zlVMcos2Zdr932VKvbNNc0muhZUH6 hHjeHtOzCo0t2J1OeSKlvn1mkncLUQontFUSt0VEEmlrv+ZsPAK7vaaV7nYVrG4W1PF9 Y2ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eGqXq7Su; 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 f5si10772899ils.71.2021.09.14.05.12.59; Tue, 14 Sep 2021 05:13:10 -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=eGqXq7Su; 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 S232671AbhINMMu (ORCPT + 99 others); Tue, 14 Sep 2021 08:12:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:43216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbhINMMp (ORCPT ); Tue, 14 Sep 2021 08:12:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD1916112D; Tue, 14 Sep 2021 12:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631621488; bh=3Eo7aeQUKWhSuHa2Yy03uZkrXM9xu16VG+SpPZYmMqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGqXq7SuYLFaSMofX/n34tYQjKjRKyp2rUzLBToahvHZpcV5HQmhV2FBHm2Ccvydo l8eo30W842/61Yv9t4FWfZFFCGvufPKBQHi5kkzh+DiJf8bANhWqwVnOcsZQCs4tBo LwvK8qr+yFOoPIfEEsMV0GmzoMeSanwUR9HQH8m0w85cDn2VmVj9fvfvT0iJ6jkJVd V1Y5Zjr0h7fIov1IHkiMaS3YxTC0kg2/JZyRIPQGbQSIl6Qr03blMuKQ1zOpFsItLu KIGqTNePxnKgfiuTrnr+3WECWPE9NgfnPAYGBNCwFRbbCChEoiqOnPHALJhShPddgZ TOxAb7CtKizuQ== 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 7/8] riscv: rely on core code to keep thread_info::cpu updated Date: Tue, 14 Sep 2021 14:10:35 +0200 Message-Id: <20210914121036.3975026-8-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 --- 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 -- 2.30.2