Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754353AbbGXJEG (ORCPT ); Fri, 24 Jul 2015 05:04:06 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:8857 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbbGXJDq (ORCPT ); Fri, 24 Jul 2015 05:03:46 -0400 Date: Fri, 24 Jul 2015 11:02:51 +0200 From: Willy Tarreau To: Peter Zijlstra Cc: Linus Torvalds , Andy Lutomirski , Steven Rostedt , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Thomas Gleixner , Brian Gerst Subject: Re: Dealing with the NMI mess Message-ID: <20150724090251.GA3546@1wt.eu> References: <20150723173105.6795c0dc@gandalf.local.home> <20150724081326.GO25159@twins.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150724081326.GO25159@twins.programming.kicks-ass.net> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 32 On Fri, Jul 24, 2015 at 10:13:26AM +0200, Peter Zijlstra wrote: > On Thu, Jul 23, 2015 at 02:59:56PM -0700, Linus Torvalds wrote: > > Hmmm. I thought watchpoints were "before the instruction" too, but > > that's just because I haven't used them in ages, and I didn't remember > > the details. I just looked it up. > > > > You're right - the memory watchpoints trigger after the instruction > > has executed, so RF isn't an issue. So yes, the only issue is > > instruction breakpoints, and those are the only ones we need to clear. > > > > And that makes it really easy. > > > > So yes, I agree. We only need to clear all kernel breakpoints. > > But but but, we can access userspace with !IF, imagine someone doing: > > local_irq_disable(); > copy_from_user_inatomic(); > > and as luck would have it, there's a breakpoint on the user memory we > just touched. And we go and disable a user breakpoint. Then shouldn't we use !IF && RSP matches NMI's stack ? User-space cannot control the two at once. Willy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/