From: David Miller <davem@davemloft.net>
To: roland@redhat.com
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/23] tracehook
Date: Fri, 18 Jul 2008 02:20:35 -0700 (PDT) [thread overview]
Message-ID: <20080718.022035.208722773.davem@davemloft.net> (raw)
In-Reply-To: <20080717072541.F390E15411D@magilla.localdomain>
From: Roland McGrath <roland@redhat.com>
Date: Thu, 17 Jul 2008 00:25:41 -0700 (PDT)
> I have done some arch work and will submit this to the arch maintainers
> after the generic tracehook series settles in. For now, that work is
> available in my GIT repositories, and in patch and mbox-of-patches form
> at http://people.redhat.com/roland/utrace/2.6-current/
Thanks for doing this work.
I took a quick look at the sparc64 tracehook support and only spotted
one issue.
You'll need special handling for 32-bit compat tasks when copying the
arguments in. You can't just use the full 64-bit values because they
get 32-bit zero extended by the 32-bit syscall entry code, and this
doesn't propagate into the pt_regs copies.
See arch/sparc64/kernel/syscalls.S:linux_sparc_syscall32
So at a minimum, when _TIF_32BIT is set, you'll need to "u32" cast
the regs->u_regs[] values before assigning them into the unsigned long
array slots.
Actually, it's more complicated than that. We have to sign extend
arguments in some cases, and this is performed by a class of stubs
in arch/sparc64/kernel/sys32.S which then revector to the real
system call handler.
I don't know how you want to handle those cases. Should the tracehook
user know that it's a 32-bit task, what system call it is, and therefore
do the appropriate sign extensions? That doesn't sound right.
So likely we have to properly sign extend those things here in the
asm/syscall.h handlers.
If you look at arch/sparc64/kernel/sys32.S it uses macros and then a
list of cases that could be slightly modified such that they could be
used to build argument sign extension tables. Simply change the
explicit register name arguments to pure numbers (ie. %o0 becomes
plain 0) and adjust the assembler macros accordingly.
Then, in a C file somewhere, you set these macro defines differently
then feed the list of instantiations through them and build the table.
The other arch's with compat support will have this same exact issue.
next prev parent reply other threads:[~2008-07-18 9:20 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 7:25 Roland McGrath
2008-07-17 7:27 ` [PATCH 01/23] tracehook: add linux/tracehook.h Roland McGrath
2008-07-17 8:48 ` Alexey Dobriyan
2008-07-17 11:06 ` Petr Tesarik
2008-07-17 21:50 ` Alexey Dobriyan
2008-07-17 13:34 ` Christoph Hellwig
2008-07-18 11:57 ` Petr Tesarik
2008-07-17 7:28 ` [PATCH 02/23] tracehook: exec Roland McGrath
2008-07-21 8:49 ` Christoph Hellwig
2008-07-17 7:28 ` [PATCH 03/23] tracehook: unexport ptrace_notify Roland McGrath
2008-07-17 7:28 ` [PATCH 04/23] tracehook: exit Roland McGrath
2008-07-17 7:29 ` [PATCH 05/23] tracehook: clone Roland McGrath
2008-07-17 7:29 ` [PATCH 06/23] tracehook: vfork-done Roland McGrath
2008-07-17 7:29 ` [PATCH 07/23] tracehook: release_task Roland McGrath
2008-07-17 7:29 ` [PATCH 08/23] tracehook: tracehook_tracer_task Roland McGrath
2008-07-17 7:29 ` [PATCH 09/23] tracehook: tracehook_expect_breakpoints Roland McGrath
2008-07-17 7:30 ` [PATCH 10/23] tracehook: tracehook_signal_handler Roland McGrath
2008-07-17 7:30 ` [PATCH 11/23] tracehook: tracehook_consider_ignored_signal Roland McGrath
2008-07-17 7:30 ` [PATCH 12/23] tracehook: tracehook_consider_fatal_signal Roland McGrath
2008-07-17 7:30 ` [PATCH 13/23] tracehook: syscall Roland McGrath
2008-07-17 7:30 ` [PATCH 14/23] tracehook: get_signal_to_deliver Roland McGrath
2008-07-17 7:30 ` [PATCH 15/23] tracehook: job control Roland McGrath
2008-07-17 7:30 ` [PATCH 16/23] tracehook: death Roland McGrath
2008-07-17 7:30 ` [PATCH 17/23] tracehook: force signal_pending() Roland McGrath
2008-07-17 7:31 ` [PATCH 18/23] tracehook: TIF_NOTIFY_RESUME Roland McGrath
2008-07-17 7:31 ` [PATCH 19/23] tracehook: asm/syscall.h Roland McGrath
2008-07-17 7:31 ` [PATCH 20/23] tracehook: CONFIG_HAVE_ARCH_TRACEHOOK Roland McGrath
2008-07-17 7:31 ` [PATCH 21/23] tracehook: wait_task_inactive Roland McGrath
2008-07-17 7:31 ` [PATCH 22/23] task_current_syscall Roland McGrath
2008-07-17 7:31 ` [PATCH 23/23] /proc/PID/syscall Roland McGrath
2008-07-17 22:56 ` Alexey Dobriyan
2008-07-21 8:19 ` Roland McGrath
2008-07-17 7:39 ` [PATCH 00/23] tracehook Andrew Morton
2008-07-17 8:11 ` Roland McGrath
2008-07-17 8:30 ` Andrew Morton
2008-07-17 8:37 ` Roland McGrath
2008-07-17 8:51 ` Andrew Morton
2008-07-18 8:07 ` Ingo Molnar
2008-07-21 9:59 ` Roland McGrath
2008-07-18 9:20 ` David Miller [this message]
2008-07-18 11:24 ` Andi Kleen
2008-07-18 11:32 ` David Miller
2008-07-21 10:54 ` Roland McGrath
2008-07-21 15:18 ` David Miller
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=20080718.022035.208722773.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=torvalds@linux-foundation.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
Powered by JetHome