[CRIU] [PATCH 24/44] restorer: introduced the TLS restoration.

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 7 10:04:53 EST 2013


Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/x86/include/asm/restorer.h |    2 ++
 include/restorer.h              |    2 ++
 pie/restorer.c                  |    7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/restorer.h b/arch/x86/include/asm/restorer.h
index a17201c..08b53ca 100644
--- a/arch/x86/include/asm/restorer.h
+++ b/arch/x86/include/asm/restorer.h
@@ -138,4 +138,6 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r);
 
 int restore_fpu(struct rt_sigframe *sigframe, struct thread_restore_args *args);
 
+static inline void restore_tls(u32 tls) { }
+
 #endif
diff --git a/include/restorer.h b/include/restorer.h
index 014c310..c6a4601 100644
--- a/include/restorer.h
+++ b/include/restorer.h
@@ -86,6 +86,8 @@ struct thread_restore_args {
 		struct xsave_struct	xsave;
 		unsigned char		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
 	};
+
+	u32				tls;
 } __aligned(sizeof(long));
 
 struct task_restore_core_args {
diff --git a/pie/restorer.c b/pie/restorer.c
index 2dbd5ba..b80e413 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -162,7 +162,12 @@ static int restore_thread_common(struct rt_sigframe *sigframe,
 	if (restore_fpu(sigframe, args))
 		return -1;
 
-	return restore_gpregs(sigframe, &args->gpregs);
+	if (restore_gpregs(sigframe, &args->gpregs))
+		return -1;
+
+	restore_tls(args->tls);
+
+	return 0;
 }
 
 /*
-- 
1.7.10.4



More information about the CRIU mailing list