file-backed guest memory

Michael Riepe
2007-04-12T15:34:25Z

Hi!

This is just a (probably silly) idea I had the other day. Currently, the
guest's memory is allocated inside the kernel and exported to userspace
via mmap(). But wouldn't it also be possible to create a file in
userspace and pass its descriptor to kvm? If we also pass file offset
and length parameters for each memslot, all segments can (but need not)
reside in the same file. There would be a persistent snapshot of the
VM's physical memory, and it would enable the VM to page out the guest's
pages. One could also do strange things like mapping a portion of the
file several times, e.g. to emulate an architecture with incomplete
address decoding. Applications that absolutely want to use anonymous
memory could pass -1 as the fd, as they do with mmap(MAP_ANONYMOUS).

Comments?

--
Michael "Tired" Riepe <michael-0QoEqw4nQxo@public.gmane.org>
X-Tired: Each morning I get up I die a little