vm_session: adjustments to work with seoul vmm

for foc, nova, sel4

Issue #3111
This commit is contained in:
Alexander Boettcher
2019-04-11 14:28:36 +02:00
committed by Christian Helmuth
parent 8950de5a89
commit cc64c43758
19 changed files with 302 additions and 187 deletions

View File

@ -74,11 +74,8 @@ class Genode::Vm_session_component
Rpc_entrypoint &_ep;
Con_ram_allocator _constrained_md_ram_alloc;
Sliced_heap _sliced_heap;
Slab _slab { max(sizeof(Vcpu), sizeof(Rm_region)),
4096 - Sliced_heap::meta_data_size(),
nullptr, &_sliced_heap };
Avl_region _map { &_slab };
Sliced_heap _heap;
Avl_region _map { &_heap };
addr_t _pd_sel { 0 };
unsigned _id_alloc { 0 };
unsigned _priority;

View File

@ -151,7 +151,7 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
return;
/* allocate vCPU object */
Vcpu &vcpu = *new (_slab) Vcpu(_constrained_md_ram_alloc,
Vcpu &vcpu = *new (_heap) Vcpu(_constrained_md_ram_alloc,
_cap_quota_guard(),
Vcpu_id {_id_alloc});
@ -169,7 +169,7 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
if (res != Nova::NOVA_OK) {
error("create_sm = ", res);
destroy(_slab, &vcpu);
destroy(_heap, &vcpu);
return;
}
@ -182,7 +182,7 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
if (res != Nova::NOVA_OK) {
error("create_ec = ", res);
destroy(_slab, &vcpu);
destroy(_heap, &vcpu);
return;
}
@ -204,7 +204,7 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
if (res != Nova::NOVA_OK)
{
error("map sm ", res, " ", _id_alloc);
destroy(_slab, &vcpu);
destroy(_heap, &vcpu);
return;
}
@ -283,8 +283,8 @@ Vm_session_component::Vm_session_component(Rpc_entrypoint &ep,
Cap_quota_guard(resources.cap_quota),
_ep(ep),
_constrained_md_ram_alloc(ram, _ram_quota_guard(), _cap_quota_guard()),
_sliced_heap(_constrained_md_ram_alloc, local_rm),
_priority(scale_priority(priority, "VM sesssion"))
_heap(_constrained_md_ram_alloc, local_rm),
_priority(scale_priority(priority, "VM session"))
{
_cap_quota_guard().withdraw(Cap_quota{1});
@ -312,7 +312,7 @@ Vm_session_component::~Vm_session_component()
{
for (;Vcpu * vcpu = _vcpus.first();) {
_vcpus.remove(vcpu);
destroy(_slab, vcpu);
destroy(_heap, vcpu);
}
/* detach all regions */

View File

@ -227,6 +227,7 @@ struct Vcpu {
if (state.ip.valid()) {
utcb.mtd |= Nova::Mtd::EIP;
utcb.ip = state.ip.value();
utcb.instr_len = state.ip_len.value();
}
if (state.dr7.valid()) {