From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Oleg Nesterov <oleg@redhat.com>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] asm-generic/ptrace.h: add a comment about frame_pointer
Date: Tue, 11 Dec 2018 00:31:50 +0300 [thread overview]
Message-ID: <20181210213150.GA18226@altlinux.org> (raw)
I have been misled by comments in asm-generic/ptrace.h into thinking
that frame_pointer() is universally available across architectures,
which resulted in a wrong design decision.
Add a comment about frame_pointer in a hope that it will help others
to avoid this mistake in the future.
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
include/asm-generic/ptrace.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/asm-generic/ptrace.h b/include/asm-generic/ptrace.h
index 82e674f6b337..3186c30bd50d 100644
--- a/include/asm-generic/ptrace.h
+++ b/include/asm-generic/ptrace.h
@@ -59,6 +59,10 @@ static inline void user_stack_pointer_set(struct pt_regs *regs,
#define SET_FP(regs, val) (GET_FP(regs) = (val))
#endif
+/*
+ * Unlike instruction_pointer and user_stack_pointer,
+ * frame_pointer is not universally available across architectures.
+ */
static inline unsigned long frame_pointer(struct pt_regs *regs)
{
return GET_FP(regs);
--
ldv
next reply other threads:[~2018-12-10 21:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 21:31 Dmitry V. Levin [this message]
2018-12-10 21:31 ` [PATCH] asm-generic/ptrace.h: add a comment about frame_pointer Dmitry V. Levin
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=20181210213150.GA18226@altlinux.org \
--to=ldv@altlinux.org \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.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