Re: [discuss] Re: [Perfctr-devel] Re: Enabling RDPMC in user space by default

Andi Kleen
2005-12-02T00:07:42Z

On Thu, Dec 01, 2005 at 03:41:50PM -0800, Stephane Eranian wrote:
> On Wed, Nov 30, 2005 at 05:23:15PM +0100, Andi Kleen wrote:
> > > to count elapsed cycles while executing a ring 0 and ring 3. The watchdog
> > > works by polling on the counter and after a certain delta is reached it
> > > triggers an NMI interrupt which, in turn, causes a kernel crash and the
> > > (bug) report. Is that the correct behavior?
> >
> > The watchdog is driven by the performance counter (this means
> > it has varying frequency, but that's not a big issue for the watchdog)
> >
> > It underflows every second in the fastest case or very slowly
> > (if the machine is idle). Every time it underflows it checks if
> > the per CPU timer has been ticking, and if it hasn't for some time
> > it triggers an oops.
>
> How is the checking for underflows done? Polling?

There is a bit in the perfctr MSRs to cause an interrupt if it underflows.
That is programmed to be an NMI.

-Andi