Re: NMI vs #PF clash

From: Steven Rostedt
Date: Tue May 22 2012 - 10:50:29 EST


On Tue, 2012-05-22 at 17:37 +0300, Avi Kivity wrote:
> >
> >
> > Is reading it fast? Then we could do a two reads and only write when
> > needed.
>
> The upside is 70 cycles on one machine, see d3edefc0035669.

Thanks

>
>
> >
> > Something like this pseudo assembly
> >
> > mov cr2, rax
> > push rax
> >
> > call do_nmi
> >
> > pop rax
> > mov cr2, rbx
> > cmp rax, rbx
> > be skip
> > mov rax, cr2
> > skip:
> >
>
>
> Yes, provided no exceptions can happen at those points.

Yes, exceptions can only happen in the do_nmi area. There should not be
any breakpoints or page faults in the assembly code of the NMI handler.

Now another NMI may come in at any point here, but it will detect that
it is nested and return without doing anything (but telling this NMI to
repeat itself).

-- Steve


--
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/