From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbbHEScb (ORCPT ); Wed, 5 Aug 2015 14:32:31 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:34498 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752784AbbHESc3 (ORCPT ); Wed, 5 Aug 2015 14:32:29 -0400 MIME-Version: 1.0 In-Reply-To: <20150805142736.7dba3c8f@gandalf.local.home> References: <040374ca9800988a0ed35ea9ddeb4a762c1371fa.1437690860.git.luto@kernel.org> <20150805085957.GA23893@gmail.com> <20150805142736.7dba3c8f@gandalf.local.home> From: Andy Lutomirski Date: Wed, 5 Aug 2015 11:32:08 -0700 Message-ID: Subject: Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe To: Steven Rostedt Cc: Ingo Molnar , Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Willy Tarreau , Borislav Petkov , Thomas Gleixner , Peter Zijlstra , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? (Except that that line of code is from v1, and v2 looks slightly different here, but that's beside the point.) --Andy > > -- Steve -- Andy Lutomirski AMA Capital Management, LLC