Message ID | 20091205.201802.71100445.davem@davemloft.net |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
On Sun, Dec 6, 2009 at 7:18 AM, David Miller <davem@davemloft.net> wrote: > From: Igor Kovalenko <igor.v.kovalenko@gmail.com> > Date: Sun, 6 Dec 2009 01:27:08 +0300 > >> I wonder if mcount ever works on sparc64, if it does work indeed I'd >> like to know what I'm missing there. > > Yep, two distinct bugs there. Please try this patch, thanks > for the report. Works here, thanks! - does not trap too early - prints "Stack overflow" and exits to prom without fault (I tried removing STACK_BIAS adjustment to make it trap)
From: Igor Kovalenko <igor.v.kovalenko@gmail.com> Date: Sun, 6 Dec 2009 20:37:03 +0300 > On Sun, Dec 6, 2009 at 7:18 AM, David Miller <davem@davemloft.net> wrote: >> From: Igor Kovalenko <igor.v.kovalenko@gmail.com> >> Date: Sun, 6 Dec 2009 01:27:08 +0300 >> >>> I wonder if mcount ever works on sparc64, if it does work indeed I'd >>> like to know what I'm missing there. >> >> Yep, two distinct bugs there. ,A Please try this patch, thanks >> for the report. > > Works here, thanks! > > - does not trap too early > - prints "Stack overflow" and exits to prom without fault (I tried > removing STACK_BIAS adjustment to make it trap) Great, thanks for testing. I'll push the fix around. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S index 7ce9c65..24b8b12 100644 --- a/arch/sparc/lib/mcount.S +++ b/arch/sparc/lib/mcount.S @@ -64,8 +64,9 @@ mcount: 2: sethi %hi(softirq_stack), %g3 or %g3, %lo(softirq_stack), %g3 ldx [%g3 + %g1], %g7 + sub %g7, STACK_BIAS, %g7 cmp %sp, %g7 - bleu,pt %xcc, 2f + bleu,pt %xcc, 3f sethi %hi(THREAD_SIZE), %g3 add %g7, %g3, %g7 cmp %sp, %g7 @@ -75,7 +76,7 @@ mcount: * again, we are already trying to output the stack overflow * message. */ - sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough +3: sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough or %g7, %lo(ovstack), %g7 add %g7, OVSTACKSIZE, %g3 sub %g3, STACK_BIAS + 192, %g3