[PATCH] s390: task_stack_page()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds 30af7120 c7584fb6

+8 -9
+4 -5
arch/s390/kernel/process.c
··· 153 { 154 struct task_struct *tsk = current; 155 156 - printk("CPU: %d %s\n", tsk->thread_info->cpu, print_tainted()); 157 printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 158 current->comm, current->pid, (void *) tsk, 159 (void *) tsk->thread.ksp); ··· 357 unsigned long return_address; 358 int count; 359 360 - if (!p || p == current || p->state == TASK_RUNNING || !p->thread_info) 361 return 0; 362 - low = (struct stack_frame *) p->thread_info; 363 - high = (struct stack_frame *) 364 - ((unsigned long) p->thread_info + THREAD_SIZE) - 1; 365 sf = (struct stack_frame *) (p->thread.ksp & PSW_ADDR_INSN); 366 if (sf <= low || sf > high) 367 return 0;
··· 153 { 154 struct task_struct *tsk = current; 155 156 + printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); 157 printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 158 current->comm, current->pid, (void *) tsk, 159 (void *) tsk->thread.ksp); ··· 357 unsigned long return_address; 358 int count; 359 360 + if (!p || p == current || p->state == TASK_RUNNING || !task_stack_page(p)) 361 return 0; 362 + low = task_stack_page(p); 363 + high = (struct stack_frame *) task_pt_regs(p); 364 sf = (struct stack_frame *) (p->thread.ksp & PSW_ADDR_INSN); 365 if (sf <= low || sf > high) 366 return 0;
+1 -1
arch/s390/kernel/smp.c
··· 657 idle = current_set[cpu]; 658 cpu_lowcore = lowcore_ptr[cpu]; 659 cpu_lowcore->kernel_stack = (unsigned long) 660 - idle->thread_info + (THREAD_SIZE); 661 sf = (struct stack_frame *) (cpu_lowcore->kernel_stack 662 - sizeof(struct pt_regs) 663 - sizeof(struct stack_frame));
··· 657 idle = current_set[cpu]; 658 cpu_lowcore = lowcore_ptr[cpu]; 659 cpu_lowcore->kernel_stack = (unsigned long) 660 + task_stack_page(idle) + (THREAD_SIZE); 661 sf = (struct stack_frame *) (cpu_lowcore->kernel_stack 662 - sizeof(struct pt_regs) 663 - sizeof(struct stack_frame));
+2 -2
arch/s390/kernel/traps.c
··· 136 sp = __show_trace(sp, S390_lowcore.async_stack - ASYNC_SIZE, 137 S390_lowcore.async_stack); 138 if (task) 139 - __show_trace(sp, (unsigned long) task->thread_info, 140 - (unsigned long) task->thread_info + THREAD_SIZE); 141 else 142 __show_trace(sp, S390_lowcore.thread_info, 143 S390_lowcore.thread_info + THREAD_SIZE);
··· 136 sp = __show_trace(sp, S390_lowcore.async_stack - ASYNC_SIZE, 137 S390_lowcore.async_stack); 138 if (task) 139 + __show_trace(sp, (unsigned long) task_stack_page(task), 140 + (unsigned long) task_stack_page(task) + THREAD_SIZE); 141 else 142 __show_trace(sp, S390_lowcore.thread_info, 143 S390_lowcore.thread_info + THREAD_SIZE);
+1 -1
include/asm-s390/processor.h
··· 192 193 unsigned long get_wchan(struct task_struct *p); 194 #define task_pt_regs(tsk) ((struct pt_regs *) \ 195 - ((void *)(tsk)->thread_info + THREAD_SIZE) - 1) 196 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) 197 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) 198
··· 192 193 unsigned long get_wchan(struct task_struct *p); 194 #define task_pt_regs(tsk) ((struct pt_regs *) \ 195 + (task_stack_page(tsk) + THREAD_SIZE) - 1) 196 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) 197 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) 198