[PATCH v21 06/15] arm64: syscall: Invert the exit-path flags check in el0_svc_common()

Jinjie Ruan ruanjinjie at huawei.com
Wed Nov 11 03:42:16 PST 2026


In the fast exit path of el0_svc_common(), invert the nested flags
check so that it calls syscall_trace_exit() directly when work is
pending and then returns, instead of returning early when no work is
pending and falling through to the trace_exit label.

This makes the fast path call the exit work in the same place as the
slow path, which later patches fold into a single helper.

In preparation for moving arm64 over to the generic entry. No
functional changes.

Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Will Deacon <will at kernel.org>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Ada Couprie Diaz <ada.coupriediaz at arm.com>
Reviewed-by: Linus Walleij <linusw at kernel.org>
Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
---
 arch/arm64/kernel/syscall.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
index 3e78e159b2a1..b8d7d29a431b 100644
--- a/arch/arm64/kernel/syscall.c
+++ b/arch/arm64/kernel/syscall.c
@@ -127,8 +127,9 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
 	 */
 	if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
 		flags = read_thread_flags();
-		if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP))
-			return;
+		if (has_syscall_work(flags) || flags & _TIF_SINGLESTEP)
+			syscall_trace_exit(regs);
+		return;
 	}
 
 trace_exit:
-- 
2.34.1




More information about the linux-arm-kernel mailing list