Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754827AbbBKV1b (ORCPT ); Wed, 11 Feb 2015 16:27:31 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:53947 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754613AbbBKV13 (ORCPT ); Wed, 11 Feb 2015 16:27:29 -0500 Date: Wed, 11 Feb 2015 13:27:23 -0800 From: "Paul E. McKenney" To: Rik van Riel Cc: fweisbec@gmail.com, luto@amacapital.net, will.deacon@arm.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mtosatti@redhat.com, borntraeger@de.ibm.com, lcapitulino@redhat.com, pbonzini@redhat.com Subject: Re: [PATCH -v5 6/5] context_tracking: fix exception_enter when already in IN_KERNEL Message-ID: <20150211212723.GN4166@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1423600074-2907-1-git-send-email-riel@redhat.com> <20150211144319.2a0c29d6@cuia.bos.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150211144319.2a0c29d6@cuia.bos.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021121-0029-0000-0000-000007DAABE0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1602 Lines: 45 On Wed, Feb 11, 2015 at 02:43:19PM -0500, Rik van Riel wrote: > If exception_enter happens when already in IN_KERNEL state, the > code still calls context_tracking_exit, which ends up in > rcu_eqs_exit_common, which explodes with a WARN_ON when it is > called in a situation where dynticks are not enabled. > > This can be avoided by having exception_enter only switch to > IN_KERNEL state if the current state is not already IN_KERNEL. Ugh... Time to formally verify, sounds like... Thanx, Paul > Signed-off-by: Rik van Riel > Reported-by: Luiz Capitulino > --- > Frederic, you will want this "bonus" patch, too :) > > Thanks to Luiz for finding this one. Whatever I was running did not > trigger this issue... > > include/linux/context_tracking.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h > index b65fd1420e53..9da230406e8c 100644 > --- a/include/linux/context_tracking.h > +++ b/include/linux/context_tracking.h > @@ -37,7 +37,8 @@ static inline enum ctx_state exception_enter(void) > return 0; > > prev_ctx = this_cpu_read(context_tracking.state); > - context_tracking_exit(prev_ctx); > + if (prev_ctx != IN_KERNEL) > + context_tracking_exit(prev_ctx); > > return prev_ctx; > } > -- 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/