[PATCH] i386: task_thread_info()

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 06b425d8 57eafdc2

+7 -7
+2 -2
arch/i386/kernel/process.c
··· 601 * gcc should eliminate the ->thread_info dereference if 602 * has_secure_computing returns 0 at compile time (SECCOMP=n). 603 */ 604 - prev = prev_p->thread_info; 605 - next = next_p->thread_info; 606 607 if (has_secure_computing(prev) || has_secure_computing(next)) { 608 /* slow path here */
··· 601 * gcc should eliminate the ->thread_info dereference if 602 * has_secure_computing returns 0 at compile time (SECCOMP=n). 603 */ 604 + prev = task_thread_info(prev_p); 605 + next = task_thread_info(next_p); 606 607 if (has_secure_computing(prev) || has_secure_computing(next)) { 608 /* slow path here */
+1 -1
arch/i386/kernel/vm86.c
··· 311 "movl %1,%%ebp\n\t" 312 "jmp resume_userspace" 313 : /* no outputs */ 314 - :"r" (&info->regs), "r" (tsk->thread_info) : "ax"); 315 /* we never return here */ 316 } 317
··· 311 "movl %1,%%ebp\n\t" 312 "jmp resume_userspace" 313 : /* no outputs */ 314 + :"r" (&info->regs), "r" (task_thread_info(tsk)) : "ax"); 315 /* we never return here */ 316 } 317
+4 -4
include/asm-i386/i387.h
··· 49 X86_FEATURE_FXSR, 50 "m" (tsk->thread.i387.fxsave) 51 :"memory"); 52 - tsk->thread_info->status &= ~TS_USEDFPU; 53 } 54 55 #define __unlazy_fpu( tsk ) do { \ 56 - if ((tsk)->thread_info->status & TS_USEDFPU) \ 57 save_init_fpu( tsk ); \ 58 } while (0) 59 60 #define __clear_fpu( tsk ) \ 61 do { \ 62 - if ((tsk)->thread_info->status & TS_USEDFPU) { \ 63 asm volatile("fnclex ; fwait"); \ 64 - (tsk)->thread_info->status &= ~TS_USEDFPU; \ 65 stts(); \ 66 } \ 67 } while (0)
··· 49 X86_FEATURE_FXSR, 50 "m" (tsk->thread.i387.fxsave) 51 :"memory"); 52 + task_thread_info(tsk)->status &= ~TS_USEDFPU; 53 } 54 55 #define __unlazy_fpu( tsk ) do { \ 56 + if (task_thread_info(tsk)->status & TS_USEDFPU) \ 57 save_init_fpu( tsk ); \ 58 } while (0) 59 60 #define __clear_fpu( tsk ) \ 61 do { \ 62 + if (task_thread_info(tsk)->status & TS_USEDFPU) { \ 63 asm volatile("fnclex ; fwait"); \ 64 + task_thread_info(tsk)->status &= ~TS_USEDFPU; \ 65 stts(); \ 66 } \ 67 } while (0)