mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 15:25:21 +00:00
uapi/compel/criu: move auxv_t, tls_t back to CRIU
We don't need them in libcompel for PIE - only needed for C/R. Fixes (with compat enabled back): CC criu/arch/x86/sigaction_compat.o In file included from criu/arch/x86/sigaction_compat.c:1:0: /home/japdoll/tools/criu/criu/arch/x86/include/asm/restorer.h:15:25: error: unknown type name ‘tls_t’ extern void restore_tls(tls_t *ptls); ^~~~~ travis-ci: success for Compel/compat cleanups Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
8ec112b721
commit
2e39767a41
@@ -24,11 +24,6 @@ typedef struct user_fpsimd_state user_fpregs_struct_t;
|
|||||||
|
|
||||||
#define user_regs_native(pregs) true
|
#define user_regs_native(pregs) true
|
||||||
|
|
||||||
#define AT_VECTOR_SIZE 40
|
|
||||||
|
|
||||||
typedef uint64_t auxv_t;
|
|
||||||
typedef uint64_t tls_t;
|
|
||||||
|
|
||||||
#define ARCH_SI_TRAP TRAP_BRKPT
|
#define ARCH_SI_TRAP TRAP_BRKPT
|
||||||
|
|
||||||
#define __NR(syscall, compat) __NR_##syscall
|
#define __NR(syscall, compat) __NR_##syscall
|
||||||
|
@@ -58,11 +58,6 @@ struct user_vfp_exc {
|
|||||||
|
|
||||||
#define user_regs_native(pregs) true
|
#define user_regs_native(pregs) true
|
||||||
|
|
||||||
#define AT_VECTOR_SIZE 40
|
|
||||||
|
|
||||||
typedef uint32_t auxv_t;
|
|
||||||
typedef uint32_t tls_t;
|
|
||||||
|
|
||||||
#define ARCH_SI_TRAP TRAP_BRKPT
|
#define ARCH_SI_TRAP TRAP_BRKPT
|
||||||
|
|
||||||
#define __NR(syscall, compat) __NR_##syscall
|
#define __NR(syscall, compat) __NR_##syscall
|
||||||
|
@@ -78,21 +78,6 @@ typedef struct {
|
|||||||
|
|
||||||
#define user_regs_native(pregs) true
|
#define user_regs_native(pregs) true
|
||||||
|
|
||||||
/*
|
|
||||||
* Copied from the following kernel header files :
|
|
||||||
* include/linux/auxvec.h
|
|
||||||
* arch/powerpc/include/uapi/asm/auxvec.h
|
|
||||||
* include/linux/mm_types.h
|
|
||||||
*/
|
|
||||||
#define AT_VECTOR_SIZE_BASE 20
|
|
||||||
#define AT_VECTOR_SIZE_ARCH 6
|
|
||||||
#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
|
|
||||||
|
|
||||||
typedef uint64_t auxv_t;
|
|
||||||
|
|
||||||
/* Not used but the structure parasite_dump_thread needs a tls_t field */
|
|
||||||
typedef uint64_t tls_t;
|
|
||||||
|
|
||||||
#define ARCH_SI_TRAP TRAP_BRKPT
|
#define ARCH_SI_TRAP TRAP_BRKPT
|
||||||
|
|
||||||
#define __NR(syscall, compat) __NR_##syscall
|
#define __NR(syscall, compat) __NR_##syscall
|
||||||
|
@@ -124,25 +124,14 @@ typedef struct xsave_struct user_fpregs_struct_t;
|
|||||||
#define REG_IP(regs) get_user_reg(®s, ip)
|
#define REG_IP(regs) get_user_reg(®s, ip)
|
||||||
#define REG_SYSCALL_NR(regs) get_user_reg(®s, orig_ax)
|
#define REG_SYSCALL_NR(regs) get_user_reg(®s, orig_ax)
|
||||||
|
|
||||||
typedef uint64_t auxv_t;
|
#define __NR(syscall, compat) ((compat) ? __NR32_##syscall : __NR_##syscall)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linux preserves three TLS segments in GDT.
|
* For x86_32 __NR_mmap inside the kernel represents old_mmap system
|
||||||
* Offsets in GDT differ between 32-bit and 64-bit machines.
|
* call, but since we didn't use it yet lets go further and simply
|
||||||
* For 64-bit x86 those GDT offsets are the same
|
* define own alias for __NR_mmap2 which would allow us to unify code
|
||||||
* for native and compat tasks.
|
* between 32 and 64 bits version.
|
||||||
*/
|
*/
|
||||||
#define GDT_ENTRY_TLS_MIN 12
|
#define __NR32_mmap __NR32_mmap2
|
||||||
#define GDT_ENTRY_TLS_MAX 14
|
|
||||||
#define GDT_ENTRY_TLS_NUM 3
|
|
||||||
typedef struct {
|
|
||||||
user_desc_t desc[GDT_ENTRY_TLS_NUM];
|
|
||||||
} tls_t;
|
|
||||||
|
|
||||||
#define REG_RES(regs) get_user_reg(®s, ax)
|
|
||||||
#define REG_IP(regs) get_user_reg(®s, ip)
|
|
||||||
#define REG_SYSCALL_NR(regs) get_user_reg(®s, orig_ax)
|
|
||||||
|
|
||||||
#define AT_VECTOR_SIZE 44
|
|
||||||
|
|
||||||
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
|
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
|
||||||
|
@@ -25,4 +25,8 @@ typedef UserAarch64RegsEntry UserRegsEntry;
|
|||||||
static inline void *decode_pointer(uint64_t v) { return (void*)v; }
|
static inline void *decode_pointer(uint64_t v) { return (void*)v; }
|
||||||
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
|
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
|
||||||
|
|
||||||
|
#define AT_VECTOR_SIZE 40
|
||||||
|
typedef uint64_t auxv_t;
|
||||||
|
typedef uint64_t tls_t;
|
||||||
|
|
||||||
#endif /* __CR_ASM_TYPES_H__ */
|
#endif /* __CR_ASM_TYPES_H__ */
|
||||||
|
@@ -24,4 +24,8 @@ typedef UserArmRegsEntry UserRegsEntry;
|
|||||||
static inline void *decode_pointer(u64 v) { return (void*)(u32)v; }
|
static inline void *decode_pointer(u64 v) { return (void*)(u32)v; }
|
||||||
static inline u64 encode_pointer(void *p) { return (u32)p; }
|
static inline u64 encode_pointer(void *p) { return (u32)p; }
|
||||||
|
|
||||||
|
#define AT_VECTOR_SIZE 40
|
||||||
|
typedef uint32_t auxv_t;
|
||||||
|
typedef uint32_t tls_t;
|
||||||
|
|
||||||
#endif /* __CR_ASM_TYPES_H__ */
|
#endif /* __CR_ASM_TYPES_H__ */
|
||||||
|
@@ -22,4 +22,19 @@ typedef UserPpc64RegsEntry UserRegsEntry;
|
|||||||
static inline void *decode_pointer(uint64_t v) { return (void*)v; }
|
static inline void *decode_pointer(uint64_t v) { return (void*)v; }
|
||||||
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
|
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copied from the following kernel header files :
|
||||||
|
* include/linux/auxvec.h
|
||||||
|
* arch/powerpc/include/uapi/asm/auxvec.h
|
||||||
|
* include/linux/mm_types.h
|
||||||
|
*/
|
||||||
|
#define AT_VECTOR_SIZE_BASE 20
|
||||||
|
#define AT_VECTOR_SIZE_ARCH 6
|
||||||
|
#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
|
||||||
|
|
||||||
|
typedef uint64_t auxv_t;
|
||||||
|
|
||||||
|
/* Not used but the structure parasite_dump_thread needs a tls_t field */
|
||||||
|
typedef uint64_t tls_t;
|
||||||
|
|
||||||
#endif /* __CR_ASM_TYPES_H__ */
|
#endif /* __CR_ASM_TYPES_H__ */
|
||||||
|
@@ -37,4 +37,20 @@ typedef UserX86RegsEntry UserRegsEntry;
|
|||||||
static inline u64 encode_pointer(void *p) { return (u64)(long)p; }
|
static inline u64 encode_pointer(void *p) { return (u64)(long)p; }
|
||||||
static inline void *decode_pointer(u64 v) { return (void*)(long)v; }
|
static inline void *decode_pointer(u64 v) { return (void*)(long)v; }
|
||||||
|
|
||||||
|
#define AT_VECTOR_SIZE 44
|
||||||
|
typedef uint64_t auxv_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Linux preserves three TLS segments in GDT.
|
||||||
|
* Offsets in GDT differ between 32-bit and 64-bit machines.
|
||||||
|
* For 64-bit x86 those GDT offsets are the same
|
||||||
|
* for native and compat tasks.
|
||||||
|
*/
|
||||||
|
#define GDT_ENTRY_TLS_MIN 12
|
||||||
|
#define GDT_ENTRY_TLS_MAX 14
|
||||||
|
#define GDT_ENTRY_TLS_NUM 3
|
||||||
|
typedef struct {
|
||||||
|
user_desc_t desc[GDT_ENTRY_TLS_NUM];
|
||||||
|
} tls_t;
|
||||||
|
|
||||||
#endif /* __CR_ASM_TYPES_H__ */
|
#endif /* __CR_ASM_TYPES_H__ */
|
||||||
|
Reference in New Issue
Block a user