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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67A3BC64ED8 for ; Fri, 24 Feb 2023 10:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229763AbjBXKLo (ORCPT ); Fri, 24 Feb 2023 05:11:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjBXKL0 (ORCPT ); Fri, 24 Feb 2023 05:11:26 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 38EE564E3D for ; Fri, 24 Feb 2023 02:10:47 -0800 (PST) Received: from loongson.cn (unknown [111.9.175.10]) by gateway (Coremail) with SMTP id _____8DxUOUmjfhjgqQEAA--.3637S3; Fri, 24 Feb 2023 18:10:46 +0800 (CST) Received: from localhost.localdomain (unknown [111.9.175.10]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxX+QjjfhjNH86AA--.6368S3; Fri, 24 Feb 2023 18:10:45 +0800 (CST) From: Jinyang He To: Huacai Chen , WANG Xuerui Cc: Xi Ruoyao , Youling Tang , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] LoongArch: Rename handle_syscall to handle_sys Date: Fri, 24 Feb 2023 18:10:08 +0800 Message-Id: <20230224101013.26971-2-hejinyang@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230224101013.26971-1-hejinyang@loongson.cn> References: <20230224101013.26971-1-hejinyang@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxX+QjjfhjNH86AA--.6368S3 X-CM-SenderInfo: pkhmx0p1dqwqxorr0wxvrqhubq/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7IU82g43UUUUU== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The original handle_sys() is a trampline for handler_syscall. Drop it and rename handle_syscall to handle_sys for invoking it directly. Signed-off-by: Jinyang He --- arch/loongarch/kernel/entry.S | 13 +++++++------ arch/loongarch/kernel/genex.S | 5 ----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/loongarch/kernel/entry.S b/arch/loongarch/kernel/entry.S index d737e3cf42d3..d6e9572eb279 100644 --- a/arch/loongarch/kernel/entry.S +++ b/arch/loongarch/kernel/entry.S @@ -18,9 +18,9 @@ .text .cfi_sections .debug_frame .align 5 -SYM_FUNC_START(handle_syscall) +SYM_FUNC_START(handle_sys) csrrd t0, PERCPU_BASE_KS - la.pcrel t1, kernelsp + la_abs t1, kernelsp add.d t1, t1, t0 move t2, sp ld.d sp, t1, 0 @@ -62,12 +62,13 @@ SYM_FUNC_START(handle_syscall) li.d tp, ~_THREAD_MASK and tp, tp, sp - move a0, sp - bl do_syscall + move a0, sp + la_abs ra, do_syscall + jirl ra, ra, 0 RESTORE_ALL_AND_RET -SYM_FUNC_END(handle_syscall) -_ASM_NOKPROBE(handle_syscall) +SYM_FUNC_END(handle_sys) +_ASM_NOKPROBE(handle_sys) SYM_CODE_START(ret_from_fork) bl schedule_tail # a0 = struct task_struct *prev diff --git a/arch/loongarch/kernel/genex.S b/arch/loongarch/kernel/genex.S index 44ff1ff64260..1af169ca3734 100644 --- a/arch/loongarch/kernel/genex.S +++ b/arch/loongarch/kernel/genex.S @@ -91,8 +91,3 @@ SYM_FUNC_END(except_vec_cex) BUILD_HANDLER ri ri none BUILD_HANDLER watch watch none BUILD_HANDLER reserved reserved none /* others */ - -SYM_FUNC_START(handle_sys) - la_abs t0, handle_syscall - jr t0 -SYM_FUNC_END(handle_sys) -- 2.34.3