Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbbGWWAD (ORCPT ); Thu, 23 Jul 2015 18:00:03 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:36419 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753946AbbGWV75 (ORCPT ); Thu, 23 Jul 2015 17:59:57 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150723173105.6795c0dc@gandalf.local.home> Date: Thu, 23 Jul 2015 14:59:56 -0700 X-Google-Sender-Auth: mmtGRgWu9SNeddBKzHRjJno_E2Q Message-ID: Subject: Re: Dealing with the NMI mess From: Linus Torvalds To: Andy Lutomirski Cc: Steven Rostedt , X86 ML , "linux-kernel@vger.kernel.org" , Willy Tarreau , Borislav Petkov , Thomas Gleixner , Peter Zijlstra , Brian Gerst Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1261 Lines: 32 On Thu, Jul 23, 2015 at 2:50 PM, Andy Lutomirski wrote: > > What if we relax it slightly: "if the breakpoint happened during that > interrupts-off region, I will clear all *kernel breakpoints* in %dr7 > to guarantee forward progress"? > > Watchpoints don't need RF to make forward progress, and, by leaving > watchpoints alone, we avoid breaking gdb. 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. So we don't even need that _TIF_USER_WORK_MASK thing, because user space isn't setting kernel code breakpoints, it's just kgdb. Sounds good to me. Linus -- 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/