i'd much rather attack this general problem from this angle:
static inline unsigned char get_nmi_reason(void)
{
return inb(0x61);
}
that port 61H read is both arcane (on modern chipsets) and broken on
multiple levels. It's racy and SMP unsafe to begin with, if there's any
mixture of intentional cross-CPU or CPU self-generated NMIs mixed with
chipset generated NMIs.
One possible approach would be to get rid of it, and to perhaps register
a low-priority die notifier on systems where we know port 61
reads+writes to be safe and desired. Modern systems will emit MCEs in
most cases anyway, not NMIs.
Ingo
--