Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754750AbYHMAxT (ORCPT ); Tue, 12 Aug 2008 20:53:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752338AbYHMAxI (ORCPT ); Tue, 12 Aug 2008 20:53:08 -0400 Received: from mx1.redhat.com ([66.187.233.31]:41553 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbYHMAxG (ORCPT ); Tue, 12 Aug 2008 20:53:06 -0400 Date: Tue, 12 Aug 2008 20:53:04 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@hs20-bc2-1.build.redhat.com To: David Miller cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: stack overflow on Sparc64 In-Reply-To: <20080812.012201.164876122.davem@davemloft.net> Message-ID: References: <20080620.215139.218732028.davem@davemloft.net> <20080811.233013.49328708.davem@davemloft.net> <20080812.012201.164876122.davem@davemloft.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2172 Lines: 79 On Tue, 12 Aug 2008, David Miller wrote: > From: David Miller > Date: Mon, 11 Aug 2008 23:30:13 -0700 (PDT) > > > The problem is that CONFIG_STACK_DEBUG doesn't understand > > the IRQ stacks at all. > > > > I'll see if I can tweak it to handle this. > > This patch, on top of my original IRQSTACKS patch for > sparc64, seems to get things working for me. Thanks, the patch works. Mikulas > diff --git a/arch/sparc64/lib/mcount.S b/arch/sparc64/lib/mcount.S > index 9e4534b..24e6a3c 100644 > --- a/arch/sparc64/lib/mcount.S > +++ b/arch/sparc64/lib/mcount.S > @@ -45,11 +45,47 @@ _mcount: > sub %g3, STACK_BIAS, %g3 > cmp %sp, %g3 > bg,pt %xcc, 1f > - sethi %hi(panicstring), %g3 > + nop > +#ifdef CONFIG_IRQSTACKS > + lduh [%g6 + TI_CPU], %g1 > + sethi %hi(hardirq_stack), %g3 > + or %g3, %lo(hardirq_stack), %g3 > + sllx %g1, 3, %g1 > + ldx [%g3 + %g1], %g7 > + sub %g7, STACK_BIAS, %g7 > + cmp %sp, %g7 > + bleu,pt %xcc, 2f > + sethi %hi(THREAD_SIZE), %g3 > + add %g7, %g3, %g7 > + cmp %sp, %g7 > + blu,pn %xcc, 1f > +2: sethi %hi(softirq_stack), %g3 > + or %g3, %lo(softirq_stack), %g3 > + ldx [%g3 + %g1], %g7 > + cmp %sp, %g7 > + bleu,pt %xcc, 2f > + sethi %hi(THREAD_SIZE), %g3 > + add %g7, %g3, %g7 > + cmp %sp, %g7 > + blu,pn %xcc, 1f > + nop > +#endif > + /* If we are already on panic stack, don't hop onto it > + * again, we are already trying to output the stack overflow > + * message. > + */ > sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough > or %g7, %lo(ovstack), %g7 > - add %g7, OVSTACKSIZE, %g7 > + add %g7, OVSTACKSIZE, %g3 > + sub %g3, STACK_BIAS - 192, %g3 > sub %g7, STACK_BIAS, %g7 > + cmp %sp, %g7 > + blu,pn %xcc, 2f > + cmp %sp, %g3 > + bleu,pn %xcc, 1f > + nop > +2: mov %g3, %sp > + sethi %hi(panicstring), %g3 > mov %g7, %sp > call prom_printf > or %g3, %lo(panicstring), %o0 > -- 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/