lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 24 Feb 2023 18:10:08 +0800
From:   Jinyang He <hejinyang@...ngson.cn>
To:     Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>
Cc:     Xi Ruoyao <xry111@...111.site>,
        Youling Tang <tangyouling@...ngson.cn>,
        loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH 1/6] LoongArch: Rename handle_syscall to handle_sys

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 <hejinyang@...ngson.cn>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ