From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 33ED9DDE46 for ; Wed, 7 Mar 2007 21:12:48 +1100 (EST) Subject: Re: [RFC] [patch 4/6 -rt] powerpc 2.6.20-rt8: fix a runtime warnings for xmon From: Benjamin Herrenschmidt To: Ingo Molnar In-Reply-To: <20070307091638.GC1783@elte.hu> References: <20070307091638.GC1783@elte.hu> Content-Type: text/plain Date: Wed, 07 Mar 2007 11:10:59 +0100 Message-Id: <1173262259.9349.40.camel@localhost.localdomain> Mime-Version: 1.0 Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2007-03-07 at 10:16 +0100, Ingo Molnar wrote: > * Tsutomu OWA wrote: > > > @@ -342,6 +342,7 @@ static int xmon_core(struct pt_regs *reg > > > > msr = mfmsr(); > > mtmsr(msr & ~MSR_EE); /* disable interrupts */ > > + preempt_disable(); > > i'm not an xmon expert, but maybe it might make more sense to first > disable preemption, then interrupts - otherwise you could be preempted > right after having disabled these interrupts (and be scheduled to > another CPU, etc.). What is the difference between local_irq_save() and > the above 'disable interrupts' sequence? If it's not the same and > xmon_core() relied on having hardirqs disabled then it might make sense > to do a local_irq_save() there, instead of a preempt_disable(). powerpc 64 bits nowadays does lazy HW masking, so local_irq_disable() will not actually switch MSR_EE off. However, xmon needs that to happen (though we have a nicer accessor to do it, I suspect some bitrot need fixing in there, possibly already fixed in .21) I agree that preempt_disable() should be put before the MSR tweaking though. Ben.