From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips <linux-mips@linux-mips.org>,
"Malov, Vlad" <Vlad.Malov@caviumnetworks.com>
Subject: Re: [PATCH] MIPS: Check the range of the syscall number for o32 syscall on 64bit kernel.
Date: Fri, 31 Oct 2008 14:17:36 +0000 (GMT) [thread overview]
Message-ID: <alpine.LFD.1.10.0810311410020.11348@ftp.linux-mips.org> (raw)
In-Reply-To: <490A4D3F.10700@caviumnetworks.com>
On Thu, 30 Oct 2008, David Daney wrote:
> @@ -260,16 +260,15 @@ bad_alignment:
> END(sys_sysmips)
>
> LEAF(sys_syscall)
> + .set noreorder
Please indent branch delay slot instructions by one space if using this
mode.
> subu t0, a0, __NR_O32_Linux # check syscall number
> - sltiu v0, t0, __NR_O32_Linux_syscalls + 1
> + beqz t0, einval # do not recurse
> + sltu v0, t0, __NR_O32_Linux_syscalls + 1
Why not sltiu? You do want to fit in the delay slot here. Besides you
should not need .set noreorder here -- GAS should be smart enough to swap
sltiu with beqz here (and then you can actually use sltu quite safely).
The rule of thumb is not to use .set noreorder unless absolutely necessary
(such as modifying one of the registers used by a branch instruction
immediately afterwards in its delay slot) as you have to take all the
pesky details of instruction scheduling into account, including but not
limited to the MIPS I load delay slots not everybody seems to be aware of.
Adjust for the other hunk accordingly.
Maciej
prev parent reply other threads:[~2008-11-01 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-31 0:11 [PATCH] MIPS: Check the range of the syscall number for o32 syscall on 64bit kernel David Daney
2008-10-31 0:47 ` David Daney
2008-10-31 14:17 ` Maciej W. Rozycki [this message]
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=alpine.LFD.1.10.0810311410020.11348@ftp.linux-mips.org \
--to=macro@linux-mips.org \
--cc=Vlad.Malov@caviumnetworks.com \
--cc=ddaney@caviumnetworks.com \
--cc=linux-mips@linux-mips.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