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

@ -63,11 +63,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 };
List<Vcpu> _vcpus { };
Cap_mapping _task_vcpu { true };
unsigned _id_alloc { 0 };

View File

@ -40,7 +40,7 @@ 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)
_heap(_constrained_md_ram_alloc, local_rm)
{
_cap_quota_guard().withdraw(Cap_quota{1});
@ -61,7 +61,7 @@ Vm_session_component::~Vm_session_component()
{
for (;Vcpu * vcpu = _vcpus.first();) {
_vcpus.remove(vcpu);
destroy(_slab, vcpu);
destroy(_heap, vcpu);
}
/* detach all regions */
@ -118,7 +118,7 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
/* allocate vCPU object */
Vcpu * vcpu = nullptr;
try {
vcpu = new (_slab) Vcpu(_constrained_md_ram_alloc,
vcpu = new (_heap) Vcpu(_constrained_md_ram_alloc,
_cap_quota_guard(),
Vcpu_id {_id_alloc});
@ -134,12 +134,12 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
});
} catch (int) {
if (vcpu)
destroy(_slab, vcpu);
destroy(_heap, vcpu);
return;
} catch (...) {
if (vcpu)
destroy(_slab, vcpu);
destroy(_heap, vcpu);
throw;
}