From: <guo.ziliang@zte.com.cn>
To: <linux@armlinux.org.uk>, <rmk+kernel@armlinux.org.uk>
Cc: <linus.walleij@linaro.org>, <lihuafei1@huawei.com>,
<broonie@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH linux-next] ARM: unwind: use ex_frame with CONFIG_UNWINDER_FRAME_POINTER
Date: Thu, 18 May 2023 16:58:06 +0800 (CST) [thread overview]
Message-ID: <202305181658063480018@zte.com.cn> (raw)
From: guo ziliang <guo.ziliang@zte.com.cn>
We define ex_frame with CONFIG_UNWINDER_FRAME_POINTER in struct stackframe,
struct stackframe
{
......
#ifdef CONFIG_UNWINDER_FRAME_POINTER
bool ex_frame;
#endif
};
but we just use ex_frame without CONFIG_UNWINDER_FRAME_POINTER in
return_address() and unwind_frame().
Maybe we should fix it.
Signed-off-by: guo ziliang <guo.ziliang@zte.com.cn>
---
arch/arm/kernel/return_address.c | 2 ++
arch/arm/kernel/stacktrace.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index ac15db6..dae49e7 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -47,7 +47,9 @@ void *return_address(unsigned int level)
frame.kr_cur = NULL;
frame.tsk = current;
#endif
+#ifdef CONFIG_UNWINDER_FRAME_POINTER
frame.ex_frame = false;
+#endif
walk_stackframe(&frame, save_return_addr, &data);
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 620aa82..338f552 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -82,6 +82,7 @@ int notrace unwind_frame(struct stackframe *frame)
if (frame_pointer_check(frame))
return -EINVAL;
+#ifdef CONFIG_UNWINDER_FRAME_POINTER
/*
* When we unwind through an exception stack, include the saved PC
* value into the stack trace.
@@ -102,6 +103,7 @@ int notrace unwind_frame(struct stackframe *frame)
frame->ex_frame = false;
return 0;
}
+#endif
/* restore the registers from the stack frame */
#ifdef CONFIG_CC_IS_CLANG
@@ -119,8 +121,10 @@ int notrace unwind_frame(struct stackframe *frame)
(void *)frame->fp, &frame->kr_cur);
#endif
+#ifdef CONFIG_UNWINDER_FRAME_POINTER
if (in_entry_text(frame->pc))
frame->ex_frame = true;
+#endif
return 0;
}
--
1.8.3.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-05-18 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 8:58 guo.ziliang [this message]
2023-05-29 9:46 ` [PATCH linux-next] ARM: unwind: use ex_frame with CONFIG_UNWINDER_FRAME_POINTER Linus Walleij
-- strict thread matches above, loose matches on Subject: below --
2023-07-12 7:56 guo.ziliang
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=202305181658063480018@zte.com.cn \
--to=guo.ziliang@zte.com.cn \
--cc=broonie@kernel.org \
--cc=lihuafei1@huawei.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=rmk+kernel@armlinux.org.uk \
/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).