Introduce "hcall" pointer to indicate pending hypercall.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Oct 2007 01:03:30 +0000 (11:03 +1000)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 23 Oct 2007 05:49:52 +0000 (15:49 +1000)
commitcc6d4fbcef328acdc9fa7023e69f39f753f72fe1
tree860672e7da1a3516e36dd40f962552451ef0bcf2
parent4614a3a3b638dfd7a67d0237944f6a76331af61d
Introduce "hcall" pointer to indicate pending hypercall.

Currently we look at the "trapnum" to see if the Guest wants a
hypercall.  But once the hypercall is done we have to reset trapnum to
a bogus value, otherwise if we exit to userspace and return, we'd run
the same hypercall twice (that was a nasty bug to find!).

This has two main effects:

1) When Jes's patch changes the hypercall args to be a generic "struct
   hcall_args" we simply change the type of "lg->hcall".  It's set by
   arch code, so if it has to copy args or something it can do so, and
   point "hcall" into lg->arch somewhere.

2) Async hypercalls only get run when an actual hypercall is pending.
   This simplfies the code a little and is a more logical semantic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/lguest/core.c
drivers/lguest/hypercalls.c
drivers/lguest/lg.h
drivers/lguest/x86/core.c