Re: Semaphore assembly-code bug

From: Linus Torvalds
Date: Fri Oct 29 2004 - 13:27:20 EST




On Fri, 29 Oct 2004, Andi Kleen wrote:
>
> > Richard, Jan, Andi? Or does it already exist somewhere?
>
> How about just using __attribute__((regparm(1))) ? Then the
> problem doesn't appear.

Yes, we could use regparm for all assembly. Right now "asmlinkage"
actually _disables_ regparm so that we always have the same calling
convention for assembly regardless of whether the rest of the kernel is
compiled with regparm or not, but we could certainly change that

#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))

to use "regparm(3)" instead. I guess it's stable these days, since we use
it for FASTCALL() and friends too.

> Would be faster too. It should work reliable on all supported compilers.

What's happens if there are more arguments than three? It happens for
several system calls - does gcc still consider the stack part of the thing
to be owned by the callee?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/