lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 30 Aug 2010 16:56:34 +0800
From:	Huang Ying <ying.huang@...el.com>
To:	Ingo Molnar <mingo@...e.hu>, hpa@...or.com,
	Andi Kleen <andi@...stfloor.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: What reassert_nmi() in default_do_nmi() is for?

Hi, All,

When reading NMI handler code, I find there is reassert_nmi() in the end
of default_do_nmi(). And it is only called if the reason & 0xc0 != 0
(reason = inb(0x61)).

The comments for it is as follow:

	/*
	 * Reassert NMI in case it became active meanwhile
	 * as it's edge-triggered:
	 */
	reassert_nmi();

The implementation of reassert_nmi is as follow:

static inline void reassert_nmi(void)
{
        int old_reg = -1;

        if (do_i_have_lock_cmos())
                old_reg = current_lock_cmos_reg();
        else
                lock_cmos(0); /* register doesn't matter here */
        outb(0x8f, 0x70);
        inb(0x71);              /* dummy */
        outb(0x0f, 0x70);
        inb(0x71);              /* dummy */
        if (old_reg >= 0)
                outb(old_reg, 0x70);
        else
                unlock_cmos();
}

I can not understand the code and the logic. Can anyone explain it in
more detail?

Thanks,
Huang Ying


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ