mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-30 14:14:31 +00:00
NOVA: fix placement of EC cap for recall
Put EC cap next to SM cap of Vcpu_dispatcher and not of the Vcpu. Thanks @parthy for pointing out the issue.
This commit is contained in:
parent
125d274bc7
commit
5fcdd61a13
@ -211,15 +211,15 @@ class Vcpu_thread : Genode::Thread<STACK_SIZE> {
|
|||||||
|
|
||||||
Genode::addr_t exc_base() { return tid().exc_pt_sel; }
|
Genode::addr_t exc_base() { return tid().exc_pt_sel; }
|
||||||
|
|
||||||
void start() {
|
void start(Genode::addr_t sel_ec) {
|
||||||
this->Thread_base::start();
|
this->Thread_base::start();
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request native EC thread cap and put it next to the
|
* Request native EC thread cap and put it next to the
|
||||||
* SM cap - see Vcpu_dispatcher->sel_sm_ec description
|
* SM cap - see Vcpu_dispatcher->sel_sm_ec description
|
||||||
*/
|
*/
|
||||||
addr_t sel_ec = tid().exc_pt_sel + Nova::SM_SEL_EC + 1;
|
|
||||||
|
|
||||||
Nova_cpu_connection cpu;
|
Nova_cpu_connection cpu;
|
||||||
/* Use selector next to SM cap to retrieve EC cap */
|
/* Use selector next to SM cap to retrieve EC cap */
|
||||||
@ -268,8 +268,6 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
|||||||
static void _free_sel(Nova::mword_t sel, Genode::size_t num_caps_log2 = 0) {
|
static void _free_sel(Nova::mword_t sel, Genode::size_t num_caps_log2 = 0) {
|
||||||
Genode::cap_selector_allocator()->free(sel, num_caps_log2); }
|
Genode::cap_selector_allocator()->free(sel, num_caps_log2); }
|
||||||
|
|
||||||
static Nova::mword_t _pd_sel() { return 0; }
|
|
||||||
|
|
||||||
static ::Utcb *_utcb_of_myself() {
|
static ::Utcb *_utcb_of_myself() {
|
||||||
return (::Utcb *)Genode::Thread_base::myself()->utcb(); }
|
return (::Utcb *)Genode::Thread_base::myself()->utcb(); }
|
||||||
|
|
||||||
@ -599,7 +597,7 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* let vCPU run */
|
/* let vCPU run */
|
||||||
_vcpu_thread.start();
|
_vcpu_thread.start(sel_sm_ec() + 1);
|
||||||
|
|
||||||
/* handle cpuid overrides */
|
/* handle cpuid overrides */
|
||||||
vcpu->executor.add(this, receive_static<CpuMessage>);
|
vcpu->executor.add(this, receive_static<CpuMessage>);
|
||||||
@ -632,7 +630,7 @@ class Vcpu_dispatcher : public Genode::Thread<STACK_SIZE>,
|
|||||||
* arguments for 'MessageHostOp' operations.
|
* arguments for 'MessageHostOp' operations.
|
||||||
*/
|
*/
|
||||||
Nova::mword_t sel_sm_ec() {
|
Nova::mword_t sel_sm_ec() {
|
||||||
return _vcpu_thread.exc_base() + Nova::SM_SEL_EC;
|
return tid().exc_pt_sel + Nova::SM_SEL_EC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user