[Lguest] [patch][v2] cleanup hypercall code

Rusty Russell rusty at rustcorp.com.au
Wed Aug 22 17:30:41 EST 2007


On Mon, 2007-08-20 at 13:33 +0200, Jes Sorensen wrote:
> Hi,
> 
> Here's an updated version of the hypercall cleanup patch. I changed it
> so the hcall_args are a union in struct lguest_regs on i386 - also
> changed the e[a-d]x regs to be unsigned long as I presume they will be
> 64 bit on x86_64 - trying to reduce the breakage there.

Some of this patch was missing (the union change).  I stuck with a cast
for the moment, see below.

> The LG_GET_HCALL_ARGS I have kept as a macro. I tried turning it into
> an inline, but that releases a whole avalanche of circular dependencies,
> which I don't think is worth the hassle to get into.

Yeah, I lower-cased it since it has no side-effects.

I'm now wondering if anyone is going to do something other than pass
args in registers?  If not, we can do something like this in struct
lguest:

	/* The arguments for a hypercall are in registers. */
	union {
		struct hcall_args *hargs;
		struct lguest_regs *regs;
	};

An arch defines hcall_args and lguest_regs, so it can arrange them any
way it wants...

Thoughts?
Rusty.





More information about the Lguest mailing list