From 0d9e5f2daf6cd82829014e335028dc3e4f9c235a Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 29 Aug 2012 12:23:04 +0200 Subject: [PATCH] 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. --- ports/src/vancouver/main.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/src/vancouver/main.cc b/ports/src/vancouver/main.cc index 532773b04..3610c18a8 100644 --- a/ports/src/vancouver/main.cc +++ b/ports/src/vancouver/main.cc @@ -667,7 +667,7 @@ class Machine : public StaticReceiver 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 /** * 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 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"));