[Lguest] Sharing PTEs between host and lguest instance

Rusty Russell rusty at rustcorp.com.au
Wed Jan 29 17:36:28 EST 2014


Earlence Fernandes <earlenceferns at gmail.com> writes:
> I think what I'm saying is that how do I shared pages between a host
> process and a guest process, since at the end, both of them are processes
> on the host kernel.

Yes, it can be done.

We currently mmap the entire guest memory:

			guest_base = map_zeroed_pages(mem / getpagesize()
						      + DEVICE_PAGES);
			guest_limit = mem;
			guest_max = mem + DEVICE_PAGES*getpagesize();

You could mmap some other file too (eg. at the end) but make usre you
increase guest_limit, as that is what the kernel uses to prevent the
guest from accessing outside its allowed memory.

Cheers,
Rusty.


More information about the Lguest mailing list