Skip to content

Commit

Permalink
x86-64: move unlazy_fpu() into lazy cpu state part of context switch
Browse files Browse the repository at this point in the history
Make sure that unlazy_fpu()'s stts gets batched along with the other
cpu state changes during context switch.  (32-bit already does this.)

This makes sure it gets batched when running paravirtualized.

[ Impact: optimise paravirtual FPU context switch ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Jeremy Fitzhardinge committed Jun 17, 2009
1 parent 2fcddce commit 16d9dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)

load_TLS(next, cpu);

/* Must be after DS reload */
unlazy_fpu(prev_p);

/*
* Leave lazy mode, flushing any hypercalls made here.
* This must be done before restoring TLS segments so
Expand Down Expand Up @@ -459,9 +462,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
wrmsrl(MSR_KERNEL_GS_BASE, next->gs);
prev->gsindex = gsindex;

/* Must be after DS reload */
unlazy_fpu(prev_p);

/*
* Switch the PDA and FPU contexts.
*/
Expand Down

0 comments on commit 16d9dbf

Please sign in to comment.