Vancouver: Reserve VM memory region early

Reserve memory region for VM as early as possible before any other
memory allocation happens. Otherwise it could happen that heap
allocations will use part of the virtual region we require for the VM.
This commit is contained in:
Alexander Boettcher 2012-08-29 12:23:04 +02:00 committed by Norman Feske
parent dbbfab5e7b
commit 0d9e5f2daf

View File

@ -667,7 +667,7 @@ class Machine : public StaticReceiver<Machine>
Clock _clock;
Motherboard _motherboard;
TimeoutList<32, void> _timeouts;
Guest_memory _guest_memory;
Guest_memory &_guest_memory;
Boot_module_provider &_boot_modules;
public:
@ -900,13 +900,13 @@ class Machine : public StaticReceiver<Machine>
/**
* Constructor
*/
Machine(Boot_module_provider &boot_modules)
Machine(Boot_module_provider &boot_modules, Guest_memory &guest_memory)
:
_hip_rom("hypervisor_info_page"),
_hip(Genode::env()->rm_session()->attach(_hip_rom.dataspace())),
_clock(_hip->freq_tsc*1000),
_motherboard(&_clock, _hip),
_guest_memory(32*1024*1024 /* XXX hard-wired for now */),
_guest_memory(guest_memory),
_boot_modules(boot_modules)
{
_timeouts.init();
@ -1040,12 +1040,14 @@ class Machine : public StaticReceiver<Machine>
int main(int argc, char **argv)
{
static Guest_memory guest_memory(32*1024*1024 /* XXX hard-wired for now */);
Genode::printf("--- Vancouver VMM started ---\n");
static Boot_module_provider
boot_modules(Genode::config()->xml_node().sub_node("multiboot"));
static Machine machine(boot_modules);
static Machine machine(boot_modules, guest_memory);
machine.setup_devices(Genode::config()->xml_node().sub_node("machine"));