Re: nmi_watchdog suspicious

From: Maciej W. Rozycki
Date: Sun Jun 15 2008 - 19:50:11 EST


On Tue, 10 Jun 2008, Cyrill Gorcunov wrote:

> On 64bit mode nmi_watchdog=NMI_NONE by default (in case if APIC enabled).
> On 32bit mode nmi_watchdog=NMI_DEFAULT was by default (in any case,
> but could be set to NMI_NONE in check_timer(), but we don't take
> this case now).

I haven't tracked the 64-bit port, but for plain i386 the watchdog used
to be on by default, then proved problematic with too many broken pieces
of equipment (typically because of bugs in the SMM firmware) and thus set
to off.

> So lets take a look on touch_nmi_watchdog().
> There is the condition
>
> if (nmi_watchdog > 0)
> ...tell to reset counters in nmi_watchdog_tick()
>
> this condition is not taken on 64bit mode, but *was* taken on
> 32bit mode by default! So who was right then? 64bit version or 32bit?
>
> Maciej, could you take a look please? Maybe I just missing figure
> in general - ie how nmi_watchdog _should_ work.

Well, values >= NMI_INVALID are never used, so the condition is correct.
It is meant to be positive whenever a working watchdog has been selected.
Obviously nmi_watchdog should be a signed int though, so there is a bug
there. You better audit all the uses of the variable...

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