Skip to contentSkip to conversation

FUTEX_CMP_REQUEUE and 6-argument syscall

DISCUSSION Pete Zaitcev 5 participants 6 messages Jun 3, 2004 – Jun 4, 2004 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

Hi, Martin,

the following changeset adds an extra argument for sys_futex:
http://linux.bkbits.net:8080/linux-2.5/gnupatch@40bca55f9uSk3jznb3RD7ltnQvJKbA

So, now we have a syscall with 6 arguments. Do you have any suggestions how to handle it on s390? The main decision would be if we stick to the C calling convention and put a pointer to the list into %r7, or if we just put the argument into %r7 (thus precluding syscalls with 7 arguments for sure, but saving a get_user somewhere). After that we need to change arch/s390/kernel/entry.S:trace_svc, and the 31 bit compat wrapper.

I'm curious if any other architecture was caught out by this.

-- Pete

#1 lore raw
Quoted 9 lines · Pete Zaitcev

So, now we have a syscall with 6 arguments. Do you have any suggestions how to handle it on s390? The main decision would be if we stick to the C calling convention and put a pointer to the list into %r7, or if we just put the argument into %r7 (thus precluding syscalls with 7 arguments for sure, but saving a get_user somewhere). After that we need to change arch/s390/kernel/entry.S:trace_svc, and the 31 bit compat wrapper.

I'm curious if any other architecture was caught out by this.

6 is the limit on o32 MIPS where we pass 4 arguments in registers and two on the stack but it would be easy to extend that. On 64-bit kernels we only use upto 8 register arguments but no stack arguments ever so I hope we don't exceed that limit ever ...

Ralf

#2 lore raw
Quoted 6 lines · On Thu, 3 Jun 2004 20:13:45 +0200 Ralf Baechle <[email protected]> wrote:
Quoted 1 line

I'm curious if any other architecture was caught out by this.

6 is the limit on o32 MIPS where we pass 4 arguments in registers and two on the stack but it would be easy to extend that. On 64-bit kernels we only use upto 8 register arguments but no stack arguments ever so I hope we don't exceed that limit ever ...

6 is the limit on Sparc/Sparc64 as well, registers %o0 - %o5 carry arguments.

#3 lore raw
Quoted 7 lines · On Thu, 3 Jun 2004 14:26:30 -0700 "David S. Miller" <[email protected]> wrote:
Quoted 4 lines

6 is the limit on o32 MIPS where we pass 4 arguments in registers and two on the stack but it would be easy to extend that. On 64-bit kernels we only use upto 8 register arguments but no stack arguments ever so I hope we don't exceed that limit ever ...

6 is the limit on Sparc/Sparc64 as well, registers %o0 - %o5 carry arguments.

It seems that bumping the limit just to 6 would bring s390 in line with sparcs, this is why I even considered using %r7 to pass the argument itself instead of a pointer to stack. It's such a bother to have things in memory.

-- Pete

P.S. Ralf, et. al.: do not forget to keep me on the cc: list, please.

#4 lore raw
In reply to Pete Zaitcev
Quoted 1 line · Pete Zaitcev

I'm curious if any other architecture was caught out by this.

Six is currently the limit on ppc and ppc64. It would be possible to increase it to 7 fairly easily or 8 with a bit more trouble. Beyond that we would start getting arguments on the stack.

Paul.

#5 lore raw
Quoted 7 lines · Paul Mackerras
Quoted 1 line · Pete Zaitcev

I'm curious if any other architecture was caught out by this.

Six is currently the limit on ppc and ppc64. It would be possible to increase it to 7 fairly easily or 8 with a bit more trouble. Beyond that we would start getting arguments on the stack.

Six is also the current limit on ARM, and we have the possibility to go to 7 with some more stack mangling. However, 8 is more problematical - I suspect at that point we'll be in the arguments on user stack territory.

Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core