Public Member Functions | Protected Attributes
vcpu_intel_x64 Class Reference
Inheritance diagram for vcpu_intel_x64:
vcpu

Public Member Functions

 vcpu_intel_x64 (vcpuid::type id, std::unique_ptr< debug_ring > debug_ring=nullptr, std::unique_ptr< vmxon_intel_x64 > vmxon=nullptr, std::unique_ptr< vmcs_intel_x64 > vmcs=nullptr, std::unique_ptr< exit_handler_intel_x64 > exit_handler=nullptr, std::unique_ptr< vmcs_intel_x64_state > vmm_state=nullptr, std::unique_ptr< vmcs_intel_x64_state > guest_state=nullptr)
 
 ~vcpu_intel_x64 () override=default
 
void init (user_data *data=nullptr) override
 
void fini (user_data *data=nullptr) override
 
void run (user_data *data=nullptr) override
 
void hlt (user_data *data=nullptr) override
 
 vcpu_intel_x64 (vcpu_intel_x64 &&)=default
 
vcpu_intel_x64operator= (vcpu_intel_x64 &&)=default
 
 vcpu_intel_x64 (const vcpu_intel_x64 &)=delete
 
vcpu_intel_x64operator= (const vcpu_intel_x64 &)=delete
 
- Public Member Functions inherited from vcpu
 vcpu (vcpuid::type id, std::unique_ptr< debug_ring > dr=nullptr)
 
virtual ~vcpu ()=default
 
virtual vcpuid::type id () const
 
virtual bool is_running ()
 
virtual bool is_initialized ()
 
virtual bool is_bootstrap_vcpu ()
 
virtual bool is_host_vm_vcpu ()
 
virtual bool is_guest_vm_vcpu ()
 
virtual void write (const std::string &str) noexcept
 
 vcpu (vcpu &&)=default
 
vcpuoperator= (vcpu &&)=default
 
 vcpu (const vcpu &)=delete
 
vcpuoperator= (const vcpu &)=delete
 

Protected Attributes

std::unique_ptr< vmxon_intel_x64m_vmxon
 
std::unique_ptr< vmcs_intel_x64m_vmcs
 
std::unique_ptr< exit_handler_intel_x64m_exit_handler
 
std::unique_ptr< state_save_intel_x64m_state_save
 
std::unique_ptr< vmcs_intel_x64_statem_vmm_state
 
std::unique_ptr< vmcs_intel_x64_statem_guest_state
 

Detailed Description

Virtual CPU (Intel x86_64)

The Virtual CPU represents a "CPU" to the hypervisor that is specific to Intel x86_64.

This Intel specific vCPU class provides all of the functionality of the base vCPU, but also adds classes specific to Intel's VT-x including the vmxon_intel_x64, vmcs_intel_x64, exit_handler_intel_x64 and intrinsics_intel_x64 classes.

Note that these should not be created directly, but instead should be created by the vcpu_manager, which uses the vcpu_factory to actually create a vcpu.

Definition at line 48 of file vcpu_intel_x64.h.

Constructor & Destructor Documentation

◆ vcpu_intel_x64() [1/3]

vcpu_intel_x64::vcpu_intel_x64 ( vcpuid::type  id,
std::unique_ptr< debug_ring debug_ring = nullptr,
std::unique_ptr< vmxon_intel_x64 vmxon = nullptr,
std::unique_ptr< vmcs_intel_x64 vmcs = nullptr,
std::unique_ptr< exit_handler_intel_x64 exit_handler = nullptr,
std::unique_ptr< vmcs_intel_x64_state vmm_state = nullptr,
std::unique_ptr< vmcs_intel_x64_state guest_state = nullptr 
)

Constructor

Creates a vCPU with the provided resources. This constructor provides a means to override and repalce the internal resources of the vCPU. Note that if one of the resources is set to NULL, a default will be constructed in its place, providing a means to select which internal components to override.

Precondition
expects: none
Postcondition
ensures: none
Parameters
idthe id of the vcpu
debug_ringthe debug ring the vcpu should use. If you provide nullptr, a default debug ring will be created.
vmxonthe vmxon the vcpu should use. If you provide nullptr, a default vmxon will be created.
vmcsthe vmcs the vcpu should use. If you provide nullptr, a default vmcs will be created.
exit_handlerthe exit handler the vcpu should use. If you provide nullptr, a default exit handler will be created.
vmm_statethe vmm state the vcpu should use. If you provide nullptr, a default vmm state will be created.
guest_statethe guest state the vcpu should use. If you provide nullptr, a default guest state will be created.

Definition at line 25 of file vcpu_intel_x64.cpp.

◆ ~vcpu_intel_x64()

vcpu_intel_x64::~vcpu_intel_x64 ( )
overridedefault

Destructor

◆ vcpu_intel_x64() [2/3]

vcpu_intel_x64::vcpu_intel_x64 ( vcpu_intel_x64 &&  )
default

◆ vcpu_intel_x64() [3/3]

vcpu_intel_x64::vcpu_intel_x64 ( const vcpu_intel_x64 )
delete

Member Function Documentation

◆ init()

void vcpu_intel_x64::init ( user_data data = nullptr)
overridevirtual

Init vCPU

Precondition
expects: none
Postcondition
ensures: none
See also
vcpu::init

Reimplemented from vcpu.

Definition at line 44 of file vcpu_intel_x64.cpp.

◆ fini()

void vcpu_intel_x64::fini ( user_data data = nullptr)
overridevirtual

Fini vCPU

Precondition
expects: none
Postcondition
ensures: none
See also
vcpu::fini

Reimplemented from vcpu.

Definition at line 81 of file vcpu_intel_x64.cpp.

◆ run()

void vcpu_intel_x64::run ( user_data data = nullptr)
overridevirtual

Run vCPU

Precondition
expects: this->is_initialized() == true
Postcondition
ensures: none
See also
vcpu::run

Reimplemented from vcpu.

Definition at line 85 of file vcpu_intel_x64.cpp.

◆ hlt()

void vcpu_intel_x64::hlt ( user_data data = nullptr)
overridevirtual

Halt vCPU

Precondition
expects: none
Postcondition
ensures: none
See also
vcpu::hlt

Reimplemented from vcpu.

Definition at line 120 of file vcpu_intel_x64.cpp.

◆ operator=() [1/2]

vcpu_intel_x64& vcpu_intel_x64::operator= ( vcpu_intel_x64 &&  )
default

◆ operator=() [2/2]

vcpu_intel_x64& vcpu_intel_x64::operator= ( const vcpu_intel_x64 )
delete

Field Documentation

◆ m_vmxon

std::unique_ptr<vmxon_intel_x64> vcpu_intel_x64::m_vmxon
protected

Definition at line 132 of file vcpu_intel_x64.h.

◆ m_vmcs

std::unique_ptr<vmcs_intel_x64> vcpu_intel_x64::m_vmcs
protected

Definition at line 133 of file vcpu_intel_x64.h.

◆ m_exit_handler

std::unique_ptr<exit_handler_intel_x64> vcpu_intel_x64::m_exit_handler
protected

Definition at line 134 of file vcpu_intel_x64.h.

◆ m_state_save

std::unique_ptr<state_save_intel_x64> vcpu_intel_x64::m_state_save
protected

Definition at line 135 of file vcpu_intel_x64.h.

◆ m_vmm_state

std::unique_ptr<vmcs_intel_x64_state> vcpu_intel_x64::m_vmm_state
protected

Definition at line 136 of file vcpu_intel_x64.h.

◆ m_guest_state

std::unique_ptr<vmcs_intel_x64_state> vcpu_intel_x64::m_guest_state
protected

Definition at line 137 of file vcpu_intel_x64.h.


The documentation for this class was generated from the following files: