From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH v2 1/4] powerpc: hard_irq_disable(): Call trace_hardirqs_off after disabling Date: Fri, 10 May 2013 17:00:45 +1000 Message-ID: <1368169245.4524.10.camel@pasglop> References: <1368155384-11035-1-git-send-email-scottwood@freescale.com> <1368155384-11035-2-git-send-email-scottwood@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org To: Scott Wood Return-path: In-Reply-To: <1368155384-11035-2-git-send-email-scottwood@freescale.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, 2013-05-09 at 22:09 -0500, Scott Wood wrote: > lockdep.c has this: > /* > * So we're supposed to get called after you mask local IRQs, > * but for some reason the hardware doesn't quite think you did > * a proper job. > */ > if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) > return; > > Since irqs_disabled() is based on soft_enabled(), that (not just the > hard EE bit) needs to be 0 before we call trace_hardirqs_off. > > Signed-off-by: Scott Wood Oops ;-) I'll apply that to my tree and will send it to Linus right after -rc1, the rest will go the normal way for KVM patches. Cheers, Ben. > --- > arch/powerpc/include/asm/hw_irq.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h > index d615b28..ba713f1 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -96,11 +96,12 @@ static inline bool arch_irqs_disabled(void) > #endif > > #define hard_irq_disable() do { \ > + u8 _was_enabled = get_paca()->soft_enabled; \ > __hard_irq_disable(); \ > - if (local_paca->soft_enabled) \ > - trace_hardirqs_off(); \ > get_paca()->soft_enabled = 0; \ > get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \ > + if (_was_enabled) \ > + trace_hardirqs_off(); \ > } while(0) > > static inline bool lazy_irq_pending(void) 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 ESMTPS id 9BDA92C009B for ; Fri, 10 May 2013 17:00:57 +1000 (EST) Message-ID: <1368169245.4524.10.camel@pasglop> Subject: Re: [PATCH v2 1/4] powerpc: hard_irq_disable(): Call trace_hardirqs_off after disabling From: Benjamin Herrenschmidt To: Scott Wood Date: Fri, 10 May 2013 17:00:45 +1000 In-Reply-To: <1368155384-11035-2-git-send-email-scottwood@freescale.com> References: <1368155384-11035-1-git-send-email-scottwood@freescale.com> <1368155384-11035-2-git-send-email-scottwood@freescale.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: linuxppc-dev@lists.ozlabs.org, Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2013-05-09 at 22:09 -0500, Scott Wood wrote: > lockdep.c has this: > /* > * So we're supposed to get called after you mask local IRQs, > * but for some reason the hardware doesn't quite think you did > * a proper job. > */ > if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) > return; > > Since irqs_disabled() is based on soft_enabled(), that (not just the > hard EE bit) needs to be 0 before we call trace_hardirqs_off. > > Signed-off-by: Scott Wood Oops ;-) I'll apply that to my tree and will send it to Linus right after -rc1, the rest will go the normal way for KVM patches. Cheers, Ben. > --- > arch/powerpc/include/asm/hw_irq.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h > index d615b28..ba713f1 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -96,11 +96,12 @@ static inline bool arch_irqs_disabled(void) > #endif > > #define hard_irq_disable() do { \ > + u8 _was_enabled = get_paca()->soft_enabled; \ > __hard_irq_disable(); \ > - if (local_paca->soft_enabled) \ > - trace_hardirqs_off(); \ > get_paca()->soft_enabled = 0; \ > get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \ > + if (_was_enabled) \ > + trace_hardirqs_off(); \ > } while(0) > > static inline bool lazy_irq_pending(void) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Fri, 10 May 2013 07:00:45 +0000 Subject: Re: [PATCH v2 1/4] powerpc: hard_irq_disable(): Call trace_hardirqs_off after disabling Message-Id: <1368169245.4524.10.camel@pasglop> List-Id: References: <1368155384-11035-1-git-send-email-scottwood@freescale.com> <1368155384-11035-2-git-send-email-scottwood@freescale.com> In-Reply-To: <1368155384-11035-2-git-send-email-scottwood@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Scott Wood Cc: Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org On Thu, 2013-05-09 at 22:09 -0500, Scott Wood wrote: > lockdep.c has this: > /* > * So we're supposed to get called after you mask local IRQs, > * but for some reason the hardware doesn't quite think you did > * a proper job. > */ > if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) > return; > > Since irqs_disabled() is based on soft_enabled(), that (not just the > hard EE bit) needs to be 0 before we call trace_hardirqs_off. > > Signed-off-by: Scott Wood Oops ;-) I'll apply that to my tree and will send it to Linus right after -rc1, the rest will go the normal way for KVM patches. Cheers, Ben. > --- > arch/powerpc/include/asm/hw_irq.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h > index d615b28..ba713f1 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -96,11 +96,12 @@ static inline bool arch_irqs_disabled(void) > #endif > > #define hard_irq_disable() do { \ > + u8 _was_enabled = get_paca()->soft_enabled; \ > __hard_irq_disable(); \ > - if (local_paca->soft_enabled) \ > - trace_hardirqs_off(); \ > get_paca()->soft_enabled = 0; \ > get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \ > + if (_was_enabled) \ > + trace_hardirqs_off(); \ > } while(0) > > static inline bool lazy_irq_pending(void)