From: Miroslav Benes <mbenes@suse.cz>
To: jpoimboe@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org,
Miroslav Benes <mbenes@suse.cz>
Subject: [PATCH] x86/unwind/orc: Do not skip the first frame unless explicitly asked for
Date: Wed, 4 Mar 2020 13:32:59 +0100 [thread overview]
Message-ID: <20200304123259.32199-1-mbenes@suse.cz> (raw)
ORC unwinder can currently skip the first frame even if a user does not
ask for it. If both regs and first_frame parameters of unwind_start()
are set to NULL, state->sp and first_frame are later initialized to the
same value for an inactive task. Given there is "less than or equal to"
comparison used at the end of __unwind_start() for skipping stack frames,
the first frame is always skipped in this case.
Drop the equal part of the comparison and make it equivalent to the
frame pointer unwinder.
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
arch/x86/kernel/unwind_orc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index e9cc182aa97e..8452518cc20a 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -651,7 +651,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
/* Otherwise, skip ahead to the user-specified starting frame: */
while (!unwind_done(state) &&
(!on_stack(&state->stack_info, first_frame, sizeof(long)) ||
- state->sp <= (unsigned long)first_frame))
+ state->sp < (unsigned long)first_frame))
unwind_next_frame(state);
return;
--
2.25.1
next reply other threads:[~2020-03-04 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 12:32 Miroslav Benes [this message]
2020-03-04 17:47 ` Josh Poimboeuf
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=20200304123259.32199-1-mbenes@suse.cz \
--to=mbenes@suse.cz \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®