[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250916082611.2972008-10-ruanjinjie@huawei.com>
Date: Tue, 16 Sep 2025 16:26:10 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <catalin.marinas@....com>, <will@...nel.org>, <oleg@...hat.com>,
<tglx@...utronix.de>, <peterz@...radead.org>, <luto@...nel.org>,
<kees@...nel.org>, <wad@...omium.org>, <charlie@...osinc.com>,
<macro@...am.me.uk>, <deller@....de>, <akpm@...ux-foundation.org>,
<ldv@...ace.io>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next v6 09/10] entry: Add has_syscall_work() helper
Add has_syscall_work() helper to facilitate reuse
of this function in other places.
No functional changes.
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
include/linux/entry-common.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index cd6dacb2d8bf..e0f94e937e84 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -44,6 +44,11 @@
SYSCALL_WORK_SYSCALL_EXIT_TRAP | \
ARCH_SYSCALL_WORK_EXIT)
+static inline bool has_syscall_work(unsigned long work)
+{
+ return unlikely(work & SYSCALL_WORK_ENTER);
+}
+
/**
* syscall_enter_from_user_mode_prepare - Establish state and enable interrupts
* @regs: Pointer to currents pt_regs
@@ -91,7 +96,7 @@ static __always_inline long syscall_enter_from_user_mode_work(struct pt_regs *re
{
unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
- if (work & SYSCALL_WORK_ENTER)
+ if (has_syscall_work(work))
syscall = syscall_trace_enter(regs, syscall, work);
return syscall;
--
2.34.1
Powered by blists - more mailing lists