Hi Julian,
Vancouver on NUL has a IMHO non obvious way of managing virtual memory. How does Vancouver on Genode allocate VM memory?
can you elaborate a bit more? Which part do you consider non-obvious in particular?
In general, Vancouver on Genode tries to use plain Genode mechanisms to manage its address space wherever possible. For example, for managing the guest-physical memory, Vancouver needs to manually populate the lower portion of its virtual address space (which is a shadow of the guest-physical memory). Consequently, we have to make sure that no other memory object ends up being attached to this virtual memory area. We do this by creating a managed dataspace (in fact, this is an RM session) and attach it at the lower part of Vancouver's address space. This way, this area will never used for something else.
If you are interested in the implementation, please take a look at the 'Guest_memory' class and the accompanying comments:
https://github.com/genodelabs/genode/blob/master/ports/src/vancouver/main.cc
That said, even though I think that the memory management is implemented in a clean way, is it certainly not obvious either. :-)
Cheers Norman