vancouver: keep one cap_session
Cap_sessions and portals created via the sessions are nowadays freed up during c++ object destruction. Because of that the exception portals for a vCPU thread get be revoked as soon as the cap_session object leaves its scope. Keep one cap_session for the whole lifetime of the vmm to avoid disappearing exception portals. Related to #582.
This commit is contained in:
parent
47cc2f8590
commit
b0d23abaa7
|
@ -349,6 +349,8 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Genode::Cap_connection _cap_session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pointer to corresponding VCPU model
|
* Pointer to corresponding VCPU model
|
||||||
*/
|
*/
|
||||||
|
@ -794,12 +796,11 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
/* Create the portal at the desired selector index */
|
/* Create the portal at the desired selector index */
|
||||||
Cap_connection conn;
|
_cap_session.rcv_window(exc_base + EV);
|
||||||
conn.rcv_window(exc_base + EV);
|
|
||||||
|
|
||||||
Native_capability thread(tid().ec_sel);
|
Native_capability thread(tid().ec_sel);
|
||||||
Native_capability handler =
|
Native_capability handler =
|
||||||
conn.alloc(thread, (Nova::mword_t)portal_entry,
|
_cap_session.alloc(thread, (Nova::mword_t)portal_entry,
|
||||||
mtd.value());
|
mtd.value());
|
||||||
|
|
||||||
if (!handler.valid() ||
|
if (!handler.valid() ||
|
||||||
|
@ -812,7 +813,6 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
||||||
Vcpu_dispatcher(VCpu *vcpu,
|
Vcpu_dispatcher(VCpu *vcpu,
|
||||||
Guest_memory &guest_memory,
|
Guest_memory &guest_memory,
|
||||||
Motherboard &motherboard,
|
Motherboard &motherboard,
|
||||||
Genode::Cap_connection &cap_session,
|
|
||||||
bool has_svm,
|
bool has_svm,
|
||||||
bool has_vmx)
|
bool has_vmx)
|
||||||
:
|
:
|
||||||
|
@ -1086,11 +1086,9 @@ class Machine : public StaticReceiver<Machine>
|
||||||
if (verbose_debug)
|
if (verbose_debug)
|
||||||
Logging::printf("OP_VCPU_CREATE_BACKEND\n");
|
Logging::printf("OP_VCPU_CREATE_BACKEND\n");
|
||||||
|
|
||||||
static Genode::Cap_connection cap_session;
|
|
||||||
|
|
||||||
Vcpu_dispatcher *vcpu_dispatcher =
|
Vcpu_dispatcher *vcpu_dispatcher =
|
||||||
new Vcpu_dispatcher(msg.vcpu, _guest_memory,
|
new Vcpu_dispatcher(msg.vcpu, _guest_memory,
|
||||||
_motherboard, cap_session,
|
_motherboard,
|
||||||
_hip->has_svm(), _hip->has_vmx());
|
_hip->has_svm(), _hip->has_vmx());
|
||||||
|
|
||||||
msg.value = vcpu_dispatcher->sel_sm_ec();
|
msg.value = vcpu_dispatcher->sel_sm_ec();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user