From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755128AbdJIPGD (ORCPT ); Mon, 9 Oct 2017 11:06:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:48059 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754971AbdJIPF6 (ORCPT ); Mon, 9 Oct 2017 11:05:58 -0400 Date: Mon, 9 Oct 2017 17:05:56 +0200 From: Petr Mladek To: Peter Zijlstra Cc: sergey.senozhatsky@gmail.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de, Jason Wessel Subject: Re: [PATCH 1/3] printk: Fix kdb_trap_printk placement Message-ID: <20171009150556.GA15129@pathway.suse.cz> References: <20170928121823.430053219@infradead.org> <20170928122513.328354788@infradead.org> <20171005133844.GA16068@pathway.suse.cz> <20171005134227.zu5j6nic6cfgxcza@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171005134227.zu5j6nic6cfgxcza@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2017-10-05 15:42:27, Peter Zijlstra wrote: > On Thu, Oct 05, 2017 at 03:38:44PM +0200, Petr Mladek wrote: > > Or can the kdb console commands be called in NMI context? > > IIRC most of KDB runs from NMI context. To be honest, I am not familiar with kdb. I tried the following from Documentation/dev-tools/kgdb.rst: $> echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc $> echo g >/proc/sysrq-trigger Result: I was able to do kdb commands on the serial console. Note: It seems that this stuff was _not_ running in NMI. Then I tried to set breakpoint for a function that is called in NMI context: $kdb> bt show_regs Where show_regs() is called from nmi_cpu_backtrace(). I unblocked the system and triggered ''l'' sysrq to show stacks from all CPUs: $kdb> go $> echo l >/proc/sysrq-trigger Result: The system frozen and I had to reboot using a power switch. I wonder if the break point in NMI is supposed to work and if the kdb commands are handled in NMI context on the serial console then. By other words, do you need this patch for a particular use-case? Or did you added this patch just to fix a theoretical problem? Best Regards, Petr