From: Gregory Price <gourry.memverge@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-doc@vger.kernel.org, oleg@redhat.com, avagin@gmail.com,
peterz@infradead.org, luto@kernel.org, krisman@collabora.com,
tglx@linutronix.de, corbet@lwn.net, shuah@kernel.org,
Gregory Price <gregory.price@memverge.com>
Subject: [PATCH v11 0/2] Checkpoint Support for Syscall User Dispatch
Date: Tue, 21 Feb 2023 15:17:40 -0500 [thread overview]
Message-ID: <20230221201740.2236-1-gregory.price@memverge.com> (raw)
v11: backout complex compat code, change struct to more generic typing
(padding to ensure struct size is the same in 32 compat)
update selftest
tested selftest on 64 machine and in 32-bit compat mode
v10: move refactor code into patch ahead of change
add compat support
documentation change
v9: tglx feedback
whitespace
documentation of ptrace struct
shorten struct name
helper function for set_syscall_user_dispatch
use task variant of set/clear_syscall_work
use task variant of test_syscall_work in getter
selftest
v8: fix include issue Reported-by: kernel test robot <lkp@intel.com>
summary:
+++ b/kernel/entry/syscall_user_dispatch.c
+ include <linux/ptrace.h>
v7: drop ptrace suspend flag, not required
hanging unreferenced variable
whitespace
v6: drop fs/proc/array update, it's not needed
drop on_dispatch field exposure in config structure, it's not
checkpoint relevant.
(Thank you for the reviews Oleg and Andrei)
v5: automated test for !defined(GENERIC_ENTRY) failed, fix fs/proc
use ifdef for GENERIC_ENTRY || TIF_SYSCALL_USER_DISPATCH
note: syscall user dispatch is not presently supported for
non-generic entry, but could be implemented. question is
whether the TIF_ define should be carved out now or then
v4: Whitespace
s/CHECKPOINT_RESTART/CHECKPOINT_RESUME
check test_syscall_work(SYSCALL_USER_DISPATCH) to determine if it's
turned on or not in fs/proc/array and getter interface
v3: Kernel test robot static function fix
Whitespace nitpicks
v2: Implements the getter/setter interface in ptrace rather than prctl
Syscall user dispatch makes it possible to cleanly intercept system
calls from user-land. However, most transparent checkpoint software
presently leverages some combination of ptrace and system call
injection to place software in a ready-to-checkpoint state.
If Syscall User Dispatch is enabled at the time of being quiesced,
injected system calls will subsequently be interposed upon and
dispatched to the task's signal handler.
Patch summary:
- Refactor configuration setting interface to operate on a task
rather than current, so the set and error paths can be consolidated
- Implement a getter interface for Syscall User Dispatch config info.
To resume successfully, the checkpoint/resume software has to
save and restore this information. Presently this configuration
is write-only, with no way for C/R software to save it.
This was done in ptrace because syscall user dispatch is not part of
uapi. The syscall_user_dispatch_config structure was added to the
ptrace exports.
Gregory Price (2):
syscall_user_dispatch: helper function to operate on given task
ptrace,syscall_user_dispatch: checkpoint/restore support for SUD
.../admin-guide/syscall-user-dispatch.rst | 4 +
include/linux/syscall_user_dispatch.h | 18 +++++
include/uapi/linux/ptrace.h | 30 ++++++++
kernel/entry/syscall_user_dispatch.c | 63 +++++++++++++--
kernel/ptrace.c | 9 +++
tools/testing/selftests/ptrace/.gitignore | 1 +
tools/testing/selftests/ptrace/Makefile | 2 +-
tools/testing/selftests/ptrace/get_set_sud.c | 77 +++++++++++++++++++
8 files changed, 195 insertions(+), 9 deletions(-)
create mode 100644 tools/testing/selftests/ptrace/get_set_sud.c
--
2.39.1
next reply other threads:[~2023-02-21 20:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 20:17 Gregory Price [this message]
2023-02-21 20:17 ` [PATCH v11 1/2] syscall_user_dispatch: helper function to operate on given task Gregory Price
2023-02-21 20:17 ` [PATCH v11 2/2] ptrace,syscall_user_dispatch: checkpoint/restore support for SUD Gregory Price
2023-02-21 23:00 ` kernel test robot
2023-02-22 12:48 ` Oleg Nesterov
2023-02-22 15:24 ` Gregory Price
2023-02-23 12:30 ` Oleg Nesterov
2023-02-23 15:31 ` Gregory Price
2023-02-23 18:37 ` Oleg Nesterov
2023-02-24 8:17 ` Andrei Vagin
2023-02-24 16:02 ` Gregory Price
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=20230221201740.2236-1-gregory.price@memverge.com \
--to=gourry.memverge@gmail.com \
--cc=avagin@gmail.com \
--cc=corbet@lwn.net \
--cc=gregory.price@memverge.com \
--cc=krisman@collabora.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®