public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: "Rosendahl Viktor (Nokia-D/Helsinki)"
	<Viktor.Rosendahl@nokia.com>,
	ext Tony Lindgren <tony@atomide.com>,
	"Moiseichuk Leonid (Nokia-D/Helsinki)"
	<leonid.moiseichuk@nokia.com>,
	"Kallioinen Juha (Nokia-D/Helsinki)" <juha.kallioinen@nokia.com>,
	Siarhei Siamashka <siarhei.siamashka@nokia.com>,
	Eero Tamminen <eero.tamminen@nokia.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH] ARM fix syscall trace return value
Date: Tue, 17 Feb 2009 19:02:53 +0000	[thread overview]
Message-ID: <20090217190253.GA10322@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20090217181805.GA15788@Krystal>

On Tue, Feb 17, 2009 at 01:18:05PM -0500, Mathieu Desnoyers wrote:
> I am currently finding core bugs in the Linux kernel implementation of
> the ARM architecture. :-( e.g. return value not being sent to the
> syscall_trace function upon exit (upon which LTTng depends). (patch
> below)

Well then how can strace work?  The fact of the matter is that strace
can and does work, and so I suspect that the problem is not in the
kernel but whatever "LTTng" is trying to do.

> BTW, the patch below applies to 2.6.29-rc4.

And is wrong.

> Index: linux-omap-2.6/arch/arm/kernel/entry-common.S
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/kernel/entry-common.S	2009-02-17 16:58:14.000000000 +0000
> +++ linux-omap-2.6/arch/arm/kernel/entry-common.S	2009-02-17 17:24:33.000000000 +0000
> @@ -89,6 +89,7 @@
>  	mov	why, #1
>  	tst	r1, #_TIF_SYSCALL_TRACE		@ are we tracing syscalls?
>  	beq	ret_slow_syscall
> +	mov	r2, #0				@ fork returns 0 to the child

This may be incorrect.

>  	mov	r1, sp
>  	mov	r0, #1				@ trace exit [IP = 1]
>  	bl	syscall_trace
> @@ -292,7 +293,7 @@
>  
>  __sys_trace_return:
>  	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
> -	mov	r2, scno
> +	mov	r2, r0

This part is wrong.  'r2' *is* the syscall number.

The place to get the return value is by reading the registers, r0 to be
exact.  No other method is supported.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

  reply	other threads:[~2009-02-17 19:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 18:18 [PATCH] ARM fix syscall trace return value Mathieu Desnoyers
2009-02-17 19:02 ` Russell King [this message]
2009-02-17 19:22 ` Viktor Rosendahl
2009-02-17 19:30   ` Mathieu Desnoyers
2009-02-17 19:40     ` Russell King
2009-02-17 20:08       ` Mathieu Desnoyers

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=20090217190253.GA10322@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=Viktor.Rosendahl@nokia.com \
    --cc=eero.tamminen@nokia.com \
    --cc=juha.kallioinen@nokia.com \
    --cc=leonid.moiseichuk@nokia.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=siarhei.siamashka@nokia.com \
    --cc=tony@atomide.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