aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2016-11-08 05:11:02 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-11-11 10:37:43 -0500
commitf8fc82b47149e3449d23e94d6ecf30af2ffcebff (patch)
tree19beaa0abe4854b03a99361dea83853d69b07dd4
parentd5c352cdd022d2c304c6ab19d100631356f2198c (diff)
s390: move system_call field from thread_info to thread_struct
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>
-rw-r--r--arch/s390/include/asm/processor.h2
-rw-r--r--arch/s390/include/asm/thread_info.h1
-rw-r--r--arch/s390/kernel/ptrace.c4
-rw-r--r--arch/s390/kernel/signal.c10
4 files changed, 9 insertions, 8 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 602af692efdc..f96a3711b475 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -115,9 +115,11 @@ struct thread_struct {
115 unsigned int gmap_write_flag; /* gmap fault write indication */ 115 unsigned int gmap_write_flag; /* gmap fault write indication */
116 unsigned int gmap_int_code; /* int code of last gmap fault */ 116 unsigned int gmap_int_code; /* int code of last gmap fault */
117 unsigned int gmap_pfault; /* signal of a pending guest pfault */ 117 unsigned int gmap_pfault; /* signal of a pending guest pfault */
118 /* Per-thread information related to debugging */
118 struct per_regs per_user; /* User specified PER registers */ 119 struct per_regs per_user; /* User specified PER registers */
119 struct per_event per_event; /* Cause of the last PER trap */ 120 struct per_event per_event; /* Cause of the last PER trap */
120 unsigned long per_flags; /* Flags to control debug behavior */ 121 unsigned long per_flags; /* Flags to control debug behavior */
122 unsigned int system_call; /* system call number in signal */
121 /* pfault_wait is used to block the process on a pfault event */ 123 /* pfault_wait is used to block the process on a pfault event */
122 unsigned long pfault_wait; 124 unsigned long pfault_wait;
123 struct list_head list; 125 struct list_head list;
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index ef02b1cae590..7b7a5a15b56c 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -32,7 +32,6 @@
32struct thread_info { 32struct thread_info {
33 unsigned long flags; /* low level flags */ 33 unsigned long flags; /* low level flags */
34 unsigned long sys_call_table; /* System call table address */ 34 unsigned long sys_call_table; /* System call table address */
35 unsigned int system_call;
36 __u64 user_timer; 35 __u64 user_timer;
37 __u64 system_timer; 36 __u64 system_timer;
38 unsigned long last_break; /* last breaking-event-address. */ 37 unsigned long last_break; /* last breaking-event-address. */
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 9336e824e2db..32b791abe38c 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -1113,7 +1113,7 @@ static int s390_system_call_get(struct task_struct *target,
1113 unsigned int pos, unsigned int count, 1113 unsigned int pos, unsigned int count,
1114 void *kbuf, void __user *ubuf) 1114 void *kbuf, void __user *ubuf)
1115{ 1115{
1116 unsigned int *data = &task_thread_info(target)->system_call; 1116 unsigned int *data = &target->thread.system_call;
1117 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 1117 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
1118 data, 0, sizeof(unsigned int)); 1118 data, 0, sizeof(unsigned int));
1119} 1119}
@@ -1123,7 +1123,7 @@ static int s390_system_call_set(struct task_struct *target,
1123 unsigned int pos, unsigned int count, 1123 unsigned int pos, unsigned int count,
1124 const void *kbuf, const void __user *ubuf) 1124 const void *kbuf, const void __user *ubuf)
1125{ 1125{
1126 unsigned int *data = &task_thread_info(target)->system_call; 1126 unsigned int *data = &target->thread.system_call;
1127 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 1127 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
1128 data, 0, sizeof(unsigned int)); 1128 data, 0, sizeof(unsigned int));
1129} 1129}
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index d82562cf0a0e..8c6fba710acf 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -467,13 +467,13 @@ void do_signal(struct pt_regs *regs)
467 * the debugger may change all our registers, including the system 467 * the debugger may change all our registers, including the system
468 * call information. 468 * call information.
469 */ 469 */
470 current_thread_info()->system_call = 470 current->thread.system_call =
471 test_pt_regs_flag(regs, PIF_SYSCALL) ? regs->int_code : 0; 471 test_pt_regs_flag(regs, PIF_SYSCALL) ? regs->int_code : 0;
472 472
473 if (get_signal(&ksig)) { 473 if (get_signal(&ksig)) {
474 /* Whee! Actually deliver the signal. */ 474 /* Whee! Actually deliver the signal. */
475 if (current_thread_info()->system_call) { 475 if (current->thread.system_call) {
476 regs->int_code = current_thread_info()->system_call; 476 regs->int_code = current->thread.system_call;
477 /* Check for system call restarting. */ 477 /* Check for system call restarting. */
478 switch (regs->gprs[2]) { 478 switch (regs->gprs[2]) {
479 case -ERESTART_RESTARTBLOCK: 479 case -ERESTART_RESTARTBLOCK:
@@ -506,8 +506,8 @@ void do_signal(struct pt_regs *regs)
506 506
507 /* No handlers present - check for system call restart */ 507 /* No handlers present - check for system call restart */
508 clear_pt_regs_flag(regs, PIF_SYSCALL); 508 clear_pt_regs_flag(regs, PIF_SYSCALL);
509 if (current_thread_info()->system_call) { 509 if (current->thread.system_call) {
510 regs->int_code = current_thread_info()->system_call; 510 regs->int_code = current->thread.system_call;
511 switch (regs->gprs[2]) { 511 switch (regs->gprs[2]) {
512 case -ERESTART_RESTARTBLOCK: 512 case -ERESTART_RESTARTBLOCK:
513 /* Restart with sys_restart_syscall */ 513 /* Restart with sys_restart_syscall */