Thread (13 messages) 13 messages, 4 authors, 2014-06-02
DORMANTno replies
Revisions (4)
  1. resend [diff vs current]
  2. v2 [diff vs current]
  3. v2 current
  4. resend [diff vs current]

[PATCH v2 0/7] Fix backtrace support in THUMB2 mode

From: Nikolay Borisov <hidden>
Date: 2014-06-02 08:34:58

[Adding Dave Martin as CC]
-----Original Message-----
From: Arnd Bergmann [mailto:arnd at arndb.de]
Sent: 31 May 2014 19:32
To: linux-arm-kernel at lists.infradead.org
Cc: Nikolay Borisov; rric at kernel.org; Will Deacon; u.kleine-
koenig at pengutronix.de
Subject: Re: [PATCH v2 0/7] Fix backtrace support in THUMB2 mode

On Friday 30 May 2014 17:59:44 Nikolay Borisov wrote:
quoted
From: Nikolay Borisov <redacted>

Currently all the code which deals with backtrace support assumes
that R11
quoted
is the frame-pointer. While this is the case for ARM mode and is
explicitly
quoted
documented in the AAPCS, this is not the case for THUMB2 mode.

There is no official document requiring that R11 has to be the frame
pointer
quoted
and GCC uses R7 as FP and given that R7's usage is so intertwined
within GCC's
quoted
mechanics it is unlikely to change, so fixing backtrace in THUMB2
mode seems
quoted
in order.

This patch series rectifies the problem by first fixing the
thread_save_fp macro to reference the correct register. Furthermore,
there
quoted
a lot of repetetive sequences of code such as :

stackframe.fp = pt_regs->ARM_fp
stackframe.lr = pt_regs->ARM_lr

so introducing a function arm_get_current_stack_frame which both
hides this repetition and also utilizes teh frame_pointer(regs) macro
to reference the correct register depending on the mode.

Finally, change all the call sites so that they utilize the new
routine.

Sorry for the stupid question, but does your series relate to the
#warning "TODO: return_address should use unwind tables" that we see
all the time in arch/arm/kernel/return_address.c?
My changes have nothing to do with the use of unwind table whatsoever,
I guess this warning is a result of a completely different issue. Probably
Dave Martin could shed more light on this.
If I remember the story correctly, the problem is that so far we could
never use the frame pointer in thumb2 mode, and nobody has implemented
a version of that function using the arm unwinder.

Are we now able to use the frame pointer after all?
What my changes implement, boils down to referring the correct register
Which acts as a frame pointer depending on whether we are running a THUMB2
Kernel or not.
      Arnd
Regards,
Nikolay


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help