Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754891AbbGXXxW (ORCPT ); Fri, 24 Jul 2015 19:53:22 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:33600 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbbGXXxV (ORCPT ); Fri, 24 Jul 2015 19:53:21 -0400 MIME-Version: 1.0 In-Reply-To: <20150724205119.GM19282@twins.programming.kicks-ass.net> References: <20150724090342.6d11e16d@gandalf.local.home> <20150724132128.GA3612@1wt.eu> <20150724103127.3c3f4693@gandalf.local.home> <20150724145901.GB3612@1wt.eu> <20150724111621.34713023@gandalf.local.home> <20150724152637.GC3612@1wt.eu> <20150724153054.GK19282@twins.programming.kicks-ass.net> <20150724195509.GM2859@worktop.programming.kicks-ass.net> <20150724205119.GM19282@twins.programming.kicks-ass.net> Date: Fri, 24 Jul 2015 16:53:20 -0700 X-Google-Sender-Auth: 929lDyDrYE24JuoDI9ddiImLk9c Message-ID: Subject: Re: Dealing with the NMI mess From: Linus Torvalds To: Peter Zijlstra Cc: Willy Tarreau , Steven Rostedt , Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Thomas Gleixner , 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: 1316 Lines: 31 On Fri, Jul 24, 2015 at 1:51 PM, Peter Zijlstra wrote: > > do_debug() > send_sigtrap() > force_sig_info() > spin_lock_irqsave() > > Now, I don't pretend to understand the condition before send_sigtrap(), > so it _might_ be ok, but it sure as heck could do with a comment. Ugh. As Andy said, I think that's ok, because it's actually the single-step case, and won't trigger for kernel mode. So we should be ok. Although the code I agree is not good. I'd personally be more worried about the usual crazy "notify_die()" crap. I absoluely detest those notifier chain things. They are hooks for random crap that shouldn't be hooked into, but whatever. It's not a problem in practice, it's just a sign of a certain kind of diseased mind. On the whole I think we're ok. I'd love to get rid of things, and yes, I think we should probably explicitly handle the in-kernel case first and just return without doing anything, just to make the code more obviously safe. But it doesn't look like a fundamental problem spot. 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/