Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 10910222: [MIPS] Ignoring 4th parameter in a3 for pread64 system calls on MIPS. (Closed)

Created:
8 years, 3 months ago by petarj
Modified:
8 years, 3 months ago
CC:
chromium-reviews, Markus (顧孟勤)
Visibility:
Public.

Description

[MIPS] Ignoring 4th parameter in a3 for pread64 system calls on MIPS. Similar to ARM, MIPS also requires 64-bit parameters to be passed in even-odd register pairs. For pread64, MIPS ignores 4th argument and looks on stack for it. Issue discovered in NaCl development for MIPS. Committed on behalf of petarj@mips.com. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2275 TEST= used by nacl_helper_bootstrap Committed: https://code.google.com/p/linux-syscall-support/source/detail?r=13

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M lss/linux_syscall_support.h View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
petarj
Small change to lss to fix pread64 system calls on MIPS.
8 years, 3 months ago (2012-09-13 10:59:14 UTC) #1
Mark Seaborn
LGTM, though I don't know enough about MIPS to confirm whether this is correct. :-) ...
8 years, 3 months ago (2012-09-13 18:13:27 UTC) #2
petarj
On 2012/09/13 18:13:27, Mark Seaborn wrote: > LGTM, though I don't know enough about MIPS ...
8 years, 3 months ago (2012-09-13 18:40:18 UTC) #3
Mark Seaborn
On 2012/09/13 18:40:18, petarj wrote: > On 2012/09/13 18:13:27, Mark Seaborn wrote: > > LGTM, ...
8 years, 3 months ago (2012-09-15 03:48:45 UTC) #4
Mark Seaborn
On 13 September 2012 03:59, <petarj@mips.com> wrote: > Reviewers: Markus (顧孟勤), Mark Seaborn, > > ...
8 years, 1 month ago (2012-11-15 17:10:44 UTC) #5
Mark Seaborn
On 13 September 2012 03:59, <petarj@mips.com> wrote: > Reviewers: Markus (顧孟勤), Mark Seaborn, > > ...
8 years, 1 month ago (2012-11-15 17:10:46 UTC) #6
petarj
Hey Mark, How exactly does your environment look like? Note that you need at least ...
8 years, 1 month ago (2012-11-15 18:19:34 UTC) #7
petarj
Hey Mark, How exactly does your environment look like? Note that you need at least ...
8 years, 1 month ago (2012-11-15 18:19:36 UTC) #8
Mark Seaborn
On 15 November 2012 10:19, Jovanovic, Petar <petarj@mips.com> wrote: > Hey Mark, > > How ...
8 years, 1 month ago (2012-11-16 00:36:30 UTC) #9
Mark Seaborn
On 15 November 2012 10:19, Jovanovic, Petar <petarj@mips.com> wrote: > Hey Mark, > > How ...
8 years, 1 month ago (2012-11-16 00:36:30 UTC) #10
petarj
I do not understand how you invoked the error. I have mentioned to you for ...
8 years, 1 month ago (2012-11-16 01:13:14 UTC) #11
petarj
I do not understand how you invoked the error. I have mentioned to you for ...
8 years, 1 month ago (2012-11-16 01:13:16 UTC) #12
Mark Seaborn
On 15 November 2012 17:13, Jovanovic, Petar <petarj@mips.com> wrote: > I do not understand how ...
8 years, 1 month ago (2012-11-16 18:05:10 UTC) #13
Mark Seaborn
8 years, 1 month ago (2012-11-16 18:05:12 UTC) #14
On 15 November 2012 17:13, Jovanovic, Petar <petarj@mips.com> wrote:

>  I do not understand how you invoked the error. I have mentioned to you
> for your
> reference what I do on the top of the trunk and see no error.
>

Sorry, I was being stupid -- your reply obviously indicated you had tested
with the qemu-mips from the trusted toolchain build.

I realised what had happened was that I built the MIPS toolchain from a
checkout where I hadn't run "gclient sync" recently, so the MIPS QEMU patch
wasn't checked out, but the toolchain build didn't give an error about
that.  Here's a change to make it stricter:
http://codereview.chromium.org/11299042/

I looked at the kernel code and it's clear that it skips an argument:

SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t,
count,
        unsigned long, unused, unsigned long, a4, unsigned long, a5)
{
        return sys_pread64(fd, buf, count, merge_64(a4, a5));
}
(from arch/mips/kernel/linux32.c)

It's also clear that this is because syscalls follow the userland calling
convention that the first 4 args are in registers, and other args are on
the stack, and 64-bit arguments are not split between registers and stack.

Mark

Powered by Google App Engine
This is Rietveld 408576698