Re: [PATCH 1/23] Make register values available to panic notifiers

From: David Miller
Date: Wed Apr 14 2010 - 19:58:55 EST


From: David Howells <dhowells@xxxxxxxxxx>
Date: Thu, 15 Apr 2010 00:52:14 +0100

> David VomLehn <dvomlehn@xxxxxxxxx> wrote:
>
>> > Can the use of va_start() clobber lots of registers, thereby rendering the
>> > exercise pointless on some arches?
>> >
>>
>> The implementations I'm familiar with only need one or two registers. What
>> it *does* do is to force the contents of registers being used to pass
>> argument values onto the stack. This is roughly what gcc does for asm()
>> statements when you tell it registers are clobbered.
>
> How about something like Sparc, where you can pass up to 8 arguments (if I
> remember correctly) in registers. I'm not sure how Sparc handles varargs
> functions, though.

6 arguments, and all arguments get popped onto the stack into the
argument save area when doing varargs so you can access them as an
array.

Stack looks like:

struct register_window window;
unsigned long args[...];
--
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/