mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 11:10:24 +00:00
parent
14ef7a5312
commit
a8495a0dfe
@ -71,9 +71,10 @@ class Vmm::Vcpu_dispatcher : public T
|
|||||||
|
|
||||||
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
|
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
|
||||||
Cpu_session * cpu_session,
|
Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location)
|
Genode::Affinity::Location location,
|
||||||
|
const char * name = "vCPU dispatcher")
|
||||||
:
|
:
|
||||||
T(WEIGHT, "vCPU dispatcher", stack_size, location), _pd(pd)
|
T(WEIGHT, name, stack_size, location), _pd(pd)
|
||||||
{
|
{
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
@ -87,8 +88,9 @@ class Vmm::Vcpu_dispatcher : public T
|
|||||||
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
|
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
|
||||||
Cpu_session * cpu_session,
|
Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
X attr, void *(*start_routine) (void *), void *arg)
|
X attr, void *(*start_routine) (void *), void *arg,
|
||||||
: T(attr, start_routine, arg, stack_size, "vCPU dispatcher", nullptr, location),
|
const char * name = "vCPU dispatcher")
|
||||||
|
: T(attr, start_routine, arg, stack_size, name, nullptr, location),
|
||||||
_pd(pd)
|
_pd(pd)
|
||||||
{
|
{
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
@ -86,7 +86,8 @@ bool create_emt_vcpu(pthread_t * thread, size_t stack_size,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id,
|
||||||
|
const char * name)
|
||||||
{
|
{
|
||||||
/* no hardware acceleration support */
|
/* no hardware acceleration support */
|
||||||
return false;
|
return false;
|
||||||
|
@ -706,7 +706,8 @@ bool create_emt_vcpu(pthread_t * thread, size_t stack_size,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id,
|
||||||
|
const char * name)
|
||||||
{
|
{
|
||||||
/* No support for multiple vcpus */
|
/* No support for multiple vcpus */
|
||||||
return false;
|
return false;
|
||||||
|
@ -292,7 +292,7 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
{
|
{
|
||||||
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
|
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
|
||||||
|
|
||||||
@ -304,12 +304,12 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
|
|||||||
if (hip->has_feature_vmx())
|
if (hip->has_feature_vmx())
|
||||||
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
|
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
|
||||||
arg, cpu_session, location,
|
arg, cpu_session, location,
|
||||||
cpu_id);
|
cpu_id, name);
|
||||||
|
|
||||||
if (hip->has_feature_svm())
|
if (hip->has_feature_svm())
|
||||||
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
|
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
|
||||||
arg, cpu_session, location,
|
arg, cpu_session, location,
|
||||||
cpu_id);
|
cpu_id, name);
|
||||||
|
|
||||||
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));
|
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));
|
||||||
|
|
||||||
|
@ -728,11 +728,12 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
|
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
|
||||||
cpu_session, location,
|
cpu_session, location,
|
||||||
attr ? *attr : 0, start_routine, arg),
|
attr ? *attr : 0, start_routine, arg,
|
||||||
|
name),
|
||||||
_vcpu(cpu_session, location),
|
_vcpu(cpu_session, location),
|
||||||
_ec_sel(Genode::cap_map()->insert()),
|
_ec_sel(Genode::cap_map()->insert()),
|
||||||
_irq_win(false),
|
_irq_win(false),
|
||||||
|
@ -88,10 +88,10 @@ class Vcpu_handler_svm : public Vcpu_handler
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
||||||
location, cpu_id)
|
location, cpu_id, name)
|
||||||
{
|
{
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
|
@ -162,10 +162,10 @@ class Vcpu_handler_vmx : public Vcpu_handler
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
||||||
location, cpu_id)
|
location, cpu_id, name)
|
||||||
{
|
{
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id);
|
unsigned int cpu_id,
|
||||||
|
const char * name);
|
||||||
|
|
||||||
|
|
||||||
uint64_t genode_cpu_hz();
|
uint64_t genode_cpu_hz();
|
||||||
|
@ -95,7 +95,7 @@ static int create_thread(pthread_t *thread, const pthread_attr_t *attr,
|
|||||||
Genode::Affinity::Location location(space.location_of_index(cpu_id));
|
Genode::Affinity::Location location(space.location_of_index(cpu_id));
|
||||||
|
|
||||||
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
|
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
|
||||||
cpu_session, location, cpu_id))
|
cpu_session, location, cpu_id, rtthread->szName))
|
||||||
return 0;
|
return 0;
|
||||||
/*
|
/*
|
||||||
* The virtualization layer had no need to setup the EMT
|
* The virtualization layer had no need to setup the EMT
|
||||||
|
@ -551,7 +551,7 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
{
|
{
|
||||||
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
|
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
|
||||||
|
|
||||||
@ -563,12 +563,12 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
|
|||||||
if (hip->has_feature_vmx())
|
if (hip->has_feature_vmx())
|
||||||
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
|
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
|
||||||
arg, cpu_session, location,
|
arg, cpu_session, location,
|
||||||
cpu_id);
|
cpu_id, name);
|
||||||
|
|
||||||
if (hip->has_feature_svm())
|
if (hip->has_feature_svm())
|
||||||
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
|
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
|
||||||
arg, cpu_session, location,
|
arg, cpu_session, location,
|
||||||
cpu_id);
|
cpu_id, name);
|
||||||
|
|
||||||
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));
|
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));
|
||||||
|
|
||||||
|
@ -730,11 +730,12 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
|
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
|
||||||
cpu_session, location,
|
cpu_session, location,
|
||||||
attr ? *attr : 0, start_routine, arg),
|
attr ? *attr : 0, start_routine,
|
||||||
|
arg, name),
|
||||||
_vcpu(cpu_session, location),
|
_vcpu(cpu_session, location),
|
||||||
_ec_sel(Genode::cap_map()->insert()),
|
_ec_sel(Genode::cap_map()->insert()),
|
||||||
_irq_win(false),
|
_irq_win(false),
|
||||||
|
@ -88,10 +88,10 @@ class Vcpu_handler_svm : public Vcpu_handler
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
||||||
location, cpu_id)
|
location, cpu_id, name)
|
||||||
{
|
{
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
|
@ -170,10 +170,10 @@ class Vcpu_handler_vmx : public Vcpu_handler
|
|||||||
void *(*start_routine) (void *), void *arg,
|
void *(*start_routine) (void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id)
|
unsigned int cpu_id, const char * name)
|
||||||
:
|
:
|
||||||
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
|
||||||
location, cpu_id)
|
location, cpu_id, name)
|
||||||
{
|
{
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
|
|||||||
void *(*start_routine)(void *), void *arg,
|
void *(*start_routine)(void *), void *arg,
|
||||||
Genode::Cpu_session * cpu_session,
|
Genode::Cpu_session * cpu_session,
|
||||||
Genode::Affinity::Location location,
|
Genode::Affinity::Location location,
|
||||||
unsigned int cpu_id);
|
unsigned int cpu_id,
|
||||||
|
const char * name);
|
||||||
|
|
||||||
|
|
||||||
uint64_t genode_cpu_hz();
|
uint64_t genode_cpu_hz();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user