Skip to contentSkip to conversation

i386: remove IOPL check on task switch

PATCH In review Chuck Ebbert 3 participants 3 messages Nov 3, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386: remove IOPL check on task switch

IOPL is implicitly saved and restored on task switch, so explicit check is no longer needed.

arch/i386/kernel/process.c +0 -6
@@ -681,12 +681,6 @@ struct task_struct fastcall * __switch_t
 		loadsegment(gs, next->gs);
 
 	/*
-	 * Restore IOPL if needed.
-	 */
-	if (unlikely(prev->iopl != next->iopl))
-		set_iopl_mask(next->iopl);
-
-	/*
 	 * Now maybe handle debug registers and/or IO bitmaps
 	 */
 	if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)
Signature · 2 lines
Chuck
"Even supernovas have their duller moments."
#1 lore raw
Quoted 11 lines · Chuck Ebbert

IOPL is implicitly saved and restored on task switch, so explicit check is no longer needed.

arch/i386/kernel/process.c +0 -0
@@ -681,12 +681,6 @@ struct task_struct fastcall * __switch_t
 		loadsegment(gs, next->gs);
 

arch/i386/kernel/process.c struct task_struct fastcall * __switch_t · line 686

Quoted 10 lines
arch/i386/kernel/process.c +0 -6
 	/*
-	 * Restore IOPL if needed.
-	 */
-	if (unlikely(prev->iopl != next->iopl))
-		set_iopl_mask(next->iopl);
-
-	/*
 	 * Now maybe handle debug registers and/or IO bitmaps
 	 */
 	if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)

Nack. This is used for paravirt-ops kernels that use IOPL'd userspace. Fixing it would require a fairly heavy penalty on the iret path, since every single instruction there contributes to a critical region which must have custom fixup code, or some other technique to provide protection against interrupt re-entrancy.

At least, let's discuss other potential solutions first - for now it is harmless.

Zach

#2 lore raw
Quoted 9 lines

Nack. This is used for paravirt-ops kernels that use IOPL'd userspace. Fixing it would require a fairly heavy penalty on the iret path, since every single instruction there contributes to a critical region which must have custom fixup code, or some other technique to provide protection against interrupt re-entrancy.

At least, let's discuss other potential solutions first - for now it is harmless.

Ok I will drop the patch again

-Andi