Re: [patch] i386: remove IOPL check on task switch

Zachary Amsden
2006-11-03T18:06:08Z

Chuck Ebbert wrote:
> IOPL is implicitly saved and restored on task switch,
> so explicit check is no longer needed.
>
> Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
>
> --- 2.6.19-rc4-32smp.orig/arch/i386/kernel/process.c
> +++ 2.6.19-rc4-32smp/arch/i386/kernel/process.c
> @@ -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)
>

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