aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-02 14:12:06 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-20 09:50:17 -0400
commite76623d69408d0bd66a296c6ee5eae1b17a6adfc (patch)
tree91011050463a05f2950ccf12a1c2a7287bbae1a5 /arch/x86
parentc46de2263f42fb4bbde411b9126f471e9343cb22 (diff)
x86: get rid of TIF_IRET hackery
TIF_NOTIFY_RESUME will work in precisely the same way; all that is achieved by TIF_IRET is appearing that there's some work to be done, so we end up on the iret exit path. Just use NOTIFY_RESUME. And for execve() do that in 32bit start_thread(), not sys_execve() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/x86/kernel/process.c8
-rw-r--r--arch/x86/kernel/process_32.c5
-rw-r--r--arch/x86/kernel/signal.c4
-rw-r--r--arch/x86/kernel/vm86_32.c6
5 files changed, 8 insertions, 17 deletions
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 89f794f007ec..c509d07bdbd7 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -79,7 +79,6 @@ struct thread_info {
79#define TIF_SIGPENDING 2 /* signal pending */ 79#define TIF_SIGPENDING 2 /* signal pending */
80#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 80#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
81#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ 81#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/
82#define TIF_IRET 5 /* force IRET */
83#define TIF_SYSCALL_EMU 6 /* syscall emulation active */ 82#define TIF_SYSCALL_EMU 6 /* syscall emulation active */
84#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 83#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
85#define TIF_SECCOMP 8 /* secure computing */ 84#define TIF_SECCOMP 8 /* secure computing */
@@ -104,7 +103,6 @@ struct thread_info {
104#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 103#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
105#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 104#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
106#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 105#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
107#define _TIF_IRET (1 << TIF_IRET)
108#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) 106#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
109#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 107#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
110#define _TIF_SECCOMP (1 << TIF_SECCOMP) 108#define _TIF_SECCOMP (1 << TIF_SECCOMP)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index ef6a8456f719..7162e9c1f598 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -351,14 +351,6 @@ long sys_execve(const char __user *name,
351 if (IS_ERR(filename)) 351 if (IS_ERR(filename))
352 return error; 352 return error;
353 error = do_execve(filename, argv, envp, regs); 353 error = do_execve(filename, argv, envp, regs);
354
355#ifdef CONFIG_X86_32
356 if (error == 0) {
357 /* Make sure we don't return using sysenter.. */
358 set_thread_flag(TIF_IRET);
359 }
360#endif
361
362 putname(filename); 354 putname(filename);
363 return error; 355 return error;
364} 356}
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 516fa186121b..75fcad146def 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -194,6 +194,11 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
194 * Free the old FP and other extended state 194 * Free the old FP and other extended state
195 */ 195 */
196 free_thread_xstate(current); 196 free_thread_xstate(current);
197 /*
198 * force it to the iret return path by making it look as if there was
199 * some work pending.
200 */
201 set_thread_flag(TIF_NOTIFY_RESUME);
197} 202}
198EXPORT_SYMBOL_GPL(start_thread); 203EXPORT_SYMBOL_GPL(start_thread);
199 204
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index b280908a376e..c648fc529872 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -800,10 +800,6 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
800 } 800 }
801 if (thread_info_flags & _TIF_USER_RETURN_NOTIFY) 801 if (thread_info_flags & _TIF_USER_RETURN_NOTIFY)
802 fire_user_return_notifiers(); 802 fire_user_return_notifiers();
803
804#ifdef CONFIG_X86_32
805 clear_thread_flag(TIF_IRET);
806#endif /* CONFIG_X86_32 */
807} 803}
808 804
809void signal_fault(struct pt_regs *regs, void __user *frame, char *where) 805void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 54abcc0baf23..5c9687b1bde6 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -561,9 +561,9 @@ int handle_vm86_trap(struct kernel_vm86_regs *regs, long error_code, int trapno)
561 if ((trapno == 3) || (trapno == 1)) { 561 if ((trapno == 3) || (trapno == 1)) {
562 KVM86->regs32->ax = VM86_TRAP + (trapno << 8); 562 KVM86->regs32->ax = VM86_TRAP + (trapno << 8);
563 /* setting this flag forces the code in entry_32.S to 563 /* setting this flag forces the code in entry_32.S to
564 call save_v86_state() and change the stack pointer 564 the path where we call save_v86_state() and change
565 to KVM86->regs32 */ 565 the stack pointer to KVM86->regs32 */
566 set_thread_flag(TIF_IRET); 566 set_thread_flag(TIF_NOTIFY_RESUME);
567 return 0; 567 return 0;
568 } 568 }
569 do_int(regs, trapno, (unsigned char __user *) (regs->pt.ss << 4), SP(regs)); 569 do_int(regs, trapno, (unsigned char __user *) (regs->pt.ss << 4), SP(regs));