From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753100AbbHVNzJ (ORCPT ); Sat, 22 Aug 2015 09:55:09 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:34130 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbbHVNzH (ORCPT ); Sat, 22 Aug 2015 09:55:07 -0400 Date: Sat, 22 Aug 2015 15:55:02 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Steven Rostedt , Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Willy Tarreau , Borislav Petkov , Thomas Gleixner , Peter Zijlstra , Linus Torvalds Subject: Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Message-ID: <20150822135502.GA9911@gmail.com> References: <040374ca9800988a0ed35ea9ddeb4a762c1371fa.1437690860.git.luto@kernel.org> <20150805085957.GA23893@gmail.com> <20150805142736.7dba3c8f@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Wed, Aug 5, 2015 at 11:27 AM, Steven Rostedt wrote: > > On Wed, 5 Aug 2015 11:24:54 -0700 > > Andy Lutomirski wrote: > > > >> On Wed, Aug 5, 2015 at 1:59 AM, Ingo Molnar wrote: > >> > > >> > * Andy Lutomirski wrote: > >> > > >> >> --- a/arch/x86/kernel/process_64.c > >> >> +++ b/arch/x86/kernel/process_64.c > >> >> @@ -280,6 +280,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) > >> >> unsigned fsindex, gsindex; > >> >> fpu_switch_t fpu_switch; > >> >> > >> >> +#ifdef CONFIG_DEBUG_ENTRY > >> >> + WARN_ON(this_cpu_read(irq_count)); > >> >> +#endif > >> > > >> > Please introduce a less noisy (to the eyes) version of this, something like: > >> > > >> > WARN_ON_DEBUG_ENTRY(this_cpu_read(irq_count)); > >> > > >> > or so, similar to WARN_ON_FPU(). > >> > >> I can do that (or "DEBUG_ENTRY_WARN_ON"? we seem to be inconsistent > >> about ordering). > >> > >> Or would if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) WARN_ON(...) be better? > >> > > > > Does WARN_ON(IS_ENABLED(CONFIG_DEBUG_ENTRY) && this_cpu_read(irq_count)) > > work? > > I'd be okay with it. Ingo? Yeah, that one is more compact than the #ifdef variant. Thanks, Ingo