Re: [PATCH] [GIT PULL v2] x86: Workaround for NMI iret woes

From: Ingo Molnar
Date: Tue Dec 20 2011 - 05:25:54 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > > + pushq_cfi $repeat_nmi
> > > +
> > > + /* Put stack back */
> > > + addq $(11*8), %rsp
>
> This is where we put the stack back to the original position.
> Is CFI notation really necessary here?

i'd add it if it's not hard or ugly - in theory we could get a
#MC exception in that window.

> > Note that the IRQ return checks are needed because NMI path
> > can set the irq-work TIF. Might be worth putting into the
> > comment - NMIs are not *entirely* passive entities.
>
> The NMI path can set the TIF flags? Then where should they be
> processed. There was an assumption that NMIs shouldn't do
> that. I could have been wrong with that. What work needs to be
> done and when? This is the change that Linus made. If that's
> the case, we need to work something else out.

Hm, you are right, we at most access them (for 32-bit compat
checks for example) but don't modify them - we have switched to
using the special irq work self-IPI.

So the change is fine.

> > Something like nmi_postprocess_retry_preprocess()?
>
> Not sure what would be good, as i386 does the retry, x86_64
> just switches the idt. The two archs do two different things.
> The above name would be confusing as it doesn't match what
> x86_64 does.

Yeah, that assymetry is bothering me too. I guess we can keep it
as-is, no strong feelings. The whole thing *feels* fragile.

Thanks,

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