aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/process.c
diff options
context:
space:
mode:
authorZachary Amsden <zach@vmware.com>2007-02-13 07:26:21 -0500
committerAndi Kleen <andi@basil.nowhere.org>2007-02-13 07:26:21 -0500
commit8b15114434998a78aa50f8559d69c7a400cff267 (patch)
tree2385fd562d0f625baaf32e75dd7dbedc966e9635 /arch/i386/kernel/process.c
parent9226d125d94c7e4964dd41cc5e9ca2ff84091d01 (diff)
[PATCH] i386: iOPL handling for paravirt guests
I found a clever way to make the extra IOPL switching invisible to non-paravirt compiles - since kernel_rpl is statically defined to be zero there, and only non-zero rpl kernel have a problem restoring IOPL, as popf does not restore IOPL flags unless run at CPL-0. Signed-off-by: Zachary Amsden <zach@vmware.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/i386/kernel/process.c')
-rw-r--r--arch/i386/kernel/process.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index cfae587bf7d2..05be77413351 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -670,6 +670,15 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
670 load_TLS(next, cpu); 670 load_TLS(next, cpu);
671 671
672 /* 672 /*
673 * Restore IOPL if needed. In normal use, the flags restore
674 * in the switch assembly will handle this. But if the kernel
675 * is running virtualized at a non-zero CPL, the popf will
676 * not restore flags, so it must be done in a separate step.
677 */
678 if (get_kernel_rpl() && unlikely(prev->iopl != next->iopl))
679 set_iopl_mask(next->iopl);
680
681 /*
673 * Now maybe handle debug registers and/or IO bitmaps 682 * Now maybe handle debug registers and/or IO bitmaps
674 */ 683 */
675 if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW) 684 if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)