NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VirtualCpu Class Reference
Inheritance diagram for VirtualCpu:
VCpu StaticReceiver< VirtualCpu > Device

Public Member Functions

bool receive (MessageMem &msg)
 Forward MEM requests to the motherboard.
bool receive (MessageMemRegion &msg)
bool receive (CpuEvent &msg)
bool receive (MessageLegacy &msg)
bool receive (LapicEvent &msg)
 Handle the INTA ourself in the case that there is no LAPIC or it is HW disabled.
bool receive (CpuMessage &msg)
 VirtualCpu (VCpu *_last, Motherboard &mb)
- Public Member Functions inherited from VCpu
VCpu * get_last ()
bool is_ap ()
bool set_cpuid (unsigned nr, unsigned reg, unsigned value, unsigned mask=~0)
 VCpu (VCpu *last)
- Public Member Functions inherited from StaticReceiver< VirtualCpu >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Member Functions

void dprintf (const char *format,...)
void GP0 (CpuMessage &msg)
bool handle_cpuid (CpuMessage &msg)
long long get_tsc_off (CpuMessage &msg)
 Return current TSC offset.
void handle_rdtsc (CpuMessage &msg)
void handle_rdmsr (CpuMessage &msg)
void handle_wrmsr (CpuMessage &msg)
void handle_cpu_init (CpuMessage &msg, bool reset)
void prioritize_events (CpuMessage &msg)
 Prioritize different events.
void handle_ioin (CpuMessage &msg)
void handle_ioout (CpuMessage &msg)
void got_event (unsigned value)
 We received an asynchronous event.

Private Attributes

unsigned long _hostop_id
Motherboard & _mb
long long _reset_tsc_off
volatile unsigned _event
volatile unsigned _sipi
unsigned char debugioin [8192]
unsigned char debugioout [8192]

Additional Inherited Members

- Public Types inherited from VCpu
enum  {
  EVENT_INTR = 1 << 0, EVENT_FIXED = 1 << 0, EVENT_LOWEST = 1 << 1, EVENT_SMI = 1 << 2,
  EVENT_RRD = 1 << 3, EVENT_RESET = 1 << 3, EVENT_NMI = 1 << 4, EVENT_INIT = 1 << 5,
  EVENT_SIPI = 1 << 6, EVENT_EXTINT = 1 << 7, EVENT_MASK = 0x0ff, DEASS_INTR = 1 << 16,
  EVENT_DEBUG = 1 << 17, STATE_BLOCK = 1 << 18, STATE_WAKEUP = 1 << 19, EVENT_HOST = 1 << 20
}
- Static Public Member Functions inherited from StaticReceiver< VirtualCpu >
static bool receive_static (Device *o, M &msg)
- Public Attributes inherited from VCpu
DBus< CpuMessage > executor
DBus< CpuEvent > bus_event
DBus< LapicEvent > bus_lapic
DBus< MessageMem > mem
DBus< MessageMemRegion > memregion
unsigned long long inj_count

Constructor & Destructor Documentation

VirtualCpu::VirtualCpu ( VCpu *  _last,
Motherboard &  mb 
)
inline

Member Function Documentation

void VirtualCpu::dprintf ( const char *  format,
  ... 
)
inlineprivate
long long VirtualCpu::get_tsc_off ( CpuMessage &  msg)
inlineprivate

Return current TSC offset.

Works around destroyed value in msg.cpu->tsc_off when we want to change the TSC offset.

void VirtualCpu::got_event ( unsigned  value)
inlineprivate

We received an asynchronous event.

As code runs in many threads, state updates have to be atomic!

try to claim the SIPI field, if it is empty, we are waiting for a SIPI. If it fails, somebody else was faster and we do not wakeup the client.

void VirtualCpu::GP0 ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_cpu_init ( CpuMessage &  msg,
bool  reset 
)
inlineprivate
bool VirtualCpu::handle_cpuid ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_ioin ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_ioout ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_rdmsr ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_rdtsc ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::handle_wrmsr ( CpuMessage &  msg)
inlineprivate
void VirtualCpu::prioritize_events ( CpuMessage &  msg)
inlineprivate

Prioritize different events.

Returns the events to clear.

bool VirtualCpu::receive ( MessageMem &  msg)
inline

Forward MEM requests to the motherboard.

bool VirtualCpu::receive ( MessageMemRegion &  msg)
inline
bool VirtualCpu::receive ( CpuEvent &  msg)
inline
bool VirtualCpu::receive ( MessageLegacy &  msg)
inline
bool VirtualCpu::receive ( LapicEvent &  msg)
inline

Handle the INTA ourself in the case that there is no LAPIC or it is HW disabled.

bool VirtualCpu::receive ( CpuMessage &  msg)
inline

Member Data Documentation

volatile unsigned VirtualCpu::_event
private
unsigned long VirtualCpu::_hostop_id
private
Motherboard& VirtualCpu::_mb
private
long long VirtualCpu::_reset_tsc_off
private
volatile unsigned VirtualCpu::_sipi
private
unsigned char VirtualCpu::debugioin[8192]
private
unsigned char VirtualCpu::debugioout[8192]
private

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