arm64: compat: Expose signal related structures
authorVincenzo Frascino <vincenzo.frascino@arm.com>
Fri, 21 Jun 2019 09:52:34 +0000 (10:52 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 22 Jun 2019 19:21:07 +0000 (21:21 +0200)
The compat signal data structures are required as part of the compat
vDSO implementation in order to provide the unwinding information for
the sigreturn trampolines.

Expose these data structures as part of signal32.h.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Shijith Thotton <sthotton@marvell.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Mark Salyzyn <salyzyn@android.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Huw Davies <huw@codeweavers.com>
Link: https://lkml.kernel.org/r/20190621095252.32307-8-vincenzo.frascino@arm.com
arch/arm64/include/asm/signal32.h
arch/arm64/kernel/signal32.c

index 0418c67..bd43d1c 100644 (file)
@@ -9,6 +9,52 @@
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 
+struct compat_sigcontext {
+       /* We always set these two fields to 0 */
+       compat_ulong_t                  trap_no;
+       compat_ulong_t                  error_code;
+
+       compat_ulong_t                  oldmask;
+       compat_ulong_t                  arm_r0;
+       compat_ulong_t                  arm_r1;
+       compat_ulong_t                  arm_r2;
+       compat_ulong_t                  arm_r3;
+       compat_ulong_t                  arm_r4;
+       compat_ulong_t                  arm_r5;
+       compat_ulong_t                  arm_r6;
+       compat_ulong_t                  arm_r7;
+       compat_ulong_t                  arm_r8;
+       compat_ulong_t                  arm_r9;
+       compat_ulong_t                  arm_r10;
+       compat_ulong_t                  arm_fp;
+       compat_ulong_t                  arm_ip;
+       compat_ulong_t                  arm_sp;
+       compat_ulong_t                  arm_lr;
+       compat_ulong_t                  arm_pc;
+       compat_ulong_t                  arm_cpsr;
+       compat_ulong_t                  fault_address;
+};
+
+struct compat_ucontext {
+       compat_ulong_t                  uc_flags;
+       compat_uptr_t                   uc_link;
+       compat_stack_t                  uc_stack;
+       struct compat_sigcontext        uc_mcontext;
+       compat_sigset_t                 uc_sigmask;
+       int                             __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))];
+       compat_ulong_t                  uc_regspace[128] __attribute__((__aligned__(8)));
+};
+
+struct compat_sigframe {
+       struct compat_ucontext  uc;
+       compat_ulong_t          retcode[2];
+};
+
+struct compat_rt_sigframe {
+       struct compat_siginfo info;
+       struct compat_sigframe sig;
+};
+
 int compat_setup_frame(int usig, struct ksignal *ksig, sigset_t *set,
                       struct pt_regs *regs);
 int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
index 331d1e5..8a9a5ce 100644 (file)
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
 
-struct compat_sigcontext {
-       /* We always set these two fields to 0 */
-       compat_ulong_t                  trap_no;
-       compat_ulong_t                  error_code;
-
-       compat_ulong_t                  oldmask;
-       compat_ulong_t                  arm_r0;
-       compat_ulong_t                  arm_r1;
-       compat_ulong_t                  arm_r2;
-       compat_ulong_t                  arm_r3;
-       compat_ulong_t                  arm_r4;
-       compat_ulong_t                  arm_r5;
-       compat_ulong_t                  arm_r6;
-       compat_ulong_t                  arm_r7;
-       compat_ulong_t                  arm_r8;
-       compat_ulong_t                  arm_r9;
-       compat_ulong_t                  arm_r10;
-       compat_ulong_t                  arm_fp;
-       compat_ulong_t                  arm_ip;
-       compat_ulong_t                  arm_sp;
-       compat_ulong_t                  arm_lr;
-       compat_ulong_t                  arm_pc;
-       compat_ulong_t                  arm_cpsr;
-       compat_ulong_t                  fault_address;
-};
-
-struct compat_ucontext {
-       compat_ulong_t                  uc_flags;
-       compat_uptr_t                   uc_link;
-       compat_stack_t                  uc_stack;
-       struct compat_sigcontext        uc_mcontext;
-       compat_sigset_t                 uc_sigmask;
-       int             __unused[32 - (sizeof (compat_sigset_t) / sizeof (int))];
-       compat_ulong_t  uc_regspace[128] __attribute__((__aligned__(8)));
-};
-
 struct compat_vfp_sigframe {
        compat_ulong_t  magic;
        compat_ulong_t  size;
@@ -81,16 +45,6 @@ struct compat_aux_sigframe {
        unsigned long                   end_magic;
 } __attribute__((__aligned__(8)));
 
-struct compat_sigframe {
-       struct compat_ucontext  uc;
-       compat_ulong_t          retcode[2];
-};
-
-struct compat_rt_sigframe {
-       struct compat_siginfo info;
-       struct compat_sigframe sig;
-};
-
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)