[PATCH 2/9] ARM: entry: remove macros ct_user_enter() and ct_user_exit()

Xie Yuanbin posted 9 patches 2 weeks ago
[PATCH 2/9] ARM: entry: remove macros ct_user_enter() and ct_user_exit()
Posted by Xie Yuanbin 2 weeks ago
The macros ct_user_enter and ct_user_exit have only three calling points,
and the 'save' argument is always 0.

Expand the calling and delete the macros.

Preparing for subsequent commits, nothing changes on vmlinux.

Signed-off-by: Xie Yuanbin <qq570070308@gmail.com>
---
 arch/arm/kernel/entry-armv.S   |  4 +++-
 arch/arm/kernel/entry-common.S |  8 ++++++--
 arch/arm/kernel/entry-header.S | 28 ----------------------------
 3 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index ef6a657c8d13..7f8781666a44 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -406,7 +406,9 @@ ENDPROC(__fiq_abt)
 #ifdef CONFIG_TRACE_IRQFLAGS
 	bl	trace_hardirqs_off
 #endif
-	ct_user_exit save = 0
+#ifdef CONFIG_CONTEXT_TRACKING_USER
+	bl	user_exit_callable
+#endif
 	.endif
 	.endm
 
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 88336a1292bb..f579770fab71 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -117,7 +117,9 @@ ENTRY(ret_to_user_from_irq)
 no_work_pending:
 	asm_trace_hardirqs_on save = 0
 
-	ct_user_enter save = 0
+#ifdef CONFIG_CONTEXT_TRACKING_USER
+	bl	user_enter_callable
+#endif
 
 #ifdef CONFIG_KSTACK_ERASE
 	bl	stackleak_erase_on_task_stack
@@ -190,7 +192,9 @@ ENTRY(vector_swi)
 	alignment_trap r10, ip, cr_alignment
 	asm_trace_hardirqs_on save=0
 	enable_irq_notrace
-	ct_user_exit save=0
+#ifdef CONFIG_CONTEXT_TRACKING_USER
+	bl	user_exit_callable
+#endif
 
 	/*
 	 * Get the system call number.
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 99411fa91350..fd62112e1e6e 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -361,34 +361,6 @@ ALT_UP_B(.L1_\@)
 #endif	/* !CONFIG_THUMB2_KERNEL */
 	.endm
 
-/*
- * Context tracking subsystem.  Used to instrument transitions
- * between user and kernel mode.
- */
-	.macro ct_user_exit, save = 1
-#ifdef CONFIG_CONTEXT_TRACKING_USER
-	.if	\save
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl	user_exit_callable
-	ldmia	sp!, {r0-r3, ip, lr}
-	.else
-	bl	user_exit_callable
-	.endif
-#endif
-	.endm
-
-	.macro ct_user_enter, save = 1
-#ifdef CONFIG_CONTEXT_TRACKING_USER
-	.if	\save
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl	user_enter_callable
-	ldmia	sp!, {r0-r3, ip, lr}
-	.else
-	bl	user_enter_callable
-	.endif
-#endif
-	.endm
-
 	.macro	invoke_syscall, table, nr, tmp, ret, reload=0
 #ifdef CONFIG_CPU_SPECTRE
 	mov	\tmp, \nr
-- 
2.51.0