Re: [PATCH 2/3] x86: Pass in pt_regs pointer for syscalls that need it

From: Brian Gerst
Date: Wed Feb 11 2009 - 13:27:44 EST


On Wed, Feb 11, 2009 at 12:52 PM, H. Peter Anvin <hpa@xxxxxxxxxx> wrote:
> Brian Gerst wrote:
>> /*
>> + * For syscalls that need a pointer to the pt_regs struct (ie. fork).
>> + * The regs pointer is passed in %eax as the first argument. The
>> + * remaining function arguments remain on the stack.
>> + */
>> +#define ptregscall __attribute__((regparm(1)))
>
> I was looking a few weeks ago (still a work in progress, but I'm pretty
> close to having something working) at getting rid of asmlinkage and try
> to get everything onto regparm(3). Adding yet another calling
> convention seems to be a step in the wrong direction -- especially since
> regparm(1) and (2) are unlikely to have been well exercised and
> therefore are likely to attract gcc bugs.
>
> That does *not* mean in any way that I disapprove of the concept of
> accessing pt_regs via a pointer... quite on the contrary, I think it's
> the only sane thing to do. I would like to see it done without adding
> calling conventions, and preferrably killing some off.
>
> -hpa
>
>

I guess I could go back to extracting the args from the pt_regs struct
given just the pointer. How do you intend to handle system calls in
your changes (normal ones, not needing pt_regs)?

--
Brian Gerst
--
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/