mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
compel: Add ctx flags to get_task_regs()
get_task_regs() needs to know if it needs to use workaround for a Skylake ptrace() bug. The next patch will introduce a new flag for that. I also thought about making 3 versions of get_task_regs() and adding them to ictx->get_task_regs() depending on the flags.. But get_task_regs() is a private function and infect_ctx is a uapi.. So, let's just pass context flags to get_task_regs(). Signed-off-by: Dmitry Safonov <dima@arista.com>
This commit is contained in:
parent
a80817a328
commit
70b67e3383
@ -57,7 +57,8 @@ int sigreturn_prep_fpu_frame_plain(struct rt_sigframe *sigframe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save, void *arg)
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg, __maybe_unused unsigned long flags)
|
||||
{
|
||||
struct iovec iov;
|
||||
user_fpregs_struct_t fpsimd;
|
||||
|
@ -66,7 +66,8 @@ int sigreturn_prep_fpu_frame_plain(struct rt_sigframe *sigframe,
|
||||
}
|
||||
|
||||
#define PTRACE_GETVFPREGS 27
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save, void *arg)
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg, __maybe_unused unsigned long flags)
|
||||
{
|
||||
user_fpregs_struct_t vfp;
|
||||
int ret = -1;
|
||||
|
@ -371,7 +371,8 @@ static int __get_task_regs(pid_t pid, user_regs_struct_t *regs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save, void *arg)
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg, __maybe_unused unsigned long flags)
|
||||
{
|
||||
user_fpregs_struct_t fpregs;
|
||||
int ret;
|
||||
|
@ -312,7 +312,7 @@ static int s390_disable_ri_bit(pid_t pid, user_regs_struct_t *regs)
|
||||
* Prepare task registers for restart
|
||||
*/
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg)
|
||||
void *arg, __maybe_unused unsigned long flags)
|
||||
{
|
||||
user_fpregs_struct_t fpregs;
|
||||
struct iovec iov;
|
||||
|
@ -225,7 +225,8 @@ int sigreturn_prep_fpu_frame_plain(struct rt_sigframe *sigframe,
|
||||
((user_regs_native(pregs)) ? (int64_t)((pregs)->native.name) : \
|
||||
(int32_t)((pregs)->compat.name))
|
||||
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save, void *arg)
|
||||
int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg, __maybe_unused unsigned long flags)
|
||||
{
|
||||
user_fpregs_struct_t xsave = { }, *xs = NULL;
|
||||
|
||||
|
@ -58,7 +58,8 @@ extern void *remote_mmap(struct parasite_ctl *ctl,
|
||||
void *addr, size_t length, int prot,
|
||||
int flags, int fd, off_t offset);
|
||||
extern bool arch_can_dump_task(struct parasite_ctl *ctl);
|
||||
extern int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save, void *arg);
|
||||
extern int get_task_regs(pid_t pid, user_regs_struct_t *regs, save_regs_t save,
|
||||
void *arg, unsigned long flags);
|
||||
extern int arch_fetch_sas(struct parasite_ctl *ctl, struct rt_sigframe *s);
|
||||
extern int sigreturn_prep_regs_plain(struct rt_sigframe *sigframe,
|
||||
user_regs_struct_t *regs,
|
||||
|
@ -667,7 +667,8 @@ static int parasite_start_daemon(struct parasite_ctl *ctl)
|
||||
* while in daemon it is not such.
|
||||
*/
|
||||
|
||||
if (get_task_regs(pid, &ctl->orig.regs, ictx->save_regs, ictx->regs_arg)) {
|
||||
if (get_task_regs(pid, &ctl->orig.regs, ictx->save_regs,
|
||||
ictx->regs_arg, ictx->flags)) {
|
||||
pr_err("Can't obtain regs for thread %d\n", pid);
|
||||
return -1;
|
||||
}
|
||||
@ -1569,7 +1570,7 @@ k_rtsigset_t *compel_task_sigmask(struct parasite_ctl *ctl)
|
||||
|
||||
int compel_get_thread_regs(struct parasite_thread_ctl *tctl, save_regs_t save, void * arg)
|
||||
{
|
||||
return get_task_regs(tctl->tid, &tctl->th.regs, save, arg);
|
||||
return get_task_regs(tctl->tid, &tctl->th.regs, save, arg, tctl->ctl->ictx.flags);
|
||||
}
|
||||
|
||||
struct infect_ctx *compel_infect_ctx(struct parasite_ctl *ctl)
|
||||
|
Loading…
x
Reference in New Issue
Block a user