From: David Smith <dsmith@redhat.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [patch 15/21] ptrace changes
Date: Mon, 03 Nov 2008 11:14:36 -0600 [thread overview]
Message-ID: <490F317C.9040603@redhat.com> (raw)
In-Reply-To: <20081001084129.042880937@de.ibm.com>
Note that I know ~0 about s390 register layouts, but...
Martin Schwidefsky wrote:
> Index: quilt-2.6/arch/s390/kernel/ptrace.c
> ===================================================================
> --- quilt-2.6.orig/arch/s390/kernel/ptrace.c
> +++ quilt-2.6/arch/s390/kernel/ptrace.c
> @@ -639,40 +640,44 @@ long compat_arch_ptrace(struct task_stru
> }
> #endif
>
> -asmlinkage void
> -syscall_trace(struct pt_regs *regs, int entryexit)
> +asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
> {
...
> + if (unlikely(current->audit_context))
> + audit_syscall_entry(test_thread_flag(TIF_31BIT) ?
> + AUDIT_ARCH_S390 : AUDIT_ARCH_S390X,
> + regs->gprs[2], regs->orig_gpr2,
> + regs->gprs[3], regs->gprs[4],
> + regs->gprs[5]);
> + return ret;
> +}
According to the above, the syscall number is in regs->gprs[2] and the
1st syscall argument is in regs->orig_gpr2.
Then in:
> Index: quilt-2.6/arch/s390/include/asm/syscall.h
> ===================================================================
...
> +static inline long syscall_get_nr(struct task_struct *task,
> + struct pt_regs *regs)
> +{
> + if (regs->trap != __LC_SVC_OLD_PSW)
> + return -1;
> + return regs->gprs[2];
> +}
... according to the syscall_get_nr(), the syscall number is in
regs->gprs[2], which matches what is in arch/s390/kernel/ptrace.c ...
> +static inline void syscall_get_arguments(struct task_struct *task,
> + struct pt_regs *regs,
> + unsigned int i, unsigned int n,
> + unsigned long *args)
> +{
> + BUG_ON(i + n > 6);
> +#ifdef CONFIG_COMPAT
> + if (test_tsk_thread_flag(task, TIF_31BIT)) {
> + if (i + n == 6)
> + args[--n] = (u32) regs->args[0];
> + while (n-- > 0)
> + args[n] = (u32) regs->gprs[2 + i + n];
> + }
> +#endif
> + if (i + n == 6)
> + args[--n] = regs->args[0];
> + memcpy(args, ®s->gprs[2 + i], n * sizeof(args[0]));
> +}
> +
> +static inline void syscall_set_arguments(struct task_struct *task,
> + struct pt_regs *regs,
> + unsigned int i, unsigned int n,
> + const unsigned long *args)
> +{
> + BUG_ON(i + n > 6);
> + if (i + n == 6)
> + regs->args[0] = args[--n];
> + memcpy(®s->gprs[2 + i], args, n * sizeof(args[0]));
> +}
> +
> +#endif /* _ASM_SYSCALL_H */
According to syscall_get_arguments()/syscall_set_arguments(), the 1st
syscall argument is in regs->gprs[2], which *doesn't* match what is in
arch/s390/kernel/ptrace.c.
Is this correct, or should the 1st syscall argument be found in
regs->orig_gpr2 by syscall_get_arguments()/syscall_set_arguments()?
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
next prev parent reply other threads:[~2008-11-03 17:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 8:33 [patch 00/21] s390 patches for the 2.6.28 merge window Martin Schwidefsky
2008-10-01 8:33 ` [patch 01/21] qdio: speed up multicast traffic on full HiperSocket queue Martin Schwidefsky
2008-10-01 8:33 ` [patch 02/21] cio: move device unregistration to dedicated work queue Martin Schwidefsky
2008-10-01 8:33 ` [patch 03/21] cio: introduce purge function for /proc/cio_ignore Martin Schwidefsky
2008-10-01 8:33 ` [patch 04/21] cio: Update cio_ignore documentation Martin Schwidefsky
2008-10-01 8:33 ` [patch 05/21] cio: Exorcise cio_msg= from documentation Martin Schwidefsky
2008-10-01 8:33 ` [patch 06/21] bus_id -> dev_name conversions Martin Schwidefsky
2008-10-01 8:33 ` [patch 07/21] bus_id -> dev_set_name() changes Martin Schwidefsky
2008-10-01 8:33 ` [patch 08/21] more bus_id -> dev_name conversions Martin Schwidefsky
2008-10-01 8:33 ` [patch 09/21] Use s390_root_dev_* in kvm_virtio Martin Schwidefsky
2008-10-01 8:33 ` [patch 10/21] bus_id ->dev_name() conversions in qdio Martin Schwidefsky
2008-10-01 8:33 ` [patch 11/21] bus_id -> dev_set_name() for css and ccw busses Martin Schwidefsky
2008-10-01 8:33 ` [patch 12/21] cio: inline assembly cleanup Martin Schwidefsky
2008-10-01 8:33 ` [patch 13/21] qdio enhanced SIGA (iqdio) support Martin Schwidefsky
2008-10-01 8:33 ` [patch 14/21] s390: use sys_pause for 31bit pause entry point Martin Schwidefsky
2008-10-01 8:33 ` [patch 15/21] ptrace changes Martin Schwidefsky
2008-11-03 17:14 ` David Smith [this message]
2008-11-05 11:41 ` Martin Schwidefsky
2008-11-06 18:24 ` David Smith
2008-11-07 9:14 ` Martin Schwidefsky
2008-11-07 15:32 ` Martin Schwidefsky
2008-10-01 8:33 ` [patch 16/21] dcssblk: add >2G DCSSs support and stacked contiguous DCSSs support Martin Schwidefsky
2008-10-01 8:33 ` [patch 17/21] nohz: Fix __udelay Martin Schwidefsky
2008-10-01 8:33 ` [patch 18/21] Move private simple udelay function to arch/s390/lib/delay.c Martin Schwidefsky
2008-10-01 8:33 ` [patch 19/21] dasd: fix message flood for unsolicited interrupts Martin Schwidefsky
2008-10-01 8:33 ` [patch 20/21] xpram: per device block request queues Martin Schwidefsky
2008-10-01 8:33 ` [patch 21/21] Add ioctl support for EMC Symmetrix Subsystem Control I/O Martin Schwidefsky
2008-10-01 11:03 ` Christoph Hellwig
2008-10-01 11:17 ` Martin Schwidefsky
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=490F317C.9040603@redhat.com \
--to=dsmith@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schwidefsky@de.ibm.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