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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Sep 2011 09:00:27 -0400
From:	Don Zickus <dzickus@...hat.com>
To:	Avi Kivity <avi@...hat.com>
Cc:	x86@...nel.org, Andi Kleen <andi@...stfloor.org>,
	Robert Richter <robert.richter@....com>,
	Peter Zijlstra <peterz@...radead.org>, ying.huang@...el.com,
	LKML <linux-kernel@...r.kernel.org>, paulmck@...ux.vnet.ibm.com,
	jeremy@...p.org
Subject: Re: [V4][PATCH 4/6] x86, nmi:  add in logic to handle multiple
 events and unknown NMIs

On Wed, Sep 14, 2011 at 10:08:13AM +0300, Avi Kivity wrote:
> On 09/13/2011 11:58 PM, Don Zickus wrote:
> >Previous patches allow the NMI subsystem to process multipe NMI events
> >in one NMI.  As previously discussed this can cause issues when an event
> >triggered another NMI but is processed in the current NMI.  This causes the
> >next NMI to go unprocessed and become an 'unknown' NMI.
> >
> >To handle this, we first have to flag whether or not the NMI handler handled
> >more than one event or not.  If it did, then there exists a chance that
> >the next NMI might be already processed.  Once the NMI is flagged as a
> >candidate to be swallowed, we next look for a back-to-back NMI condition.
> >
> >This is determined by looking at the %rip from pt_regs.  If it is the same
> >as the previous NMI, it is assumed the cpu did not have a chance to jump
> >back into a non-NMI context and execute code and instead handled another NMI.
> >
> >If both of those conditions are true then we will swallow any unknown NMI.
> >
> >There still exists a chance that we accidentally swallow a real unknown NMI,
> >but for now things seem better.
> 
> Patch looks good, but the changelog is outdated.

Perhaps, but I tried rewriting most of it to reflect the current changes.
Was there something obvious in there that I missed?  I re-read it a few
times and can't figure out what part might be outdated (not that I
disagree with you, I just want to update it).

> 
> >@@ -278,19 +294,49 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
> >  	pr_emerg("Dazed and confused, but trying to continue\n");
> >  }
> >
> >+DEFINE_PER_CPU(bool, swallow_nmi);
> >+DEFINE_PER_CPU(unsigned long, save_rip);
> 
> 'static'.  Also need a better name for save_rip (suggest last_nmi_rip).

Good suggestion. 

Thanks,
Don
--
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