From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: tglx@linutronix.de
Cc: hch@infradead.org, mingo@redhat.com, keescook@chromium.org,
arnd@arndb.de, luto@amacapital.net, wad@chromium.org,
rostedt@goodmis.org, paul@paul-moore.com, eparis@redhat.com,
oleg@redhat.com, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, x86@kernel.org,
Gabriel Krisman Bertazi <krisman@collabora.com>,
kernel@collabora.com
Subject: [PATCH v2 02/10] entry: Expose helpers to migrate TIF to SYSCALL_WORK flags
Date: Mon, 16 Nov 2020 12:41:58 -0500 [thread overview]
Message-ID: <20201116174206.2639648-3-krisman@collabora.com> (raw)
In-Reply-To: <20201116174206.2639648-1-krisman@collabora.com>
With the goal to split the syscall work related flags into a separate
field that is architecture independent, expose transitional helpers that
resolve to either the TIF flags or to the corresponding SYSCALL_WORK
flags. This will allow architectures to migrate only when they port to
the generic syscall entry code.
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
---
Changes since v2:
- Drop bogus cast to ulong (hch)
- Fix subsystem prefix (tglx)
---
include/linux/thread_info.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index e93e249a4e9b..f2d78de55840 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -97,6 +97,36 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
#define test_thread_flag(flag) \
test_ti_thread_flag(current_thread_info(), flag)
+#ifdef CONFIG_GENERIC_ENTRY
+#define set_syscall_work(fl) \
+ set_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work)
+#define test_syscall_work(fl) \
+ test_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work)
+#define clear_syscall_work(fl) \
+ clear_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work)
+
+#define set_task_syscall_work(t, fl) \
+ set_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
+#define test_task_syscall_work(t, fl) \
+ test_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
+#define clear_task_syscall_work(t, fl) \
+ clear_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
+#else
+#define set_syscall_work(fl) \
+ set_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
+#define test_syscall_work(fl) \
+ test_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
+#define clear_syscall_work(fl) \
+ clear_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
+
+#define set_task_syscall_work(t, fl) \
+ set_ti_thread_flag(task_thread_info(t), TIF_##fl)
+#define test_task_syscall_work(t, fl) \
+ test_ti_thread_flag(task_thread_info(t), TIF_##fl)
+#define clear_task_syscall_work(t, fl) \
+ clear_ti_thread_flag(task_thread_info(t), TIF_##fl)
+#endif /* CONFIG_GENERIC_ENTRY */
+
#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
#ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
--
2.29.2
next prev parent reply other threads:[~2020-11-16 17:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 17:41 [PATCH v2 00/10] Migrate syscall entry/exit work to SYSCALL_WORK flagset Gabriel Krisman Bertazi
2020-11-16 17:41 ` [PATCH v2 01/10] x86: Expose syscall_work field in thread_info Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:41 ` Gabriel Krisman Bertazi [this message]
2020-11-16 21:11 ` [tip: core/entry] entry: Expose helpers to migrate TIF to SYSCALL_WORK flags tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:41 ` [PATCH v2 03/10] entry: Wire up syscall_work in common entry code Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:42 ` [PATCH v2 04/10] seccomp: Migrate to use SYSCALL_WORK flag Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-24 16:28 ` [PATCH v2 04/10] " Dmitry Osipenko
2020-11-24 17:55 ` Gabriel Krisman Bertazi
2020-11-24 18:41 ` Dmitry Osipenko
2020-11-16 17:42 ` [PATCH v2 05/10] tracepoints: " Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-17 19:11 ` [PATCH v2 05/10] " Steven Rostedt
2020-11-16 17:42 ` [PATCH v2 06/10] ptrace: Migrate to use SYSCALL_TRACE flag Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:42 ` [PATCH v2 07/10] ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:42 ` [PATCH v2 08/10] audit: Migrate " Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:42 ` [PATCH v2 09/10] entry: Drop usage of TIF flags in the generic syscall code Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
2020-11-16 17:42 ` [PATCH v2 10/10] x86: Reclaim unused x86 TI flags Gabriel Krisman Bertazi
2020-11-16 21:11 ` [tip: core/entry] " tip-bot2 for Gabriel Krisman Bertazi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201116174206.2639648-3-krisman@collabora.com \
--to=krisman@collabora.com \
--cc=arnd@arndb.de \
--cc=eparis@redhat.com \
--cc=hch@infradead.org \
--cc=keescook@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=paul@paul-moore.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=wad@chromium.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox