[Lguest] Forking Guest on lguest system.

Rusty Russell rusty at rustcorp.com.au
Mon Jan 17 12:02:25 EST 2011


On Sun, 9 Jan 2011 06:31:42 pm Nezer Zaidenberg wrote:
> Hello,
> 
> We would like to add hypercall for forking the guest on lguest subsystem.
> Our goal is to have two identical guests. (Our goal is to develop module for code coverage)
> 
> We added an hypercall to "fork-myself" (hypercall 20) and when we receive the hypercall (in the run_guest main loop) we exit to the launcher with a special return value.
> upon receiving this return value we fork the launcher process and copy the lguest structure.
> 
> We are then able to continue running in the original process but not the child. 
> 
> Our child hangs when it printks. It never gets beyond the first notify hypercall.

My guess: the copy-on-write pages from fork are deeply confusing the lguest
page_table code.  I think you should (1) drop the lguest page tables in both
the parent and child, and (2) write to all the pages in the fork()ed child
Launcher just to be sure they are duplicated.

In the longer term, mm notifiers would probably help with this, but for the
moment this should work around any issues?

Cheers,
Rusty.


More information about the Lguest mailing list