aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 3d9ea531ddd1..ca6f7ab8df33 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -51,8 +51,6 @@
51#include <asm/syscalls.h> 51#include <asm/syscalls.h>
52#include <asm/debugreg.h> 52#include <asm/debugreg.h>
53 53
54#include <trace/events/power.h>
55
56asmlinkage extern void ret_from_fork(void); 54asmlinkage extern void ret_from_fork(void);
57 55
58DEFINE_PER_CPU(unsigned long, old_rsp); 56DEFINE_PER_CPU(unsigned long, old_rsp);
@@ -141,8 +139,6 @@ void cpu_idle(void)
141 pm_idle(); 139 pm_idle();
142 start_critical_timings(); 140 start_critical_timings();
143 141
144 trace_power_end(smp_processor_id());
145
146 /* In many cases the interrupt that ended idle 142 /* In many cases the interrupt that ended idle
147 has already called exit_idle. But some idle 143 has already called exit_idle. But some idle
148 loops can be woken up without interrupt. */ 144 loops can be woken up without interrupt. */
@@ -342,7 +338,6 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
342 regs->cs = _cs; 338 regs->cs = _cs;
343 regs->ss = _ss; 339 regs->ss = _ss;
344 regs->flags = X86_EFLAGS_IF; 340 regs->flags = X86_EFLAGS_IF;
345 set_fs(USER_DS);
346 /* 341 /*
347 * Free the old FP and other extended state 342 * Free the old FP and other extended state
348 */ 343 */
@@ -424,7 +419,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
424 load_TLS(next, cpu); 419 load_TLS(next, cpu);
425 420
426 /* Must be after DS reload */ 421 /* Must be after DS reload */
427 unlazy_fpu(prev_p); 422 __unlazy_fpu(prev_p);
428 423
429 /* Make sure cpu is ready for new context */ 424 /* Make sure cpu is ready for new context */
430 if (preload_fpu) 425 if (preload_fpu)
@@ -505,6 +500,10 @@ void set_personality_64bit(void)
505 /* Make sure to be in 64bit mode */ 500 /* Make sure to be in 64bit mode */
506 clear_thread_flag(TIF_IA32); 501 clear_thread_flag(TIF_IA32);
507 502
503 /* Ensure the corresponding mm is not marked. */
504 if (current->mm)
505 current->mm->context.ia32_compat = 0;
506
508 /* TBD: overwrites user setup. Should have two bits. 507 /* TBD: overwrites user setup. Should have two bits.
509 But 64bit processes have always behaved this way, 508 But 64bit processes have always behaved this way,
510 so it's not too bad. The main problem is just that 509 so it's not too bad. The main problem is just that
@@ -520,6 +519,10 @@ void set_personality_ia32(void)
520 set_thread_flag(TIF_IA32); 519 set_thread_flag(TIF_IA32);
521 current->personality |= force_personality32; 520 current->personality |= force_personality32;
522 521
522 /* Mark the associated mm as containing 32-bit tasks. */
523 if (current->mm)
524 current->mm->context.ia32_compat = 1;
525
523 /* Prepare the first "return" to user space */ 526 /* Prepare the first "return" to user space */
524 current_thread_info()->status |= TS_COMPAT; 527 current_thread_info()->status |= TS_COMPAT;
525} 528}