Skip to content

Commit

Permalink
mips: fix fail when run zdtm test pthread01.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sunny868 authored and avagin committed Apr 29, 2020
1 parent d6b3fc4 commit 1a20533
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion criu/cr-restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -3553,8 +3553,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;
Expand All @@ -3565,11 +3569,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) {
Expand Down Expand Up @@ -3609,7 +3624,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)
Expand Down

0 comments on commit 1a20533

Please sign in to comment.