mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
seoul: make vmm memory configurable
- document Genode specific configuration option
This commit is contained in:
parent
23ed5d3936
commit
d385749ead
@ -1,9 +1,32 @@
|
||||
Vancouver is a virtual machine monitor specifically developed for the use with
|
||||
the NOVA hypervisor. It virtualizes 32bit x86 PC hardware including various
|
||||
peripherals. The combination of NOVA and Vancouver is described in the
|
||||
following paper by Udo Steinberg and Bernhard Kauer:
|
||||
Seoul (formerly Vancouver) is a virtual machine monitor originally developed
|
||||
for the use with the NOVA hypervisor. Nowadays it is also available for seL4,
|
||||
for Fiasco.OC and for NOVA on Genode. Seoul virtualizes 32bit x86 PC hardware
|
||||
including various peripherals. The combination of NOVA and Vancouver (later
|
||||
Seoul) is described in the following paper by Udo Steinberg and Bernhard Kauer:
|
||||
|
||||
[http://os.inf.tu-dresden.de/papers_ps/steinberg_eurosys2010.pdf - NOVA: A Microhypervisor-Based Secure Virtualization Architecture]
|
||||
|
||||
The official project website is [http://hypervisor.org].
|
||||
The NOVA project website is [http://hypervisor.org]
|
||||
The latest <outdated> Seoul home is [https://github.com/TUD-OS/seoul]
|
||||
The Seoul version as used by Genode is [https://github.com/alex-ab/seoul], branch
|
||||
genode_<release>.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
<config width="1024" height="768" vmm_memory="10M" map_small="no"
|
||||
rdtsc_exit="no" vmm_vcpu_same_cpu="no">
|
||||
...
|
||||
</config>
|
||||
|
||||
* The width/height specify the maximum area announced to the guest for the
|
||||
framebuffer. The values are read once during boot of the VMM. The
|
||||
values shown above are the default values.
|
||||
* The vmm_memory value specify the amount of memory reserved for the Seoul VMM
|
||||
(so it is not available to the VM). The rest of the memory as specified in
|
||||
the Genode config is assigned to the VM.
|
||||
* map_small specifies whether just 4k pages should be used. Default is shown.
|
||||
* rdtsc_exit specifies whether the VM should exit on each rdtsc instruction.
|
||||
Default is shown.
|
||||
* vmm_vcpu_same_cpu specifies whether the main entrypoint should run on the
|
||||
same CPU as the first virtual CPU. Default is shown.
|
||||
|
@ -1332,44 +1332,42 @@ extern void heap_init_env(Genode::Heap *);
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
static Genode::Heap heap(env.ram(), env.rm());
|
||||
static Genode::Vm_connection vm_con(env, "Seoul vCPUs", Genode::Cpu_session::PRIORITY_LIMIT / 16);
|
||||
|
||||
Genode::addr_t vm_size = 0;
|
||||
bool map_small = false;
|
||||
bool rdtsc_exit = false;
|
||||
bool vmm_vcpu_same_cpu = false;
|
||||
static Genode::Vm_connection vm_con(env, "Seoul vCPUs",
|
||||
Genode::Cpu_session::PRIORITY_LIMIT / 16);
|
||||
|
||||
static Attached_rom_dataspace config(env, "config");
|
||||
|
||||
{
|
||||
Genode::log("--- Seoul VMM starting ---");
|
||||
Genode::log("--- Seoul VMM starting ---");
|
||||
|
||||
/* request max available memory */
|
||||
vm_size = env.pd().avail_ram().value;
|
||||
/* reserve some memory for the VMM */
|
||||
vm_size -= 10 * 1024 * 1024;
|
||||
/* calculate max memory for the VM */
|
||||
vm_size = vm_size & ~((1UL << Vmm::PAGE_SIZE_LOG2) - 1);
|
||||
Genode::Xml_node const node = config.xml();
|
||||
Genode::uint64_t const vmm_size = node.attribute_value("vmm_memory",
|
||||
Genode::Number_of_bytes(12 * 1024 * 1024));
|
||||
|
||||
/* read out whether VM and VMM should be colocated or not */
|
||||
try {
|
||||
map_small = config.xml().attribute_value("map_small", false);
|
||||
rdtsc_exit = config.xml().attribute_value("exit_on_rdtsc", false);
|
||||
vmm_vcpu_same_cpu = config.xml().attribute_value("vmm_vcpu_same_cpu", false);
|
||||
} catch (...) { }
|
||||
bool const map_small = node.attribute_value("map_small", false);
|
||||
bool const rdtsc_exit = node.attribute_value("exit_on_rdtsc", false);
|
||||
bool const vmm_vcpu_same_cpu = node.attribute_value("vmm_vcpu_same_cpu",
|
||||
false);
|
||||
|
||||
Genode::log(" using ", map_small ? "small": "large",
|
||||
" memory attachments for guest VM.");
|
||||
if (rdtsc_exit)
|
||||
Genode::log(" enabling VM exit on RDTSC.");
|
||||
}
|
||||
/* request max available memory */
|
||||
Genode::uint64_t vm_size = env.pd().avail_ram().value;
|
||||
/* reserve some memory for the VMM */
|
||||
vm_size -= vmm_size;
|
||||
/* calculate max memory for the VM */
|
||||
vm_size = vm_size & ~((1ULL << Vmm::PAGE_SIZE_LOG2) - 1);
|
||||
|
||||
Genode::log(" VMM memory ", Genode::Number_of_bytes(vmm_size));
|
||||
Genode::log(" using ", map_small ? "small": "large",
|
||||
" memory attachments for guest VM.");
|
||||
if (rdtsc_exit)
|
||||
Genode::log(" enabling VM exit on RDTSC.");
|
||||
|
||||
unsigned const width = node.attribute_value("width", 1024U);
|
||||
unsigned const height = node.attribute_value("height", 768U);
|
||||
|
||||
Genode::log(" framebuffer ", width, "x", height);
|
||||
|
||||
/* setup framebuffer memory for guest */
|
||||
static Nitpicker::Connection nitpicker { env };
|
||||
|
||||
unsigned width = config.xml().attribute_value("width", 1024U);
|
||||
unsigned height = config.xml().attribute_value("height", 768U);
|
||||
|
||||
static Nitpicker::Connection nitpicker { env };
|
||||
nitpicker.buffer(Framebuffer::Mode(width, height,
|
||||
Framebuffer::Mode::RGB565), false);
|
||||
|
||||
@ -1423,8 +1421,7 @@ void Component::construct(Genode::Env &env)
|
||||
|
||||
heap_init_env(&heap);
|
||||
|
||||
static Boot_module_provider
|
||||
boot_modules(config.xml().sub_node("multiboot"));
|
||||
static Boot_module_provider boot_modules(node.sub_node("multiboot"));
|
||||
|
||||
/* create the PC machine based on the configuration given */
|
||||
static Machine machine(env, heap, vm_con, boot_modules, guest_memory,
|
||||
@ -1444,7 +1441,7 @@ void Component::construct(Genode::Env &env)
|
||||
|
||||
vdisk.register_host_operations(machine.unsynchronized_motherboard());
|
||||
|
||||
machine.setup_devices(config.xml().sub_node("machine"), vcon);
|
||||
machine.setup_devices(node.sub_node("machine"), vcon);
|
||||
|
||||
Genode::log("\n--- Booting VM ---");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user