2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

mips: fix fail when run zdtm test pthread01.c

k_rtsigset_t is 16Bytes in mips architecture but not 8Bytes.
so blk_sigset_extended be added in TaskCoreEntry and ThreadCoreEntry for dumping
extern 8Bytes data in parasite-syscall.c, restore extern 8Bytes data in cr-restore.c

Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
This commit is contained in:
Guoyun Sun 2020-04-22 15:43:04 +08:00 committed by Andrei Vagin
parent be13941221
commit 277b0b69fa

View File

@ -3551,8 +3551,12 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
for (i = 0; i < current->nr_threads; i++) {
CoreEntry *tcore;
struct rt_sigframe *sigframe;
#ifdef CONFIG_MIPS
k_rtsigset_t mips_blkset;
#else
k_rtsigset_t *blkset = NULL;
#endif
thread_args[i].pid = current->threads[i].ns[0].virt;
thread_args[i].siginfo_n = siginfo_priv_nr[i];
thread_args[i].siginfo = task_args->siginfo;
@ -3563,11 +3567,22 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
if (thread_args[i].pid == pid) {
task_args->t = thread_args + i;
tcore = core;
#ifdef CONFIG_MIPS
mips_blkset.sig[0] = tcore->tc->blk_sigset;
mips_blkset.sig[1] = tcore->tc->blk_sigset_extended;
#else
blkset = (void *)&tcore->tc->blk_sigset;
#endif
} else {
tcore = current->core[i];
if (tcore->thread_core->has_blk_sigset)
if (tcore->thread_core->has_blk_sigset) {
#ifdef CONFIG_MIPS
mips_blkset.sig[0] = tcore->thread_core->blk_sigset;
mips_blkset.sig[1] = tcore->thread_core->blk_sigset_extended;
#else
blkset = (void *)&tcore->thread_core->blk_sigset;
#endif
}
}
if ((tcore->tc || tcore->ids) && thread_args[i].pid != pid) {
@ -3607,7 +3622,11 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
thread_args[i].mz = mz + i;
sigframe = (struct rt_sigframe *)&mz[i].rt_sigframe;
#ifdef CONFIG_MIPS
if (construct_sigframe(sigframe, sigframe, &mips_blkset, tcore))
#else
if (construct_sigframe(sigframe, sigframe, blkset, tcore))
#endif
goto err;
if (tcore->thread_core->comm)