[CRIU] [PATCHv1 02/26] sigframe: introduce SIGFRAME_MAX_OFFSET

Dmitry Safonov dsafonov at virtuozzo.com
Thu Jun 16 03:53:19 PDT 2016


For x86 there are different SIGFRAME_OFFSET for native and compatible
tasks. In the next patches I will make SIGFRAME_OFFSET(rt_sigframe)
macro (depending on rt_sigframe).

As RESTORE_STACK_SIGFRAME used only for allocation sizes,
I don't want to introduce RESTORE_STACK_SIGFRAME(rt_sigframe)
dependency on rt_sigframe type. Let's just use for this porpose max
sigframe offset of native/compat tasks.

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/arch/x86/include/asm/restorer.h | 3 ++-
 criu/include/sigframe.h              | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index b99328b4e89a..d8ecae6ad0a3 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -36,6 +36,8 @@ struct rt_sigcontext {
 	unsigned long			reserved1[8];
 };
 
+#define SIGFRAME_MAX_OFFSET 8
+
 #include "sigframe.h"
 
 struct rt_sigframe {
@@ -140,7 +142,6 @@ struct rt_sigframe {
 
 #define SIGFRAME_OFFSET 8
 
-
 int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r);
 int restore_nonsigframe_gpregs(UserX86RegsEntry *r);
 
diff --git a/criu/include/sigframe.h b/criu/include/sigframe.h
index 2b1a102f6f03..b98323182d5f 100644
--- a/criu/include/sigframe.h
+++ b/criu/include/sigframe.h
@@ -10,8 +10,13 @@
 
 struct rt_sigframe;
 
+#ifndef SIGFRAME_MAX_OFFSET
+#define SIGFRAME_MAX_OFFSET SIGFRAME_OFFSET
+#endif
+
 /* sigframe should be aligned on 64 byte for x86 and 8 bytes for arm */
-#define RESTORE_STACK_SIGFRAME ALIGN(sizeof(struct rt_sigframe) + SIGFRAME_OFFSET, 64)
+#define RESTORE_STACK_SIGFRAME						\
+	ALIGN(sizeof(struct rt_sigframe) + SIGFRAME_MAX_OFFSET, 64)
 
 #ifndef __ARCH_SI_PREAMBLE_SIZE
 #define __ARCH_SI_PREAMBLE_SIZE	(3 * sizeof(int))
-- 
2.8.3



More information about the CRIU mailing list