From: Paul Mundt <lethal@linux-sh.org>
To: Roland McGrath <roland@redhat.com>
Cc: linux-arch@vger.kernel.org, utrace-devel@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: CONFIG_HAVE_ARCH_TRACEHOOK and you
Date: Fri, 12 Sep 2008 22:05:11 +0900 [thread overview]
Message-ID: <20080912130511.GA11375@linux-sh.org> (raw)
In-Reply-To: <20080912025733.E55F415420D@magilla.localdomain>
On Thu, Sep 11, 2008 at 07:57:33PM -0700, Roland McGrath wrote:
> The comment in arch/Kconfig lists the items:
>
> # task_pt_regs() in asm/processor.h or asm/ptrace.h
> # arch_has_single_step() if there is hardware single-step support
> # arch_has_block_step() if there is hardware block-step support
> # arch_ptrace() and not #define __ARCH_SYS_PTRACE
> # compat_arch_ptrace() and #define __ARCH_WANT_COMPAT_SYS_PTRACE
> # asm/syscall.h supplying asm-generic/syscall.h interface
> # linux/regset.h user_regset interfaces
> # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
> # TIF_SYSCALL_TRACE calls tracehook_report_syscall_{entry,exit}
> # TIF_NOTIFY_RESUME calls tracehook_notify_resume()
> # signal delivery calls tracehook_signal_handler()
>
[snip]
> Here's the text that's on that wiki:
>
> 1. task_pt_regs()
>
> * Define this inline function in asm/processor.h or asm/ptrace.h.
>
user_stack_pointer() is apparently a requirement, too. Although given
that you already have a task_struct pointer the only place you currently
use it (lib/syscall.c), it makes more sense to use KSTK_ESP/KSTK_EIP
which is provided by almost everyone already.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
lib/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/syscall.c b/lib/syscall.c
index a4f7067..888c36a 100644
--- a/lib/syscall.c
+++ b/lib/syscall.c
@@ -11,8 +11,8 @@ static int collect_syscall(struct task_struct *target, long *callno,
if (unlikely(!regs))
return -EAGAIN;
- *sp = user_stack_pointer(regs);
- *pc = instruction_pointer(regs);
+ *sp = KSTK_ESP(target);
+ *pc = KSTK_EIP(target);
*callno = syscall_get_nr(target, regs);
if (*callno != -1L && maxargs > 0)
next prev parent reply other threads:[~2008-09-12 13:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 2:57 CONFIG_HAVE_ARCH_TRACEHOOK and you Roland McGrath
2008-09-12 2:57 ` Roland McGrath
2008-09-12 8:23 ` Christoph Hellwig
2008-09-12 13:05 ` Paul Mundt [this message]
2008-09-15 20:38 ` Roland McGrath
2008-09-12 13:13 ` Russell King
2008-09-12 21:57 ` David Miller
2008-09-12 22:31 ` Roland McGrath
2008-09-12 22:31 ` Roland McGrath
2008-09-12 22:37 ` David Miller
2008-09-12 22:39 ` Roland McGrath
2008-09-12 22:39 ` Roland McGrath
2008-09-12 22:40 ` David Miller
2008-09-12 22:45 ` Roland McGrath
2008-09-12 22:45 ` Roland McGrath
-- strict thread matches above, loose matches on Subject: below --
2008-09-12 13:40 Russell King
2008-09-12 13:40 ` Russell King
2008-09-12 23:57 ` Roland McGrath
2008-09-12 23:57 ` Roland McGrath
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=20080912130511.GA11375@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.com \
--cc=utrace-devel@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