public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Michael Zimmermann <sigmaepsilon92@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 2/2] ArmPkg/DefaultExceptionHandlerLib AARCH64: add minimal backtrace to crash dump
Date: Fri, 9 Sep 2016 20:03:19 +0200	[thread overview]
Message-ID: <CAN9vWDJ2a2-Vmo8n1QWFcDi25+qMf0z22S+T6O5KG-YUw1UniQ@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu-Uo9hRSOmE_bK0mGkWQUsAs+iBB+bns0CL5f5rdT24TA@mail.gmail.com>

> In any case, unless you have any information that suggests that GCC in
> Thumb2 mode can be coerced into managing the frame pointer in a way
> that allows us to do something similar in EDK2, I am going to stick
> with my assertion that this is not currently possible on ARM.

I think it's not possible because they enable ARM_UNWIND when compiling
a THUMB2_KERNEL.

porting libunwind would be hard because of UEFI's architecture. every *.efi
would need a section with unwind information, and I don't even know if the
spec allows additional sections.

Thanks
Michael

On Fri, Sep 9, 2016 at 3:08 PM, Ard Biesheuvel <ard.biesheuvel@linaro.org>
wrote:

> On 7 September 2016 at 12:32, Ard Biesheuvel <ard.biesheuvel@linaro.org>
> wrote:
> > On 7 September 2016 at 12:25, Michael Zimmermann
> > <sigmaepsilon92@gmail.com> wrote:
> >>> However, looking at this
> >>> code, this is still not sufficient to find the *next* frame pointer on
> >>> the stack.
> >> are you sure about that? this code looks like it does just that:
> >> https://github.com/torvalds/linux/blob/master/arch/arm/
> kernel/stacktrace.c
> >>
> >
> > First of all, that comment makes little sense:
> >
> > * With framepointer enabled, a simple function prologue looks like this:
> > * mov ip, sp
> > * stmdb sp!, {fp, ip, lr, pc}
> >
> > I assume this should be
> >
> > stmdb sp!, {fp, ip, lr}
> >
> > * sub fp, ip, #4
> > *
> > * A simple function epilogue looks like this:
> > * ldm sp, {fp, sp, pc}
> >
>
> OK, I spoke a bit too soon. The 'pop' does not actually increment the
> stack pointer, so while the push does make sense (and pushing the pc
> in addition is just informational), the pop should actually be
> implemented as
>
> ldm sp, {fp, sp, lr}
>
> ... do other stuff including incrementing the sp to its original value ...
>
> bx lr
>
> In any case, unless you have any information that suggests that GCC in
> Thumb2 mode can be coerced into managing the frame pointer in a way
> that allows us to do something similar in EDK2, I am going to stick
> with my assertion that this is not currently possible on ARM.
>
> Thanks,
> Ard.
>


  reply	other threads:[~2016-09-09 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  8:21 [PATCH 1/2] BaseTools/tools_def AARCH64: enable frame pointers for DEBUG builds Ard Biesheuvel
2016-09-07  8:21 ` [PATCH 2/2] ArmPkg/DefaultExceptionHandlerLib AARCH64: add minimal backtrace to crash dump Ard Biesheuvel
2016-09-07  9:48   ` Michael Zimmermann
2016-09-07 11:03     ` Ard Biesheuvel
2016-09-07 11:25       ` Michael Zimmermann
2016-09-07 11:32         ` Ard Biesheuvel
2016-09-09 13:08           ` Ard Biesheuvel
2016-09-09 18:03             ` Michael Zimmermann [this message]
2016-09-09 16:03   ` Andrew Fish
2016-09-07 15:00 ` [PATCH 1/2] BaseTools/tools_def AARCH64: enable frame pointers for DEBUG builds Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN9vWDJ2a2-Vmo8n1QWFcDi25+qMf0z22S+T6O5KG-YUw1UniQ@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox