[CRIU] [PATCH] x86: Add proper ifdefs into sigframe construction

Andrey Wagin avagin at gmail.com
Wed Jul 29 13:18:22 PDT 2015


All tests fail with the same error:

==================================== ERROR ====================================
Test: zdtm/live/static/env00, Namespace: 1
Dump log   : /root/git/criu/test/dump/ns/static/env00/30751/1/dump.log
--------------------------------- grep Error ---------------------------------
------------------------------------- END -------------------------------------
Restore log: /root/git/criu/test/dump/ns/static/env00/30751/1/restore.log
--------------------------------- grep Error ---------------------------------
(00.336144) Error (parasite-syscall.c:922): Task is in unexpected state: b7f
(00.339712) Error (parasite-syscall.c:922): Task is in unexpected state: b7f
------------------------------------- END -------------------------------------
================================= ERROR OVER =================================


2015-07-26 13:01 GMT+03:00 Cyrill Gorcunov <gorcunov at openvz.org>:
> This will help to support compat mode in the future.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  arch/x86/crtools.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c
> index 5ecb609b4cb1..caef8514558f 100644
> --- a/arch/x86/crtools.c
> +++ b/arch/x86/crtools.c
> @@ -463,6 +463,7 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
>  #define CPREG1(d)      f->uc.uc_mcontext.d = r->d
>  #define CPREG2(d, s)   f->uc.uc_mcontext.d = r->s
>
> +#ifdef CONFIG_X86_64
>         CPREG1(r8);
>         CPREG1(r9);
>         CPREG1(r10);
> @@ -471,6 +472,8 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
>         CPREG1(r13);
>         CPREG1(r14);
>         CPREG1(r15);
> +#endif
> +
>         CPREG2(rdi, di);
>         CPREG2(rsi, si);
>         CPREG2(rbp, bp);
> @@ -481,10 +484,19 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
>         CPREG2(rsp, sp);
>         CPREG2(rip, ip);
>         CPREG2(eflags, flags);
> +
>         CPREG1(cs);
> +
> +#ifdef CONFIG_X86_32
>         CPREG1(ss);
> +#endif
> +
> +#ifdef CONFIG_X86_32
>         CPREG1(gs);
>         CPREG1(fs);
> +       CPREG1(es);
> +       CPREG1(ds);
> +#endif
>
>         return 0;
>  }
> --
> 2.4.3
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list