mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
nova: remove obsolete local vcpu case
Seoul was the last user of Vcpu_same_pd
This commit is contained in:
parent
fd682cd470
commit
73e671893b
@ -30,7 +30,6 @@ struct Genode::Native_thread
|
|||||||
|
|
||||||
addr_t ec_sel { 0 }; /* selector for execution context */
|
addr_t ec_sel { 0 }; /* selector for execution context */
|
||||||
addr_t exc_pt_sel { 0 }; /* base of event portal window */
|
addr_t exc_pt_sel { 0 }; /* base of event portal window */
|
||||||
bool vcpu { false }; /* true if thread is a virtual CPU */
|
|
||||||
addr_t initial_ip { 0 }; /* initial IP of local thread */
|
addr_t initial_ip { 0 }; /* initial IP of local thread */
|
||||||
|
|
||||||
/* receive window for capability selectors received at the server side */
|
/* receive window for capability selectors received at the server side */
|
||||||
@ -56,7 +55,6 @@ struct Genode::Native_thread
|
|||||||
|
|
||||||
Native_thread() : ec_sel(INVALID_INDEX),
|
Native_thread() : ec_sel(INVALID_INDEX),
|
||||||
exc_pt_sel(INVALID_INDEX),
|
exc_pt_sel(INVALID_INDEX),
|
||||||
vcpu(false),
|
|
||||||
initial_ip(0) { }
|
initial_ip(0) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,11 +121,7 @@ int Platform_thread::start(void *ip, void *sp)
|
|||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vcpu()) {
|
if (!vcpu())
|
||||||
if (!remote_pd())
|
|
||||||
res = map_pagefault_portal(*_pager, _pager->exc_pt_sel_client(),
|
|
||||||
_sel_exc_base, _pd->pd_sel(), utcb);
|
|
||||||
} else
|
|
||||||
res = map_thread_portals(*_pager, _sel_exc_base, utcb);
|
res = map_thread_portals(*_pager, _sel_exc_base, utcb);
|
||||||
|
|
||||||
if (res != NOVA_OK) {
|
if (res != NOVA_OK) {
|
||||||
|
@ -154,9 +154,7 @@ void Thread::start()
|
|||||||
try {
|
try {
|
||||||
Nova_native_cpu::Thread_type thread_type;
|
Nova_native_cpu::Thread_type thread_type;
|
||||||
|
|
||||||
if (native_thread().vcpu)
|
if (global)
|
||||||
thread_type = Nova_native_cpu::Thread_type::VCPU;
|
|
||||||
else if (global)
|
|
||||||
thread_type = Nova_native_cpu::Thread_type::GLOBAL;
|
thread_type = Nova_native_cpu::Thread_type::GLOBAL;
|
||||||
else
|
else
|
||||||
thread_type = Nova_native_cpu::Thread_type::LOCAL;
|
thread_type = Nova_native_cpu::Thread_type::LOCAL;
|
||||||
@ -187,12 +185,10 @@ void Thread::start()
|
|||||||
|
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
if (!native_thread().vcpu) {
|
|
||||||
/* default: we don't accept any mappings or translations */
|
/* default: we don't accept any mappings or translations */
|
||||||
Utcb * utcb_obj = reinterpret_cast<Utcb *>(utcb());
|
Utcb * utcb_obj = reinterpret_cast<Utcb *>(utcb());
|
||||||
utcb_obj->crd_rcv = Obj_crd();
|
utcb_obj->crd_rcv = Obj_crd();
|
||||||
utcb_obj->crd_xlt = Obj_crd();
|
utcb_obj->crd_xlt = Obj_crd();
|
||||||
}
|
|
||||||
|
|
||||||
if (global)
|
if (global)
|
||||||
/* request creation of SC to let thread run*/
|
/* request creation of SC to let thread run*/
|
||||||
|
@ -128,20 +128,6 @@ class Vmm::Vcpu_dispatcher : public T
|
|||||||
* virtualization event.
|
* virtualization event.
|
||||||
*/
|
*/
|
||||||
void entry() override { }
|
void entry() override { }
|
||||||
|
|
||||||
/**
|
|
||||||
* Return capability selector of the VCPU's SM and EC
|
|
||||||
*
|
|
||||||
* The returned number corresponds to the VCPU's semaphore selector.
|
|
||||||
* The consecutive number corresponds to the EC. The number returned by
|
|
||||||
* this function is used by the VMM code as a unique identifier of the
|
|
||||||
* VCPU. I.e., it gets passed as arguments for 'MessageHostOp'
|
|
||||||
* operations.
|
|
||||||
*/
|
|
||||||
Nova::mword_t sel_sm_ec()
|
|
||||||
{
|
|
||||||
return T::native_thread().exc_pt_sel + Nova::SM_SEL_EC;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _INCLUDE__VMM__VCPU_DISPATCHER_H_ */
|
#endif /* _INCLUDE__VMM__VCPU_DISPATCHER_H_ */
|
||||||
|
@ -104,8 +104,7 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread
|
|||||||
cpu_thread.start(0, 0);
|
cpu_thread.start(0, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request native EC thread cap and put it next to the
|
* Request native EC thread cap used for recalling vCPU
|
||||||
* SM cap - see Vcpu_dispatcher->sel_sm_ec description
|
|
||||||
*/
|
*/
|
||||||
addr_t const pager_pt = _exc_pt_sel + Nova::PT_SEL_PAGE_FAULT;
|
addr_t const pager_pt = _exc_pt_sel + Nova::PT_SEL_PAGE_FAULT;
|
||||||
request_native_ec_cap(pager_pt, sel_ec);
|
request_native_ec_cap(pager_pt, sel_ec);
|
||||||
@ -120,59 +119,4 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread
|
|||||||
Genode::addr_t exc_base() override { return _exc_pt_sel; }
|
Genode::addr_t exc_base() override { return _exc_pt_sel; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Vmm::Vcpu_same_pd : public Vmm::Vcpu_thread, Genode::Thread
|
|
||||||
{
|
|
||||||
enum { WEIGHT = Genode::Cpu_session::Weight::DEFAULT_WEIGHT };
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Vcpu_same_pd(Cpu_connection * cpu_connection,
|
|
||||||
Genode::Affinity::Location location,
|
|
||||||
Genode::Capability<Genode::Pd_session>,
|
|
||||||
Genode::size_t stack_size)
|
|
||||||
:
|
|
||||||
Thread(WEIGHT, "vCPU", stack_size, Type::NORMAL, cpu_connection, location)
|
|
||||||
{
|
|
||||||
/* release pre-allocated selectors of Thread */
|
|
||||||
Genode::cap_map().remove(native_thread().exc_pt_sel, Nova::NUM_INITIAL_PT_LOG2);
|
|
||||||
|
|
||||||
/* allocate correct number of selectors */
|
|
||||||
this->native_thread().exc_pt_sel = cap_map().insert(Nova::NUM_INITIAL_VCPU_PT_LOG2);
|
|
||||||
|
|
||||||
/* tell generic thread code that this becomes a vCPU */
|
|
||||||
this->native_thread().vcpu = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
~Vcpu_same_pd()
|
|
||||||
{
|
|
||||||
using namespace Nova;
|
|
||||||
|
|
||||||
revoke(Nova::Obj_crd(this->native_thread().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2));
|
|
||||||
cap_map().remove(this->native_thread().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2, false);
|
|
||||||
|
|
||||||
/* allocate selectors for ~Thread */
|
|
||||||
this->native_thread().exc_pt_sel = cap_map().insert(Nova::NUM_INITIAL_PT_LOG2);
|
|
||||||
}
|
|
||||||
|
|
||||||
addr_t exc_base() override { return this->native_thread().exc_pt_sel; }
|
|
||||||
|
|
||||||
void start(Genode::addr_t sel_ec) override
|
|
||||||
{
|
|
||||||
this->Thread::start();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Request native EC thread cap and put it next to the
|
|
||||||
* SM cap - see Vcpu_dispatcher->sel_sm_ec description
|
|
||||||
*/
|
|
||||||
addr_t const pager_pt = exc_base() + Nova::PT_SEL_PAGE_FAULT;
|
|
||||||
request_native_ec_cap(pager_pt, sel_ec);
|
|
||||||
|
|
||||||
/* solely needed for vcpu to request native ec cap - drop it */
|
|
||||||
Nova::revoke(Nova::Obj_crd(pager_pt, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void entry() override { }
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* _INCLUDE__VMM__VCPU_THREAD_H_ */
|
#endif /* _INCLUDE__VMM__VCPU_THREAD_H_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user