Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 15:56:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ppc@FreeBSD.org
Subject:   [Bug 225321] dtrace/powerpc64: System crash
Message-ID:  <bug-225321-21-byKUsQmrtp@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225321-21@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225321-21@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225321

--- Comment #4 from Breno Leitao <breno.leitao@gmail.com> ---
Hi,

I created a patch that I think it makes sense.

I think that the problem we are not using the temporary stack properly, sin=
ce
it is defined on the bottom of the stack, as showed:

  #define TMPSTKSZ        16384           /* 16K temporary stack */
  GLOBAL(tmpstk)
          .space  TMPSTKSZ

  TOC_ENTRY(tmpstk)

So, the tmpstk is pointing to the bottom of the stack (higher address) in t=
he
TOC.

Later, in the dbtrap: section, we get tmpstk and increase TMPSTKSZ, which is
going to get in a different area.

If the above is correct, we have two solutions:

1) Move the TOC_ENTRY to the TOP of the stack, something as (not validated):

  #define TMPSTKSZ        16384           /* 16K temporary stack */
  GLOBAL(tmpstk)
  TOC_ENTRY(tmpstk)
          .space  TMPSTKSZ


2) Does not increment the tmpstk pointer, since we are on the bottom of the
stack already:

 index 7ef41d90ffe..2307ec4307c 100644
 --- a/sys/powerpc/aim/trap_subr64.S
 +++ b/sys/powerpc/aim/trap_subr64.S
 @@ -805,9 +805,9 @@ dbtrap:
         andi.   %r1,%r1,0xff00
         mtsprg3 %r1

         ld      %r1,TRAP_TOCBASE(0)             /* get new SP */
         ld      %r1,TOC_REF(tmpstk)(%r1)
 -       addi    %r1,%r1,(TMPSTKSZ-48)
 +       addi    %r1,%r1,-48


Does it make any sense?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225321-21-byKUsQmrtp>