mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-19 08:36:49 +00:00
hw: rename Kernel::Vm object to Kernel::Vcpu
Moreover this commit does: * rename *_vm syscall to *_vcpu equivalents * add missing inclusion guard * fix several inclusion guards * rename certain compilation units containing "vm" Fix #5512
This commit is contained in:
parent
5a8a38dbf4
commit
b09a496a5d
@ -44,8 +44,8 @@ namespace Kernel {
|
||||
constexpr Call_arg call_id_timeout() { return 19; }
|
||||
constexpr Call_arg call_id_timeout_max_us() { return 20; }
|
||||
constexpr Call_arg call_id_time() { return 21; }
|
||||
constexpr Call_arg call_id_run_vm() { return 22; }
|
||||
constexpr Call_arg call_id_pause_vm() { return 23; }
|
||||
constexpr Call_arg call_id_run_vcpu() { return 22; }
|
||||
constexpr Call_arg call_id_pause_vcpu() { return 23; }
|
||||
constexpr Call_arg call_id_suspend() { return 24; }
|
||||
|
||||
|
||||
@ -218,8 +218,6 @@ namespace Kernel {
|
||||
|
||||
/**
|
||||
* Get cache line size
|
||||
*
|
||||
* \param vm pointer to vm kernel object
|
||||
*/
|
||||
inline size_t cache_line_size()
|
||||
{
|
||||
@ -412,22 +410,22 @@ namespace Kernel {
|
||||
/**
|
||||
* Execute a virtual-machine (again)
|
||||
*
|
||||
* \param vm pointer to VM kernel object
|
||||
* \param vcpu capability of vcpu kernel object
|
||||
*/
|
||||
inline void run_vm(capid_t const cap)
|
||||
inline void run_vcpu(capid_t const cap)
|
||||
{
|
||||
call(call_id_run_vm(), cap);
|
||||
call(call_id_run_vcpu(), cap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stop execution of a virtual-machine
|
||||
*
|
||||
* \param vm pointer to VM kernel object
|
||||
* \param vcpu capability of vcpu kernel object
|
||||
*/
|
||||
inline void pause_vm(capid_t const cap)
|
||||
inline void pause_vcpu(capid_t const cap)
|
||||
{
|
||||
call(call_id_pause_vm(), cap);
|
||||
call(call_id_pause_vcpu(), cap);
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SPEC__ARNDALE__VM_STATE_H_
|
||||
#define _INCLUDE__SPEC__ARNDALE__VM_STATE_H_
|
||||
#ifndef _INCLUDE__SPEC__ARM__CPU__VCPU_STATE_VIRTUALIZATION_H_
|
||||
#define _INCLUDE__SPEC__ARM__CPU__VCPU_STATE_VIRTUALIZATION_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <cpu/cpu_state.h>
|
||||
@ -85,4 +85,4 @@ struct Genode::Vcpu_state : Genode::Cpu_state_modes
|
||||
} irqs {};
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__SPEC__ARNDALE__VM_STATE_H_ */
|
||||
#endif /* _INCLUDE__SPEC__ARM__CPU__VCPU_STATE_VIRTUALIZATION_H_ */
|
||||
|
@ -5,14 +5,14 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022-2024 Genode Labs GmbH
|
||||
* Copyright (C) 2022-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SPEC__PC__VM_STATE_H_
|
||||
#define _INCLUDE__SPEC__PC__VM_STATE_H_
|
||||
#ifndef _INCLUDE__SPEC__X86_64__CPU__VCPU_STATE_VIRTUALIZATION_H_
|
||||
#define _INCLUDE__SPEC__X86_64__CPU__VCPU_STATE_VIRTUALIZATION_H_
|
||||
|
||||
#include <base/internal/page_size.h>
|
||||
/* x86 CPU state */
|
||||
@ -39,4 +39,4 @@ namespace Genode {
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__SPEC__PC__VM_STATE_H_ */
|
||||
#endif /* _INCLUDE__SPEC__X86_64__CPU__VCPU_STATE_VIRTUALIZATION_H_ */
|
||||
|
@ -10,7 +10,7 @@ SRC_CC += spec/arm/cortex_a9_cpu.cc
|
||||
SRC_CC += spec/arm/cortex_a9_global_timer.cc
|
||||
SRC_CC += spec/arm/gicv2.cc
|
||||
SRC_CC += spec/arm/kernel/mutex.cc
|
||||
SRC_CC += kernel/vm_thread_off.cc
|
||||
SRC_CC += kernel/vcpu_thread_off.cc
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
|
||||
# include less specific configuration
|
||||
|
@ -2,10 +2,10 @@ REP_INC_DIR += src/core/board/virt_qemu_arm_v7a
|
||||
REP_INC_DIR += src/core/spec/arm/virtualization
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += kernel/vcpu_thread_on.cc
|
||||
SRC_CC += spec/arm/generic_timer.cc
|
||||
SRC_CC += spec/arm/gicv2.cc
|
||||
SRC_CC += spec/arm_v7/virtualization/kernel/vm.cc
|
||||
SRC_CC += spec/arm_v7/virtualization/kernel/vcpu.cc
|
||||
SRC_CC += spec/arm/virtualization/gicv2.cc
|
||||
SRC_CC += spec/arm/virtualization/platform_services.cc
|
||||
SRC_CC += spec/arm/virtualization/vm_session_component.cc
|
||||
|
@ -2,9 +2,9 @@ REP_INC_DIR += src/core/board/virt_qemu_arm_v8a
|
||||
REP_INC_DIR += src/core/spec/arm/virtualization
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += kernel/vcpu_thread_on.cc
|
||||
SRC_CC += spec/arm/gicv3.cc
|
||||
SRC_CC += spec/arm_v8/virtualization/kernel/vm.cc
|
||||
SRC_CC += spec/arm_v8/virtualization/kernel/vcpu.cc
|
||||
SRC_CC += spec/arm/virtualization/platform_services.cc
|
||||
SRC_CC += spec/arm/virtualization/vm_session_component.cc
|
||||
SRC_CC += vm_session_common.cc
|
||||
|
@ -19,8 +19,8 @@ SRC_S += spec/x86_64/exception_vector.s
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
SRC_CC += kernel/mutex.cc
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += spec/x86_64/virtualization/kernel/vm.cc
|
||||
SRC_CC += kernel/vcpu_thread_on.cc
|
||||
SRC_CC += spec/x86_64/virtualization/kernel/vcpu.cc
|
||||
SRC_CC += spec/x86_64/virtualization/kernel/svm.cc
|
||||
SRC_CC += spec/x86_64/virtualization/kernel/vmx.cc
|
||||
SRC_CC += spec/x86_64/pic.cc
|
||||
|
@ -49,7 +49,7 @@ namespace Board {
|
||||
|
||||
namespace Kernel {
|
||||
class Cpu;
|
||||
class Vm;
|
||||
class Vcpu;
|
||||
};
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ struct Board::Vcpu_context
|
||||
|
||||
virtual ~Vm_irq() {};
|
||||
|
||||
virtual void handle(Kernel::Vm &vm, unsigned irq);
|
||||
virtual void handle(Kernel::Vcpu &vcpu, unsigned irq);
|
||||
|
||||
void occurred() override;
|
||||
};
|
||||
@ -77,7 +77,7 @@ struct Board::Vcpu_context
|
||||
{
|
||||
Pic_maintainance_irq(Kernel::Cpu &);
|
||||
|
||||
void handle(Kernel::Vm &, unsigned) override { }
|
||||
void handle(Kernel::Vcpu&, unsigned) override { }
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*
|
||||
* \brief Parts of the kernel interface that are restricted to core
|
||||
* \author Martin stein
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2014-03-15
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2014-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -31,7 +32,7 @@ namespace Kernel {
|
||||
class Thread;
|
||||
class Signal_receiver;
|
||||
class Signal_context;
|
||||
class Vm;
|
||||
class Vcpu;
|
||||
class User_irq;
|
||||
using Native_utcb = Genode::Native_utcb;
|
||||
using Cpu_state = Genode::Cpu_state;
|
||||
@ -54,8 +55,8 @@ namespace Kernel {
|
||||
constexpr Call_arg call_id_new_signal_context() { return 111; }
|
||||
constexpr Call_arg call_id_delete_signal_context() { return 112; }
|
||||
constexpr Call_arg call_id_delete_signal_receiver() { return 113; }
|
||||
constexpr Call_arg call_id_new_vm() { return 114; }
|
||||
constexpr Call_arg call_id_delete_vm() { return 117; }
|
||||
constexpr Call_arg call_id_new_vcpu() { return 114; }
|
||||
constexpr Call_arg call_id_delete_vcpu() { return 117; }
|
||||
constexpr Call_arg call_id_new_irq() { return 118; }
|
||||
constexpr Call_arg call_id_delete_irq() { return 119; }
|
||||
constexpr Call_arg call_id_ack_irq() { return 120; }
|
||||
|
@ -1,3 +1,16 @@
|
||||
/*
|
||||
* \brief Kernel object identities and references
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2012-11-30
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <kernel/object.h>
|
||||
#include <kernel/pd.h>
|
||||
|
||||
@ -45,9 +58,9 @@ Object::Object(Pd &obj)
|
||||
{ }
|
||||
|
||||
|
||||
Object::Object(Vm &obj)
|
||||
Object::Object(Vcpu &obj)
|
||||
:
|
||||
_type { VM },
|
||||
_type { VCPU },
|
||||
_obj { (void *)&obj }
|
||||
{ }
|
||||
|
||||
@ -101,12 +114,12 @@ namespace Kernel {
|
||||
return reinterpret_cast<Thread *>(_obj);
|
||||
}
|
||||
|
||||
template <> Vm *Object::obj<Vm>() const
|
||||
template <> Vcpu *Object::obj<Vcpu>() const
|
||||
{
|
||||
if (_type != VM)
|
||||
if (_type != VCPU)
|
||||
return nullptr;
|
||||
|
||||
return reinterpret_cast<Vm *>(_obj);
|
||||
return reinterpret_cast<Vcpu *>(_obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2012-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -35,7 +35,7 @@ namespace Kernel {
|
||||
class Thread;
|
||||
class Signal_context;
|
||||
class Signal_receiver;
|
||||
class Vm;
|
||||
class Vcpu;
|
||||
|
||||
/**
|
||||
* Base class of all Kernel objects
|
||||
@ -85,7 +85,7 @@ class Kernel::Object : private Object_identity_list
|
||||
{
|
||||
private:
|
||||
|
||||
enum Type { THREAD, PD, SIGNAL_RECEIVER, SIGNAL_CONTEXT, IRQ, VM };
|
||||
enum Type { THREAD, PD, SIGNAL_RECEIVER, SIGNAL_CONTEXT, IRQ, VCPU };
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
@ -108,7 +108,7 @@ class Kernel::Object : private Object_identity_list
|
||||
Object(Signal_receiver &obj);
|
||||
Object(Signal_context &obj);
|
||||
Object(Pd &obj);
|
||||
Object(Vm &obj);
|
||||
Object(Vcpu &obj);
|
||||
|
||||
~Object();
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2013-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -844,8 +844,8 @@ void Thread::_call()
|
||||
case call_id_timeout(): _call_timeout(); return;
|
||||
case call_id_timeout_max_us(): _call_timeout_max_us(); return;
|
||||
case call_id_time(): _call_time(); return;
|
||||
case call_id_run_vm(): _call_run_vm(); return;
|
||||
case call_id_pause_vm(): _call_pause_vm(); return;
|
||||
case call_id_run_vcpu(): _call_run_vcpu(); return;
|
||||
case call_id_pause_vcpu(): _call_pause_vcpu(); return;
|
||||
default:
|
||||
/* check wether this is a core thread */
|
||||
if (_type != CORE) {
|
||||
@ -886,8 +886,8 @@ void Thread::_call()
|
||||
return;
|
||||
case call_id_delete_signal_context(): _call_delete<Signal_context>(); return;
|
||||
case call_id_delete_signal_receiver(): _call_delete<Signal_receiver>(); return;
|
||||
case call_id_new_vm(): _call_new_vm(); return;
|
||||
case call_id_delete_vm(): _call_delete_vm(); return;
|
||||
case call_id_new_vcpu(): _call_new_vcpu(); return;
|
||||
case call_id_delete_vcpu(): _call_delete_vcpu(); return;
|
||||
case call_id_pause_thread(): _call_pause_thread(); return;
|
||||
case call_id_new_irq(): _call_new_irq(); return;
|
||||
case call_id_delete_irq(): _call_delete<User_irq>(); return;
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*
|
||||
* \brief Kernel backend for execution contexts in userland
|
||||
* \author Martin Stein
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2012-11-30
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2012-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -289,10 +290,10 @@ class Kernel::Thread : private Kernel::Object, public Cpu_context, private Timeo
|
||||
void _call_submit_signal();
|
||||
void _call_ack_signal();
|
||||
void _call_kill_signal_context();
|
||||
void _call_new_vm();
|
||||
void _call_delete_vm();
|
||||
void _call_run_vm();
|
||||
void _call_pause_vm();
|
||||
void _call_new_vcpu();
|
||||
void _call_delete_vcpu();
|
||||
void _call_run_vcpu();
|
||||
void _call_pause_vcpu();
|
||||
void _call_pager();
|
||||
void _call_new_irq();
|
||||
void _call_irq_mode();
|
||||
|
@ -1,19 +1,20 @@
|
||||
/*
|
||||
* \brief Kernel backend for virtual machines
|
||||
* \author Martin Stein
|
||||
* \author Benjamin Lamowski
|
||||
* \author Benjamin Lamowski
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2013-10-30
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013-2023 Genode Labs GmbH
|
||||
* Copyright (C) 2013-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _CORE__KERNEL__VM_H_
|
||||
#define _CORE__KERNEL__VM_H_
|
||||
#ifndef _CORE__KERNEL__VCPU_H_
|
||||
#define _CORE__KERNEL__VCPU_H_
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/cpu.h>
|
||||
@ -28,11 +29,11 @@ namespace Kernel {
|
||||
/**
|
||||
* Kernel backend for a virtual machine
|
||||
*/
|
||||
class Vm;
|
||||
class Vcpu;
|
||||
}
|
||||
|
||||
|
||||
class Kernel::Vm : private Kernel::Object, public Cpu_context
|
||||
class Kernel::Vcpu : private Kernel::Object, public Cpu_context
|
||||
{
|
||||
public:
|
||||
|
||||
@ -49,8 +50,8 @@ class Kernel::Vm : private Kernel::Object, public Cpu_context
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Vm(Vm const &);
|
||||
Vm &operator = (Vm const &);
|
||||
Vcpu(Vcpu const &);
|
||||
Vcpu &operator = (Vcpu const &);
|
||||
|
||||
enum Scheduler_state { ACTIVE, INACTIVE };
|
||||
|
||||
@ -79,13 +80,13 @@ class Kernel::Vm : private Kernel::Object, public Cpu_context
|
||||
* \param state initial CPU state
|
||||
* \param context signal for VM exceptions other than interrupts
|
||||
*/
|
||||
Vm(Irq::Pool & user_irq_pool,
|
||||
Cpu & cpu,
|
||||
Genode::Vcpu_data & data,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id);
|
||||
Vcpu(Irq::Pool &user_irq_pool,
|
||||
Cpu &cpu,
|
||||
Genode::Vcpu_data &data,
|
||||
Kernel::Signal_context &context,
|
||||
Identity &id);
|
||||
|
||||
~Vm();
|
||||
~Vcpu();
|
||||
|
||||
/**
|
||||
* Inject an interrupt to this VM
|
||||
@ -105,36 +106,37 @@ class Kernel::Vm : private Kernel::Object, public Cpu_context
|
||||
*
|
||||
* \retval cap id when successful, otherwise invalid cap id
|
||||
*/
|
||||
static capid_t syscall_create(Core::Kernel_object<Vm> &vm,
|
||||
unsigned cpu,
|
||||
void * const data,
|
||||
capid_t const signal_context_id,
|
||||
Identity &id)
|
||||
static capid_t syscall_create(Core::Kernel_object<Vcpu> &vcpu,
|
||||
unsigned cpu,
|
||||
void * const data,
|
||||
capid_t const signal_context_id,
|
||||
Identity &id)
|
||||
{
|
||||
return (capid_t)call(call_id_new_vm(), (Call_arg)&vm, (Call_arg)cpu,
|
||||
return (capid_t)call(call_id_new_vcpu(), (Call_arg)&vcpu, (Call_arg)cpu,
|
||||
(Call_arg)data, (Call_arg)&id, signal_context_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destruct a virtual-machine
|
||||
*
|
||||
* \param vm pointer to vm kernel object
|
||||
* \param vcpu pointer to vcpu kernel object
|
||||
*
|
||||
* \retval 0 when successful, otherwise !=0
|
||||
*/
|
||||
static void syscall_destroy(Core::Kernel_object<Vm> & vm) {
|
||||
call(call_id_delete_vm(), (Call_arg) &vm); }
|
||||
static void syscall_destroy(Core::Kernel_object<Vcpu> & vcpu) {
|
||||
call(call_id_delete_vcpu(), (Call_arg) &vcpu); }
|
||||
|
||||
Object &kernel_object() { return _kernel_object; }
|
||||
|
||||
/****************
|
||||
** Vm_session **
|
||||
****************/
|
||||
|
||||
/******************
|
||||
** Vcpu_session **
|
||||
******************/
|
||||
|
||||
void run();
|
||||
|
||||
void pause();
|
||||
|
||||
|
||||
/*****************
|
||||
** Cpu_context **
|
||||
*****************/
|
||||
@ -143,4 +145,4 @@ class Kernel::Vm : private Kernel::Object, public Cpu_context
|
||||
void proceed() override;
|
||||
};
|
||||
|
||||
#endif /* _CORE__KERNEL__VM_H_ */
|
||||
#endif /* _CORE__KERNEL__VCPU_H_ */
|
21
repos/base-hw/src/core/kernel/vcpu_thread_off.cc
Normal file
21
repos/base-hw/src/core/kernel/vcpu_thread_off.cc
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* \brief Kernel backend for Vcpus when having no virtualization
|
||||
* \author Martin Stein
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2013-09-15
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/thread.h>
|
||||
|
||||
void Kernel::Thread::_call_new_vcpu() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_delete_vcpu() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_run_vcpu() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_pause_vcpu() { user_arg_0(-1); }
|
@ -13,10 +13,10 @@
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/thread.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <kernel/cpu.h>
|
||||
|
||||
void Kernel::Thread::_call_new_vm()
|
||||
void Kernel::Thread::_call_new_vcpu()
|
||||
{
|
||||
Signal_context * context =
|
||||
pd().cap_tree().find<Signal_context>((capid_t)user_arg_5());
|
||||
@ -25,42 +25,42 @@ void Kernel::Thread::_call_new_vm()
|
||||
return;
|
||||
}
|
||||
|
||||
_call_new<Vm>(_user_irq_pool, _cpu_pool.cpu((unsigned)user_arg_2()),
|
||||
_call_new<Vcpu>(_user_irq_pool, _cpu_pool.cpu((unsigned)user_arg_2()),
|
||||
*(Board::Vcpu_data*)user_arg_3(),
|
||||
*context, *(Vm::Identity*)user_arg_4());
|
||||
*context, *(Vcpu::Identity*)user_arg_4());
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::_call_delete_vm() { _call_delete<Vm>(); }
|
||||
void Kernel::Thread::_call_delete_vcpu() { _call_delete<Vcpu>(); }
|
||||
|
||||
|
||||
void Kernel::Thread::_call_run_vm()
|
||||
void Kernel::Thread::_call_run_vcpu()
|
||||
{
|
||||
Object_identity_reference * ref = pd().cap_tree().find((capid_t)user_arg_1());
|
||||
Vm * vm = ref ? ref->object<Vm>() : nullptr;
|
||||
Vcpu * vcpu = ref ? ref->object<Vcpu>() : nullptr;
|
||||
|
||||
if (!vm) {
|
||||
Genode::raw("Invalid VM cap");
|
||||
if (!vcpu) {
|
||||
Genode::raw("Invalid Vcpu cap");
|
||||
user_arg_0(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
vm->run();
|
||||
vcpu->run();
|
||||
user_arg_0(0);
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::_call_pause_vm()
|
||||
void Kernel::Thread::_call_pause_vcpu()
|
||||
{
|
||||
Object_identity_reference * ref = pd().cap_tree().find((capid_t)user_arg_1());
|
||||
Vm * vm = ref ? ref->object<Vm>() : nullptr;
|
||||
Vcpu * vcpu = ref ? ref->object<Vcpu>() : nullptr;
|
||||
|
||||
if (!vm) {
|
||||
Genode::raw("Invalid VM cap");
|
||||
if (!vcpu) {
|
||||
Genode::raw("Invalid Vcpu cap");
|
||||
user_arg_0(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
vm->pause();
|
||||
vcpu->pause();
|
||||
user_arg_0(0);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
* \brief Kernel backend for VMs when having no virtualization
|
||||
* \author Martin Stein
|
||||
* \date 2013-09-15
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/thread.h>
|
||||
|
||||
void Kernel::Thread::_call_new_vm() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_delete_vm() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_run_vm() { user_arg_0(-1); }
|
||||
void Kernel::Thread::_call_pause_vm() { user_arg_0(-1); }
|
@ -38,7 +38,7 @@ namespace Board {
|
||||
|
||||
namespace Kernel {
|
||||
class Cpu;
|
||||
class Vm;
|
||||
class Vcpu;
|
||||
};
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ struct Board::Vcpu_context
|
||||
|
||||
virtual ~Vm_irq() { };
|
||||
|
||||
virtual void handle(Kernel::Vm &vm, unsigned irq);
|
||||
virtual void handle(Kernel::Vcpu &vcpu, unsigned irq);
|
||||
|
||||
void occurred() override;
|
||||
};
|
||||
@ -66,7 +66,7 @@ struct Board::Vcpu_context
|
||||
{
|
||||
Pic_maintainance_irq(Kernel::Cpu &);
|
||||
|
||||
void handle(Kernel::Vm &, unsigned) override { }
|
||||
void handle(Kernel::Vcpu&, unsigned) override { }
|
||||
};
|
||||
|
||||
|
||||
|
@ -15,17 +15,17 @@
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <cpu/vcpu_state_trustzone.h>
|
||||
|
||||
using namespace Kernel;
|
||||
|
||||
|
||||
Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
Cpu & cpu,
|
||||
Genode::Vcpu_data & data,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id)
|
||||
Vcpu::Vcpu(Irq::Pool &user_irq_pool,
|
||||
Cpu &cpu,
|
||||
Genode::Vcpu_data &data,
|
||||
Kernel::Signal_context &context,
|
||||
Identity &id)
|
||||
:
|
||||
Kernel::Object { *this },
|
||||
Cpu_context(cpu, Scheduler::Priority::min(), 0),
|
||||
@ -42,10 +42,10 @@ Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
}
|
||||
|
||||
|
||||
Vm::~Vm() {}
|
||||
Vcpu::~Vcpu() {}
|
||||
|
||||
|
||||
void Vm::exception(Genode::Cpu_state&)
|
||||
void Vcpu::exception(Genode::Cpu_state&)
|
||||
{
|
||||
switch(_state.cpu_exception) {
|
||||
case Genode::Cpu_state::INTERRUPT_REQUEST: [[fallthrough]];
|
||||
@ -68,7 +68,7 @@ bool secure_irq(unsigned const i);
|
||||
extern "C" void monitor_mode_enter_normal_world(Genode::Vcpu_state&, void*);
|
||||
|
||||
|
||||
void Vm::proceed()
|
||||
void Vcpu::proceed()
|
||||
{
|
||||
unsigned const irq = _state.irq_injection;
|
||||
if (irq) {
|
||||
@ -84,14 +84,14 @@ void Vm::proceed()
|
||||
}
|
||||
|
||||
|
||||
void Vm::run()
|
||||
void Vcpu::run()
|
||||
{
|
||||
if (_scheduled != ACTIVE) Cpu_context::_activate();
|
||||
_scheduled = ACTIVE;
|
||||
}
|
||||
|
||||
|
||||
void Vm::pause()
|
||||
void Vcpu::pause()
|
||||
{
|
||||
if (_cpu().id() != Cpu::executing_id()) {
|
||||
Genode::error("vCPU pause called from remote core.");
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2023 Genode Labs GmbH
|
||||
* Copyright (C) 2015-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#include <platform_pd.h>
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <kernel/main.h>
|
||||
#include <spec/arm_v7/virtualization/hypervisor.h>
|
||||
|
||||
@ -95,15 +95,15 @@ Board::Vcpu_context::Vm_irq::Vm_irq(unsigned const irq, Cpu & cpu)
|
||||
{ }
|
||||
|
||||
|
||||
void Board::Vcpu_context::Vm_irq::handle(Vm & vm, unsigned irq) {
|
||||
vm.inject_irq(irq); }
|
||||
void Board::Vcpu_context::Vm_irq::handle(Vcpu &vcpu, unsigned irq) {
|
||||
vcpu.inject_irq(irq); }
|
||||
|
||||
|
||||
void Board::Vcpu_context::Vm_irq::occurred()
|
||||
{
|
||||
Vm *vm = dynamic_cast<Vm*>(&_cpu.current_context());
|
||||
if (!vm) Genode::raw("VM interrupt while VM is not runnning!");
|
||||
else handle(*vm, _irq_nr);
|
||||
Vcpu *vcpu = dynamic_cast<Vcpu*>(&_cpu.current_context());
|
||||
if (!vcpu) Genode::raw("Vcpu interrupt while Vcpu is not runnning!");
|
||||
else handle(*vcpu, _irq_nr);
|
||||
}
|
||||
|
||||
|
||||
@ -133,11 +133,11 @@ void Board::Vcpu_context::Virtual_timer_irq::disable()
|
||||
}
|
||||
|
||||
|
||||
Kernel::Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
Cpu & cpu,
|
||||
Genode::Vcpu_data & data,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id)
|
||||
Kernel::Vcpu::Vcpu(Irq::Pool &user_irq_pool,
|
||||
Cpu &cpu,
|
||||
Genode::Vcpu_data &data,
|
||||
Kernel::Signal_context &context,
|
||||
Identity &id)
|
||||
:
|
||||
Kernel::Object { *this },
|
||||
Cpu_context(cpu, Scheduler::Priority::min(), 0),
|
||||
@ -154,7 +154,7 @@ Kernel::Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
}
|
||||
|
||||
|
||||
Kernel::Vm::~Vm()
|
||||
Kernel::Vcpu::~Vcpu()
|
||||
{
|
||||
Cpu::Ttbr_64bit::access_t vttbr =
|
||||
Cpu::Ttbr_64bit::Ba::masked((Cpu::Ttbr_64bit::access_t)_id.table);
|
||||
@ -163,7 +163,7 @@ Kernel::Vm::~Vm()
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Vm::exception(Genode::Cpu_state&)
|
||||
void Kernel::Vcpu::exception(Genode::Cpu_state&)
|
||||
{
|
||||
switch(_state.cpu_exception) {
|
||||
case Genode::Cpu_state::INTERRUPT_REQUEST:
|
||||
@ -181,7 +181,7 @@ void Kernel::Vm::exception(Genode::Cpu_state&)
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Vm::proceed()
|
||||
void Kernel::Vcpu::proceed()
|
||||
{
|
||||
if (_state.timer.irq) _vcpu_context.vtimer_irq.enable();
|
||||
|
||||
@ -205,13 +205,13 @@ void Kernel::Vm::proceed()
|
||||
}
|
||||
|
||||
|
||||
void Vm::run()
|
||||
void Vcpu::run()
|
||||
{
|
||||
if (_scheduled != ACTIVE) Cpu_context::_activate();
|
||||
_scheduled = ACTIVE;
|
||||
}
|
||||
|
||||
void Vm::pause()
|
||||
void Vcpu::pause()
|
||||
{
|
||||
if (_cpu().id() != Cpu::executing_id()) {
|
||||
Genode::error("vCPU pause called from remote core.");
|
||||
@ -221,7 +221,7 @@ void Vm::pause()
|
||||
}
|
||||
|
||||
|
||||
void Vm::inject_irq(unsigned irq)
|
||||
void Vcpu::inject_irq(unsigned irq)
|
||||
{
|
||||
_state.irqs.last_irq = irq;
|
||||
pause();
|
@ -20,14 +20,14 @@
|
||||
#include <map_local.h>
|
||||
#include <platform_pd.h>
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <kernel/main.h>
|
||||
|
||||
#include <spec/arm_v8/virtualization/hypervisor.h>
|
||||
|
||||
using Genode::addr_t;
|
||||
using Kernel::Cpu;
|
||||
using Kernel::Vm;
|
||||
using Kernel::Vcpu;
|
||||
|
||||
|
||||
static Genode::Vcpu_state & host_context(Cpu & cpu)
|
||||
@ -70,15 +70,15 @@ Board::Vcpu_context::Vm_irq::Vm_irq(unsigned const irq, Cpu & cpu)
|
||||
{ }
|
||||
|
||||
|
||||
void Board::Vcpu_context::Vm_irq::handle(Vm & vm, unsigned irq) {
|
||||
vm.inject_irq(irq); }
|
||||
void Board::Vcpu_context::Vm_irq::handle(Vcpu &vcpu, unsigned irq) {
|
||||
vcpu.inject_irq(irq); }
|
||||
|
||||
|
||||
void Board::Vcpu_context::Vm_irq::occurred()
|
||||
{
|
||||
Vm *vm = dynamic_cast<Vm*>(&_cpu.current_context());
|
||||
if (!vm) Genode::raw("VM interrupt while VM is not runnning!");
|
||||
else handle(*vm, _irq_nr);
|
||||
Vcpu *vcpu = dynamic_cast<Vcpu*>(&_cpu.current_context());
|
||||
if (!vcpu) Genode::raw("VM interrupt while VM is not runnning!");
|
||||
else handle(*vcpu, _irq_nr);
|
||||
}
|
||||
|
||||
|
||||
@ -108,11 +108,11 @@ void Board::Vcpu_context::Virtual_timer_irq::disable()
|
||||
}
|
||||
|
||||
|
||||
Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
Cpu & cpu,
|
||||
Genode::Vcpu_data & data,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id)
|
||||
Vcpu::Vcpu(Irq::Pool &user_irq_pool,
|
||||
Cpu &cpu,
|
||||
Genode::Vcpu_data &data,
|
||||
Kernel::Signal_context &context,
|
||||
Identity &id)
|
||||
:
|
||||
Kernel::Object { *this },
|
||||
Cpu_context(cpu, Scheduler::Priority::min(), 0),
|
||||
@ -156,7 +156,7 @@ Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
}
|
||||
|
||||
|
||||
Vm::~Vm()
|
||||
Vcpu::~Vcpu()
|
||||
{
|
||||
Cpu::Vttbr_el2::access_t vttbr_el2 =
|
||||
Cpu::Vttbr_el2::Ba::masked((Cpu::Vttbr_el2::access_t)_id.table);
|
||||
@ -165,7 +165,7 @@ Vm::~Vm()
|
||||
}
|
||||
|
||||
|
||||
void Vm::exception(Genode::Cpu_state&)
|
||||
void Vcpu::exception(Genode::Cpu_state&)
|
||||
{
|
||||
switch (_state.exception_type) {
|
||||
case Cpu::IRQ_LEVEL_EL0: [[fallthrough]];
|
||||
@ -192,7 +192,7 @@ void Vm::exception(Genode::Cpu_state&)
|
||||
}
|
||||
|
||||
|
||||
void Vm::proceed()
|
||||
void Vcpu::proceed()
|
||||
{
|
||||
if (_state.timer.irq) _vcpu_context.vtimer_irq.enable();
|
||||
|
||||
@ -212,14 +212,14 @@ void Vm::proceed()
|
||||
}
|
||||
|
||||
|
||||
void Vm::run()
|
||||
void Vcpu::run()
|
||||
{
|
||||
if (_scheduled != ACTIVE) Cpu_context::_activate();
|
||||
_scheduled = ACTIVE;
|
||||
}
|
||||
|
||||
|
||||
void Vm::pause()
|
||||
void Vcpu::pause()
|
||||
{
|
||||
if (_cpu().id() != Cpu::executing_id()) {
|
||||
Genode::error("vCPU pause called from remote core.");
|
||||
@ -229,7 +229,7 @@ void Vm::pause()
|
||||
}
|
||||
|
||||
|
||||
void Vm::inject_irq(unsigned irq)
|
||||
void Vcpu::inject_irq(unsigned irq)
|
||||
{
|
||||
_state.irqs.last_irq = irq;
|
||||
pause();
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2024 Genode Labs GmbH
|
||||
* Copyright (C) 2015-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/* base-hw includes */
|
||||
#include <hw_native_vcpu/hw_native_vcpu.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
|
||||
/* core includes */
|
||||
#include <phys_allocated.h>
|
||||
@ -37,15 +37,15 @@ class Core::Vcpu : public Rpc_object<Vm_session::Native_vcpu, Vcpu>
|
||||
uint8_t _[Vcpu_data::size()];
|
||||
};
|
||||
|
||||
Kernel::Vm::Identity &_id;
|
||||
Rpc_entrypoint &_ep;
|
||||
Vcpu_data _vcpu_data { };
|
||||
Kernel_object<Kernel::Vm> _kobj { };
|
||||
Accounted_ram_allocator &_ram;
|
||||
Ram_allocator::Result _ds;
|
||||
Local_rm &_local_rm;
|
||||
Affinity::Location _location;
|
||||
Phys_allocated<Data_pages> _vcpu_data_pages;
|
||||
Kernel::Vcpu::Identity &_id;
|
||||
Rpc_entrypoint &_ep;
|
||||
Vcpu_data _vcpu_data { };
|
||||
Kernel_object<Kernel::Vcpu> _kobj { };
|
||||
Accounted_ram_allocator &_ram;
|
||||
Ram_allocator::Result _ds;
|
||||
Local_rm &_local_rm;
|
||||
Affinity::Location _location;
|
||||
Phys_allocated<Data_pages> _vcpu_data_pages;
|
||||
|
||||
constexpr size_t vcpu_state_size()
|
||||
{
|
||||
@ -55,7 +55,7 @@ class Core::Vcpu : public Rpc_object<Vm_session::Native_vcpu, Vcpu>
|
||||
|
||||
public:
|
||||
|
||||
Vcpu(Kernel::Vm::Identity &id,
|
||||
Vcpu(Kernel::Vcpu::Identity &id,
|
||||
Rpc_entrypoint &ep,
|
||||
Accounted_ram_allocator &ram,
|
||||
Local_rm &local_rm,
|
||||
@ -127,7 +127,7 @@ class Core::Vcpu : public Rpc_object<Vm_session::Native_vcpu, Vcpu>
|
||||
|
||||
if (!_kobj.create(cpu, (void *)&_vcpu_data,
|
||||
Capability_space::capid(handler), _id))
|
||||
warning("Cannot instantiate vm kernel object, invalid signal context?");
|
||||
warning("Cannot instantiate vcpu kernel object, invalid signal context?");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -15,11 +15,8 @@
|
||||
#ifndef _CORE__SPEC__PC__VIRTUALIZATION__BOARD_H_
|
||||
#define _CORE__SPEC__PC__VIRTUALIZATION__BOARD_H_
|
||||
|
||||
/* base-hw core includes */
|
||||
#include <kernel/configuration.h>
|
||||
#include <kernel/irq.h>
|
||||
#include <session/session.h>
|
||||
|
||||
#include <cpu.h>
|
||||
#include <cpu/vcpu_state_virtualization.h>
|
||||
#include <hw/spec/x86_64/x86_64.h>
|
||||
#include <spec/x86_64/virtualization/svm.h>
|
||||
@ -44,12 +41,6 @@ namespace Board {
|
||||
};
|
||||
|
||||
|
||||
namespace Kernel {
|
||||
class Cpu;
|
||||
class Vm;
|
||||
};
|
||||
|
||||
|
||||
struct Board::Vcpu_context
|
||||
{
|
||||
enum class Init_state {
|
||||
|
@ -23,7 +23,7 @@
|
||||
using namespace Genode;
|
||||
|
||||
using Kernel::Cpu;
|
||||
using Kernel::Vm;
|
||||
using Kernel::Vcpu;
|
||||
using Board::Vmcb;
|
||||
using Board::Vmcb_buf;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <platform_pd.h>
|
||||
#include <platform.h>
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <kernel/main.h>
|
||||
|
||||
#include <hw/spec/x86_64/x86_64.h>
|
||||
@ -30,14 +30,14 @@
|
||||
using namespace Genode;
|
||||
|
||||
using Kernel::Cpu;
|
||||
using Kernel::Vm;
|
||||
using Kernel::Vcpu;
|
||||
|
||||
|
||||
Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
Cpu & cpu,
|
||||
Vcpu_data & data,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id)
|
||||
Vcpu::Vcpu(Irq::Pool &user_irq_pool,
|
||||
Cpu &cpu,
|
||||
Vcpu_data &data,
|
||||
Kernel::Signal_context &context,
|
||||
Identity &id)
|
||||
:
|
||||
Kernel::Object { *this },
|
||||
Cpu_context(cpu, Scheduler::Priority::min(), 0),
|
||||
@ -48,12 +48,12 @@ Vm::Vm(Irq::Pool & user_irq_pool,
|
||||
_vcpu_context(id.id, data) { }
|
||||
|
||||
|
||||
Vm::~Vm()
|
||||
Vcpu::~Vcpu()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Vm::run()
|
||||
void Vcpu::run()
|
||||
{
|
||||
if (_cpu().id() != Cpu::executing_id()) {
|
||||
error("vCPU run called from remote core.");
|
||||
@ -77,7 +77,7 @@ void Vm::run()
|
||||
}
|
||||
|
||||
|
||||
void Vm::pause()
|
||||
void Vcpu::pause()
|
||||
{
|
||||
if (_cpu().id() != Cpu::executing_id()) {
|
||||
Genode::error("vCPU pause called from remote core.");
|
||||
@ -104,7 +104,7 @@ void Vm::pause()
|
||||
}
|
||||
|
||||
|
||||
void Vm::proceed()
|
||||
void Vcpu::proceed()
|
||||
{
|
||||
Cpu::Ia32_tsc_aux::write(
|
||||
(Cpu::Ia32_tsc_aux::access_t)_vcpu_context.tsc_aux_guest);
|
||||
@ -120,7 +120,7 @@ void Vm::proceed()
|
||||
}
|
||||
|
||||
|
||||
void Vm::exception(Genode::Cpu_state &state)
|
||||
void Vcpu::exception(Genode::Cpu_state &state)
|
||||
{
|
||||
using namespace Board;
|
||||
using Ctx = Core::Cpu::Context;
|
||||
@ -169,7 +169,7 @@ void Vm::exception(Genode::Cpu_state &state)
|
||||
_interrupt(_user_irq_pool);
|
||||
break;
|
||||
default:
|
||||
error("VM: triggered unknown exception ",
|
||||
error("Vcpu: triggered unknown exception ",
|
||||
_vcpu_context.regs->trapno,
|
||||
" with error code ", _vcpu_context.regs->errcode,
|
||||
" at ip=",
|
@ -24,7 +24,7 @@
|
||||
|
||||
using Genode::addr_t;
|
||||
using Kernel::Cpu;
|
||||
using Kernel::Vm;
|
||||
using Kernel::Vcpu;
|
||||
using Board::Vmcs;
|
||||
using Board::Vmcs_buf;
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
/* core includes */
|
||||
#include <cpu_thread_component.h>
|
||||
#include <region_map_component.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <trace/source_registry.h>
|
||||
|
||||
#include <vcpu.h>
|
||||
@ -91,7 +90,7 @@ class Core::Svm_session_component
|
||||
Phys_allocated<Vm_page_table_array> _table_array;
|
||||
Guest_memory _memory;
|
||||
Vmid_allocator &_vmid_alloc;
|
||||
Kernel::Vm::Identity _id;
|
||||
Kernel::Vcpu::Identity _id;
|
||||
uint8_t _remaining_print_count { 10 };
|
||||
|
||||
void _detach_at(addr_t addr)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#ifndef _INCLUDE__SPEC__PC__VIRT_INTERFACE_H_
|
||||
#define _INCLUDE__SPEC__PC__VIRT_INTERFACE_H_
|
||||
|
||||
#include <cpu.h>
|
||||
#include <cpu/vcpu_state.h>
|
||||
#include <cpu/vcpu_state_virtualization.h>
|
||||
|
||||
@ -23,7 +22,6 @@ using Genode::Vcpu_state;
|
||||
|
||||
namespace Kernel {
|
||||
class Cpu;
|
||||
class Vm;
|
||||
};
|
||||
|
||||
namespace Board
|
||||
|
@ -28,7 +28,6 @@
|
||||
/* core includes */
|
||||
#include <cpu_thread_component.h>
|
||||
#include <region_map_component.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <trace/source_registry.h>
|
||||
|
||||
#include <vcpu.h>
|
||||
@ -91,7 +90,7 @@ class Core::Vmx_session_component
|
||||
Phys_allocated<Vm_page_table_array> _table_array;
|
||||
Guest_memory _memory;
|
||||
Vmid_allocator &_vmid_alloc;
|
||||
Kernel::Vm::Identity _id;
|
||||
Kernel::Vcpu::Identity _id;
|
||||
uint8_t _remaining_print_count { 10 };
|
||||
|
||||
void _detach_at(addr_t addr)
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2012-2025 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -27,7 +27,7 @@
|
||||
/* core includes */
|
||||
#include <object.h>
|
||||
#include <region_map_component.h>
|
||||
#include <kernel/vm.h>
|
||||
#include <kernel/vcpu.h>
|
||||
#include <trace/source_registry.h>
|
||||
|
||||
#include <vmid_allocator.h>
|
||||
@ -57,14 +57,14 @@ class Core::Vm_session_component
|
||||
{
|
||||
static size_t _ds_size();
|
||||
|
||||
Kernel::Vm::Identity &id;
|
||||
Rpc_entrypoint &ep;
|
||||
Ram_allocator::Result ds;
|
||||
addr_t ds_addr { };
|
||||
Kernel_object<Kernel::Vm> kobj { };
|
||||
Affinity::Location location { };
|
||||
Kernel::Vcpu::Identity &id;
|
||||
Rpc_entrypoint &ep;
|
||||
Ram_allocator::Result ds;
|
||||
addr_t ds_addr { };
|
||||
Kernel_object<Kernel::Vcpu> kobj { };
|
||||
Affinity::Location location { };
|
||||
|
||||
Vcpu(Ram_allocator &ram, Kernel::Vm::Identity &id, Rpc_entrypoint &ep)
|
||||
Vcpu(Ram_allocator &ram, Kernel::Vcpu::Identity &id, Rpc_entrypoint &ep)
|
||||
:
|
||||
id(id), ep(ep), ds(ram.try_alloc(_ds_size(), Cache::UNCACHED))
|
||||
{
|
||||
@ -102,7 +102,7 @@ class Core::Vm_session_component
|
||||
Board::Vm_page_table &_table;
|
||||
Board::Vm_page_table_array &_table_array;
|
||||
Vmid_allocator &_vmid_alloc;
|
||||
Kernel::Vm::Identity _id;
|
||||
Kernel::Vcpu::Identity _id;
|
||||
unsigned _vcpu_id_alloc { 0 };
|
||||
|
||||
static size_t _alloc_vcpu_data(Genode::addr_t ds_addr);
|
||||
|
@ -76,10 +76,10 @@ void Hw_vcpu::with_state(auto const &fn)
|
||||
error("vCPU state requested outside of vcpu_handler EP");
|
||||
sleep_forever();
|
||||
}
|
||||
Kernel::pause_vm(Capability_space::capid(_kernel_vcpu));
|
||||
Kernel::pause_vcpu(Capability_space::capid(_kernel_vcpu));
|
||||
|
||||
if (fn(_local_state()))
|
||||
Kernel::run_vm(Capability_space::capid(_kernel_vcpu));
|
||||
Kernel::run_vcpu(Capability_space::capid(_kernel_vcpu));
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ Hw_vcpu::Hw_vcpu(Env &env, Vm_connection &vm, Vcpu_handler_base &handler)
|
||||
|
||||
void Hw_vcpu::run()
|
||||
{
|
||||
Kernel::run_vm(Capability_space::capid(_kernel_vcpu));
|
||||
Kernel::run_vcpu(Capability_space::capid(_kernel_vcpu));
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ void Hw_vcpu::with_state(auto const &fn)
|
||||
error("vCPU state requested outside of vcpu_handler EP");
|
||||
sleep_forever();
|
||||
}
|
||||
Kernel::pause_vm(Capability_space::capid(_kernel_vcpu));
|
||||
Kernel::pause_vcpu(Capability_space::capid(_kernel_vcpu));
|
||||
|
||||
if (fn(_local_state()))
|
||||
run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user