s390: move system_call field from thread_info to thread_struct
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 8 Nov 2016 10:11:02 +0000 (11:11 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 11 Nov 2016 15:37:43 +0000 (16:37 +0100)
The system_call field in thread_info structure is used by the signal
code to store the number of the current system call while the debugger
interacts with its inferior. A better location for the system_call
field is with the other debugger related information in the
thread_struct.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/processor.h
arch/s390/include/asm/thread_info.h
arch/s390/kernel/ptrace.c
arch/s390/kernel/signal.c

index 602af692efdc1b5273e466b474dbf1a6c7e25922..f96a3711b475cadde8089937f571a183c29594fe 100644 (file)
@@ -115,9 +115,11 @@ struct thread_struct {
        unsigned int gmap_write_flag;   /* gmap fault write indication */
        unsigned int gmap_int_code;     /* int code of last gmap fault */
        unsigned int gmap_pfault;       /* signal of a pending guest pfault */
+       /* Per-thread information related to debugging */
        struct per_regs per_user;       /* User specified PER registers */
        struct per_event per_event;     /* Cause of the last PER trap */
        unsigned long per_flags;        /* Flags to control debug behavior */
+       unsigned int system_call;       /* system call number in signal */
         /* pfault_wait is used to block the process on a pfault event */
        unsigned long pfault_wait;
        struct list_head list;
index ef02b1cae5900c62ad5bf5250d87b12ca856f3c8..7b7a5a15b56c26452b7127164768368573be6d72 100644 (file)
@@ -32,7 +32,6 @@
 struct thread_info {
        unsigned long           flags;          /* low level flags */
        unsigned long           sys_call_table; /* System call table address */
-       unsigned int            system_call;
        __u64                   user_timer;
        __u64                   system_timer;
        unsigned long           last_break;     /* last breaking-event-address. */
index 9336e824e2db5e119810b438c8c0e272487937b4..32b791abe38cad6d4932a61a1550284d5aae35e5 100644 (file)
@@ -1113,7 +1113,7 @@ static int s390_system_call_get(struct task_struct *target,
                                unsigned int pos, unsigned int count,
                                void *kbuf, void __user *ubuf)
 {
-       unsigned int *data = &task_thread_info(target)->system_call;
+       unsigned int *data = &target->thread.system_call;
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
                                   data, 0, sizeof(unsigned int));
 }
@@ -1123,7 +1123,7 @@ static int s390_system_call_set(struct task_struct *target,
                                unsigned int pos, unsigned int count,
                                const void *kbuf, const void __user *ubuf)
 {
-       unsigned int *data = &task_thread_info(target)->system_call;
+       unsigned int *data = &target->thread.system_call;
        return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
                                  data, 0, sizeof(unsigned int));
 }
index d82562cf0a0e1f5057987f59f6d541ea374ea683..8c6fba710acfce3da81bd46291add354c243a4ef 100644 (file)
@@ -467,13 +467,13 @@ void do_signal(struct pt_regs *regs)
         * the debugger may change all our registers, including the system
         * call information.
         */
-       current_thread_info()->system_call =
+       current->thread.system_call =
                test_pt_regs_flag(regs, PIF_SYSCALL) ? regs->int_code : 0;
 
        if (get_signal(&ksig)) {
                /* Whee!  Actually deliver the signal.  */
-               if (current_thread_info()->system_call) {
-                       regs->int_code = current_thread_info()->system_call;
+               if (current->thread.system_call) {
+                       regs->int_code = current->thread.system_call;
                        /* Check for system call restarting. */
                        switch (regs->gprs[2]) {
                        case -ERESTART_RESTARTBLOCK:
@@ -506,8 +506,8 @@ void do_signal(struct pt_regs *regs)
 
        /* No handlers present - check for system call restart */
        clear_pt_regs_flag(regs, PIF_SYSCALL);
-       if (current_thread_info()->system_call) {
-               regs->int_code = current_thread_info()->system_call;
+       if (current->thread.system_call) {
+               regs->int_code = current->thread.system_call;
                switch (regs->gprs[2]) {
                case -ERESTART_RESTARTBLOCK:
                        /* Restart with sys_restart_syscall */