[CRIU] [PATCH 1/4] compel/uapi: remove compat_sigset_t type
Dmitry Safonov
dsafonov at virtuozzo.com
Tue Nov 22 03:42:17 PST 2016
Remove compatible sigset structure: as it has the same size for both
32-bit and 64-bit, I didn't use it across the code, only for a size check.
The check is removed as we use now only k_rtsigset_t.
Wordsize for sigset is changed to 64-bit - as it's written in comment
for possible 32-bit native building.
If we ever going to support compat mode for other archs, we will
need to re-introduce compat_sigset_t type if it has for those archs
different sizes for compat/native builds.
But for a while, let's simplify this.
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
compel/arch/x86/plugins/include/asm/syscall-types.h | 12 ++++++------
compel/arch/x86/src/lib/include/uapi/asm/sigframe.h | 9 ---------
criu/arch/x86/include/asm/restorer.h | 5 -----
3 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/compel/arch/x86/plugins/include/asm/syscall-types.h b/compel/arch/x86/plugins/include/asm/syscall-types.h
index b22b6d795c74..9874fd0be000 100644
--- a/compel/arch/x86/plugins/include/asm/syscall-types.h
+++ b/compel/arch/x86/plugins/include/asm/syscall-types.h
@@ -11,17 +11,17 @@ typedef rt_restorefn_t *rt_sigrestore_t;
#define SA_RESTORER 0x04000000
#define _KNSIG 64
-
-#ifndef CONFIG_COMPAT
#define _NSIG_BPW 64
-#else
-#define _NSIG_BPW 32
-#endif
#define _KNSIG_WORDS (_KNSIG / _NSIG_BPW)
+/*
+ * Note: as k_rtsigset_t is the same size for 32-bit and 64-bit,
+ * sig defined as uint64_t rather than (unsigned long) - for the
+ * purpose if we ever going to support native 32-bit compilation.
+ */
typedef struct {
- unsigned long sig[_KNSIG_WORDS];
+ uint64_t sig[_KNSIG_WORDS];
} k_rtsigset_t;
typedef struct {
diff --git a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
index 7a744acbaca6..9ca4fa990a4a 100644
--- a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
+++ b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
@@ -75,15 +75,6 @@ struct rt_sigcontext_32 {
typedef uint32_t compat_uptr_t;
typedef uint32_t compat_size_t;
-typedef uint32_t compat_sigset_word;
-
-#define _COMPAT_NSIG 64
-#define _COMPAT_NSIG_BPW 32
-#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
-
-typedef struct {
- compat_sigset_word sig[_COMPAT_NSIG_WORDS];
-} compat_sigset_t;
typedef struct compat_siginfo {
int si_signo;
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index 98e4be3ee18f..c552fbdc0570 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -9,11 +9,6 @@
#include <compel/asm/sigframe.h>
#ifdef CONFIG_COMPAT
-static inline void __always_unused __check_compat_sigset_t(void)
-{
- BUILD_BUG_ON(sizeof(compat_sigset_t) != sizeof(k_rtsigset_t));
-}
-
extern void *alloc_compat_syscall_stack(void);
extern void free_compat_syscall_stack(void *mem);
extern unsigned long call32_from_64(void *stack, void *func);
--
2.10.2
More information about the CRIU
mailing list