[PATCHv3,16/30] parasite: convert sigframe to u64

Submitted by Dmitry Safonov on June 28, 2016, 7:24 p.m.

Details

Message ID 20160628192423.14943-17-dsafonov@virtuozzo.com
State Rejected
Series "x86 Compatible C/R, part 2"
Headers show

Commit Message

Dmitry Safonov June 28, 2016, 7:24 p.m.
Sigframe pointer should be fixed size.
Convert members of rt_sigframe_ia32 to fixed-size.
After this patch dumping of compatible tasks works.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
 criu/arch/x86/include/asm/fpu.h      |  4 ++--
 criu/arch/x86/include/asm/restorer.h |  2 +-
 criu/include/parasite.h              | 10 +++++-----
 criu/parasite-syscall.c              |  2 +-
 criu/pie/parasite.c                  |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/include/asm/fpu.h b/criu/arch/x86/include/asm/fpu.h
index be168324bc96..6362ebe47f79 100644
--- a/criu/arch/x86/include/asm/fpu.h
+++ b/criu/arch/x86/include/asm/fpu.h
@@ -93,10 +93,10 @@  typedef struct {
 
 	union {
 		struct xsave_struct	xsave;
-		unsigned char		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
+		u8		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
 	};
 
-	bool has_fpu;
+	u8 has_fpu;
 } fpu_state_t;
 
 #endif /* __CR_ASM_FPU_H__ */
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index 66931e1d46fc..a93f3010dd55 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -116,7 +116,7 @@  struct ucontext_ia32 {
 
 struct rt_sigframe_ia32 {
 	u32			pretcode;
-	int			sig;
+	s32			sig;
 	u32			pinfo;
 	u32			puc;
 #ifdef CONFIG_X86_64
diff --git a/criu/include/parasite.h b/criu/include/parasite.h
index 77688100e58a..82f4c3fb5db7 100644
--- a/criu/include/parasite.h
+++ b/criu/include/parasite.h
@@ -69,14 +69,14 @@  struct ctl_msg {
 	(struct ctl_msg){.cmd = _cmd, .ack = _cmd, .err = _err, }
 
 struct parasite_init_args {
-	s32				h_addr_len;
-	struct sockaddr_un		h_addr;
+	s32			h_addr_len;
+	struct sockaddr_un	h_addr;
 
-	s32				log_level;
+	s32			log_level;
 
-	struct rt_sigframe		*sigframe;
+	u64			sigreturn_addr;
 
-	u64				sigreturn_addr;
+	u64			sigframe; /* pointer to sigframe */
 };
 
 struct parasite_unmap_args {
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index e6db4972333b..f658dfd37c33 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -512,7 +512,7 @@  static int parasite_init_daemon(struct parasite_ctl *ctl, struct ns_id *net)
 
 	args = parasite_args(ctl, struct parasite_init_args);
 
-	args->sigframe = ctl->rsigframe;
+	args->sigframe = (uintptr_t)ctl->rsigframe;
 	args->log_level = log_get_loglevel();
 
 	if (prepare_tsock(ctl, pid, args, net))
diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 96ea2c8bcdd7..b0dbafa6cfd5 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -735,7 +735,7 @@  static noinline __used int parasite_init_daemon(void *data)
 	int ret;
 
 	args->sigreturn_addr = (u64)(uintptr_t)fini_sigreturn;
-	sigframe = args->sigframe;
+	sigframe = (void*)(uintptr_t)args->sigframe;
 
 	tsock = sys_socket(PF_UNIX, SOCK_SEQPACKET, 0);
 	if (tsock < 0) {