From: Shane McDonald <mcdonald.shane@gmail.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: ralf@linux-mips.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [PATCH 3/5] mips: sanitize restart logics
Date: Fri, 15 Oct 2010 22:24:44 -0600 [thread overview]
Message-ID: <AANLkTi=ZVzfoBixM8YdXa82FLAWyKcKjz0_qbo5ThuDa@mail.gmail.com> (raw)
In-Reply-To: <E1P0eK5-0006j5-4q@ZenIV.linux.org.uk>
On Tue, Sep 28, 2010 at 11:50 AM, Al Viro <viro@ftp.linux.org.uk> wrote:
>
> Put the original syscall number into ->regs[0] when we leave syscall
> with error. Use it in restart logics. Everything else will have
> it 0 since we pass through SAVE_SOME on all the ways in. Note that
> in places like bad_stack and inllegal_syscall we leave it 0 - it's
> not restartable.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Building 2.6.36-rc8 on a 32-bit mipsel system gives me
the following compile failure:
LD .tmp_vmlinux1
arch/mips/built-in.o:/home/shane/linux-mips.org/linux/arch/mips/kernel/scall32-o32.S:66:
undefined reference to `PR_R2'
arch/mips/built-in.o:/home/shane/linux-mips.org/linux/arch/mips/kernel/scall32-o32.S:66:
undefined reference to `PR_R2'
make: *** [.tmp_vmlinux1] Error 1
I tracked it down to this patch. In particular, I believe the change
to scall32-o32.S is causing the problem.
> diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
> index 17202bb..d3edb9f 100644
> --- a/arch/mips/kernel/scall32-o32.S
> +++ b/arch/mips/kernel/scall32-o32.S
> @@ -63,9 +63,9 @@ stack_done:
> sw t0, PT_R7(sp) # set error flag
> beqz t0, 1f
>
> + lw t1, PR_R2(sp) # syscall number
Should this be PT_R2(sp), rather than PR_R2(sp)?
> negu v0 # error
> - sw v0, PT_R0(sp) # set flag for syscall
> - # restarting
> + sw t1, PT_R0(sp) # save it for syscall restarting
> 1: sw v0, PT_R2(sp) # result
>
> o32_syscall_exit:
> @@ -104,9 +104,9 @@ syscall_trace_entry:
> sw t0, PT_R7(sp) # set error flag
> beqz t0, 1f
>
> + lw t1, PT_R2(sp) # syscall number
> negu v0 # error
> - sw v0, PT_R0(sp) # set flag for syscall
> - # restarting
> + sw t1, PT_R0(sp) # save it for syscall restarting
> 1: sw v0, PT_R2(sp) # result
>
> j syscall_exit
> @@ -170,7 +170,6 @@ stackargs:
> */
> bad_stack:
> negu v0 # error
> - sw v0, PT_R0(sp)
> sw v0, PT_R2(sp)
> li t0, 1 # set error flag
> sw t0, PT_R7(sp)
Changing PR_R2(sp) to PT_R2(sp) allows me to compile
and successfully boot 2.6.36-rc8. I'll whip up a quick patch
to make this change and submit it.
Shane
next prev parent reply other threads:[~2010-10-16 4:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 17:50 [PATCH 3/5] mips: sanitize restart logics Al Viro
2010-09-29 18:28 ` David Daney
2010-09-30 1:50 ` Maciej W. Rozycki
2010-10-08 5:36 ` Al Viro
2010-10-08 5:36 ` Al Viro
2010-10-16 0:25 ` Maciej W. Rozycki
2010-10-14 14:44 ` Ralf Baechle
2010-10-16 4:24 ` Shane McDonald [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-28 17:50 Al Viro
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='AANLkTi=ZVzfoBixM8YdXa82FLAWyKcKjz0_qbo5ThuDa@mail.gmail.com' \
--to=mcdonald.shane@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=viro@ftp.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).