From: Aditya Gupta <adityag@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>,
linuxppc-dev@ozlabs.org, mpe@ellerman.id.au
Cc: Hari Bathini <hbathini@linux.ibm.com>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Sourabh Jain <sourabhjain@linux.ibm.com>
Subject: Re: [RFC PATCH v2 1/1] powerpc: update ppc_save_regs to save current r1 in pt_regs
Date: Mon, 19 Jun 2023 09:18:17 +0530 [thread overview]
Message-ID: <334e6694-e4e4-dce4-9443-2aaccdb86f04@linux.ibm.com> (raw)
In-Reply-To: <CTD7OOB3NTH8.1QSVBACQ2VI3V@wheely>
On 15/06/23 17:40, Nicholas Piggin wrote:
> On Thu Jun 15, 2023 at 7:10 PM AEST, Aditya Gupta wrote:
>> ppc_save_regs() skips one stack frame while saving the CPU register states.
>> Instead of saving current R1, it pulls the previous stack frame pointer.
>>
>> ...
>>
>> So this now saves regs as though it was an interrupt taken in the
>> caller, at the instruction after the call to ppc_save_regs, whereas
>> previously the NIP was there, but R1 came from the caller's caller
>> and that mismatch is what causes gdb's dwarf unwinder to go haywire.
>>
>> Nice catch, and I think I follow the fix and I think I agree with it.
>> Before the bug was introduced, NIP also came from the grandparent.
>> Which is what xmon presumably wanted, but since then I think maybe it
>> makes more sense to just have the parent caller.
>>
>> Reivewed-by: Nicholas Piggin <npiggin@gmail.com>
>> Fixes: d16a58f8854b1 ("powerpc: Improve ppc_save_regs()")
Thanks for reviewing this, and providing a Fixes tag too.
Thanks
- Aditya
next prev parent reply other threads:[~2023-06-19 3:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 9:10 [RFC PATCH v2 1/1] powerpc: update ppc_save_regs to save current r1 in pt_regs Aditya Gupta
2023-06-15 12:10 ` Nicholas Piggin
2023-06-19 3:48 ` Aditya Gupta [this message]
2023-07-03 5:26 ` Michael Ellerman
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-all 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=334e6694-e4e4-dce4-9443-2aaccdb86f04@linux.ibm.com \
--to=adityag@linux.ibm.com \
--cc=hbathini@linux.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=npiggin@gmail.com \
--cc=sourabhjain@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).