Re: [PATCH] x86 page fault handler not interrupt safe

From: Brian Gerst (bgerst@didntduck.org)
Date: Mon May 07 2001 - 17:10:03 EST


Linus Torvalds wrote:
>
> On Mon, 7 May 2001, Brian Gerst wrote:
> >
> > Keep in mind that regs->eflags could be from user space, and could have
> > some undesirable flags set. That's why I did a test/sti instead of
> > reloading eflags. Plus my patch leaves interrupts disabled for the
> > minimum time possible.
>
> The plain "popf" should be ok: the way intel works, you cannot actually
> use popf to set any of the strange flags (if vm86 mode etc).

TF (trap flag) would be one that I wouldn't want to get reset. You
could use
        local_irq_restore(regs->eflags & ~(TF|RF|VM|NT))
which are all the flags cleared by an interrupt/trap gate. Or
        if (regs->eflags & IF) sti();
Take your pick.

--

Brian Gerst - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:26 EST