gem5  v20.1.0.0
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
BaseKvmCPU Class Referenceabstract

Base class for KVM based CPU models. More...

#include <base.hh>

Inheritance diagram for BaseKvmCPU:
BaseCPU ArmKvmCPU BaseArmKvmCPU X86KvmCPU ArmV8KvmCPU

Classes

class  KVMCpuPort
 KVM memory port. More...
 
struct  StatGroup
 

Public Member Functions

 BaseKvmCPU (BaseKvmCPUParams *params)
 
virtual ~BaseKvmCPU ()
 
void init () override
 
void startup () override
 
void serializeThread (CheckpointOut &cp, ThreadID tid) const override
 Serialize a single thread. More...
 
void unserializeThread (CheckpointIn &cp, ThreadID tid) override
 Unserialize one thread. More...
 
DrainState drain () override
 
void drainResume () override
 
void notifyFork () override
 
void switchOut () override
 Prepare for another CPU to take over execution. More...
 
void takeOverFrom (BaseCPU *cpu) override
 Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be switched in. More...
 
void verifyMemoryMode () const override
 Verify that the system is in a memory mode supported by the CPU. More...
 
PortgetDataPort () override
 Purely virtual method that returns a reference to the data port. More...
 
PortgetInstPort () override
 Purely virtual method that returns a reference to the instruction port. More...
 
void wakeup (ThreadID tid=0) override
 
void activateContext (ThreadID thread_num) override
 Notify the CPU that the indicated context is now active. More...
 
void suspendContext (ThreadID thread_num) override
 Notify the CPU that the indicated context is now suspended. More...
 
void deallocateContext (ThreadID thread_num)
 
void haltContext (ThreadID thread_num) override
 Notify the CPU that the indicated context is now halted. More...
 
long getVCpuID () const
 
ThreadContextgetContext (int tn) override
 Given a thread num get tho thread context for it. More...
 
Counter totalInsts () const override
 
Counter totalOps () const override
 
void finishMMIOPending ()
 Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests have completed. More...
 
virtual void dump () const
 Dump the internal state to the terminal. More...
 
void kick () const
 Force an exit from KVM. More...
 
- Public Member Functions inherited from BaseCPU
virtual PortProxy::SendFunctionalFunc getSendFunctional ()
 Returns a sendFunctional delegate for use with port proxies. More...
 
int cpuId () const
 Reads this CPU's ID. More...
 
uint32_t socketId () const
 Reads this CPU's Socket ID. More...
 
RequestorID dataRequestorId () const
 Reads this CPU's unique data requestor ID. More...
 
RequestorID instRequestorId () const
 Reads this CPU's unique instruction requestor ID. More...
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port on this CPU. More...
 
uint32_t taskId () const
 Get cpu task id. More...
 
void taskId (uint32_t id)
 Set cpu task id. More...
 
uint32_t getPid () const
 
void setPid (uint32_t pid)
 
void workItemBegin ()
 
void workItemEnd ()
 
Tick instCount ()
 
BaseInterruptsgetInterruptController (ThreadID tid)
 
void postInterrupt (ThreadID tid, int int_num, int index)
 
void clearInterrupt (ThreadID tid, int int_num, int index)
 
void clearInterrupts (ThreadID tid)
 
bool checkInterrupts (ThreadID tid) const
 
Trace::InstTracergetTracer ()
 Provide access to the tracer pointer. More...
 
int findContext (ThreadContext *tc)
 Given a Thread Context pointer return the thread num. More...
 
unsigned numContexts ()
 Get the number of thread contexts available. More...
 
ThreadID contextToThread (ContextID cid)
 Convert ContextID to threadID. More...
 
const Paramsparams () const
 
 BaseCPU (Params *params, bool is_checker=false)
 
virtual ~BaseCPU ()
 
void init () override
 
void startup () override
 
void regStats () override
 
void regProbePoints () override
 
void registerThreadContexts ()
 
void deschedulePowerGatingEvent ()
 
void schedulePowerGatingEvent ()
 
void flushTLBs ()
 Flush all TLBs in the CPU. More...
 
bool switchedOut () const
 Determine if the CPU is switched out. More...
 
unsigned int cacheLineSize () const
 Get the cache line size of the system. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize this object to the given output stream. More...
 
void unserialize (CheckpointIn &cp) override
 Reconstruct the state of this object from a checkpoint. More...
 
void scheduleInstStop (ThreadID tid, Counter insts, const char *cause)
 Schedule an event that exits the simulation loops after a predefined number of instructions. More...
 
uint64_t getCurrentInstCount (ThreadID tid)
 Get the number of instructions executed by the specified thread on this CPU. More...
 
void traceFunctions (Addr pc)
 
void armMonitor (ThreadID tid, Addr address)
 
bool mwait (ThreadID tid, PacketPtr pkt)
 
void mwaitAtomic (ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
 
AddressMonitorgetCpuAddrMonitor (ThreadID tid)
 
bool waitForRemoteGDB () const
 
virtual void probeInstCommit (const StaticInstPtr &inst, Addr pc)
 Helper method to trigger PMU probes for a committed instruction. More...
 

Public Attributes

SimpleThreadthread
 A cached copy of a thread's state in the form of a SimpleThread object. More...
 
ThreadContexttc
 ThreadContext object, provides an interface for external objects to modify this thread's state. More...
 
KvmVMvm
 
BaseKvmCPU::StatGroup stats
 
Counter ctrInsts
 Number of instructions executed by the CPU. More...
 
- Public Attributes inherited from BaseCPU
ThreadID numThreads
 Number of threads we're actually simulating (<= SMT_MAX_THREADS). More...
 
Systemsystem
 
Stats::Scalar numCycles
 
Stats::Scalar numWorkItemsStarted
 
Stats::Scalar numWorkItemsCompleted
 
Cycles syscallRetryLatency
 

Protected Types

enum  Status {
  Idle, Running, RunningService, RunningMMIOPending,
  RunningServiceCompletion
}
 
- Protected Types inherited from BaseCPU
enum  CPUState { CPU_STATE_ON, CPU_STATE_SLEEP, CPU_STATE_WAKEUP }
 

Protected Member Functions

void tick ()
 Execute the CPU until the next event in the main event queue or until the guest needs service from gem5. More...
 
virtual uint64_t getHostCycles () const
 Get the value of the hardware cycle counter in the guest. More...
 
virtual Tick kvmRun (Tick ticks)
 Request KVM to run the guest for a given number of ticks. More...
 
virtual Tick kvmRunDrain ()
 Request the CPU to run until draining completes. More...
 
struct kvm_run * getKvmRunState ()
 Get a pointer to the kvm_run structure containing all the input and output parameters from kvmRun(). More...
 
uint8_t * getGuestData (uint64_t offset) const
 Retrieve a pointer to guest data stored at the end of the kvm_run structure. More...
 
void kvmNonMaskableInterrupt ()
 Send a non-maskable interrupt to the guest. More...
 
void kvmInterrupt (const struct kvm_interrupt &interrupt)
 Send a normal interrupt to the guest. More...
 
std::string getAndFormatOneReg (uint64_t id) const
 Get and format one register for printout. More...
 
virtual bool archIsDrained () const
 Is the architecture specific code in a state that prevents draining? More...
 
Tick doMMIOAccess (Addr paddr, void *data, int size, bool write)
 Inject a memory mapped IO request into gem5. More...
 
int ioctl (int request, long p1) const
 vCPU ioctl interface. More...
 
int ioctl (int request, void *p1) const
 
int ioctl (int request) const
 
void getRegisters (struct kvm_regs &regs) const
 Get/Set the register state of the guest vCPU. More...
 
void setRegisters (const struct kvm_regs &regs)
 
void getSpecialRegisters (struct kvm_sregs &regs) const
 
void setSpecialRegisters (const struct kvm_sregs &regs)
 
void getFPUState (struct kvm_fpu &state) const
 Get/Set the guest FPU/vector state. More...
 
void setFPUState (const struct kvm_fpu &state)
 
void setOneReg (uint64_t id, const void *addr)
 Get/Set single register using the KVM_(SET|GET)_ONE_REG API. More...
 
void setOneReg (uint64_t id, uint64_t value)
 
void setOneReg (uint64_t id, uint32_t value)
 
void getOneReg (uint64_t id, void *addr) const
 
uint64_t getOneRegU64 (uint64_t id) const
 
uint32_t getOneRegU32 (uint64_t id) const
 
virtual void updateKvmState ()=0
 Update the KVM state from the current thread context. More...
 
virtual void updateThreadContext ()=0
 Update the current thread context with the KVM state. More...
 
void syncThreadContext ()
 Update a thread context if the KVM state is dirty with respect to the cached thread context. More...
 
EventQueuedeviceEventQueue ()
 Get a pointer to the event queue owning devices. More...
 
void syncKvmState ()
 Update the KVM if the thread context is dirty. More...
 
virtual Tick handleKvmExit ()
 Main kvmRun exit handler, calls the relevant handleKvmExit* depending on exit type. More...
 
virtual Tick handleKvmExitIO ()
 The guest performed a legacy IO request (out/inp on x86) More...
 
virtual Tick handleKvmExitHypercall ()
 The guest requested a monitor service using a hypercall. More...
 
virtual Tick handleKvmExitIRQWindowOpen ()
 The guest exited because an interrupt window was requested. More...
 
virtual Tick handleKvmExitUnknown ()
 An unknown architecture dependent error occurred when starting the vCPU. More...
 
virtual Tick handleKvmExitException ()
 An unhandled virtualization exception occured. More...
 
virtual Tick handleKvmExitFailEntry ()
 KVM failed to start the virtualized CPU. More...
 
void setSignalMask (const sigset_t *mask)
 Set the signal mask used in kvmRun() More...
 
- Protected Member Functions inherited from BaseCPU
void updateCycleCounters (CPUState state)
 base method keeping track of cycle progression More...
 
void enterPwrGating ()
 
ProbePoints::PMUUPtr pmuProbePoint (const char *name)
 Helper method to instantiate probe points belonging to this object. More...
 

Protected Attributes

Status _status
 CPU run state. More...
 
KVMCpuPort dataPort
 Port for data requests. More...
 
KVMCpuPort instPort
 Unused dummy port for the instruction interface. More...
 
const bool alwaysSyncTC
 Be conservative and always synchronize the thread context on KVM entry/exit. More...
 
bool threadContextDirty
 Is the gem5 context dirty? Set to true to force an update of the KVM vCPU state upon the next call to kvmRun(). More...
 
bool kvmStateDirty
 Is the KVM state dirty? Set to true to force an update of the KVM vCPU state upon the next call to kvmRun(). More...
 
const long vcpuID
 KVM internal ID of the vCPU. More...
 
pthread_t vcpuThread
 ID of the vCPU thread. More...
 
- Protected Attributes inherited from BaseCPU
Tick instCnt
 Instruction count used for SPARC misc register. More...
 
int _cpuId
 
const uint32_t _socketId
 Each cpu will have a socket ID that corresponds to its physical location in the system. More...
 
RequestorID _instRequestorId
 instruction side request id that must be placed in all requests More...
 
RequestorID _dataRequestorId
 data side request id that must be placed in all requests More...
 
uint32_t _taskId
 An intrenal representation of a task identifier within gem5. More...
 
uint32_t _pid
 The current OS process ID that is executing on this processor. More...
 
bool _switchedOut
 Is the CPU switched out or active? More...
 
const unsigned int _cacheLineSize
 Cache the cache line size that we get from the system. More...
 
std::vector< BaseInterrupts * > interrupts
 
std::vector< ThreadContext * > threadContexts
 
Trace::InstTracertracer
 
Cycles previousCycle
 
CPUState previousState
 
const Cycles pwrGatingLatency
 
const bool powerGatingOnIdle
 
EventFunctionWrapper enterPwrGatingEvent
 
ProbePoints::PMUUPtr ppRetiredInsts
 Instruction commit probe point. More...
 
ProbePoints::PMUUPtr ppRetiredInstsPC
 
ProbePoints::PMUUPtr ppRetiredLoads
 Retired load instructions. More...
 
ProbePoints::PMUUPtr ppRetiredStores
 Retired store instructions. More...
 
ProbePoints::PMUUPtr ppRetiredBranches
 Retired branches (any type) More...
 
ProbePoints::PMUUPtr ppAllCycles
 CPU cycle counter even if any thread Context is suspended. More...
 
ProbePoints::PMUUPtr ppActiveCycles
 CPU cycle counter, only counts if any thread contexts is active. More...
 
ProbePointArg< bool > * ppSleeping
 ProbePoint that signals transitions of threadContexts sets. More...
 

Private Member Functions

Tick flushCoalescedMMIO ()
 Service MMIO requests in the mmioRing. More...
 
void setupSignalHandler ()
 Setup a signal handler to catch the timer signal used to switch back to the monitor. More...
 
bool discardPendingSignal (int signum) const
 Discard a (potentially) pending signal. More...
 
void startupThread ()
 Thread-specific initialization. More...
 
bool tryDrain ()
 Try to drain the CPU if a drain is pending. More...
 
void ioctlRun ()
 Execute the KVM_RUN ioctl. More...
 
void setupInstStop ()
 Setup an instruction break if there is one pending. More...
 

Private Attributes

int vcpuFD
 KVM vCPU file descriptor. More...
 
int vcpuMMapSize
 Size of MMAPed kvm_run area. More...
 
struct kvm_run * _kvmRun
 Pointer to the kvm_run structure used to communicate parameters with KVM. More...
 
struct kvm_coalesced_mmio_ring * mmioRing
 Coalesced MMIO ring buffer. More...
 
const long pageSize
 Cached page size of the host. More...
 
EventFunctionWrapper tickEvent
 
std::unique_ptr< BaseKvmTimerrunTimer
 Timer used to force execution into the monitor after a specified number of simulation tick equivalents have executed in the guest. More...
 
float hostFactor
 Host factor as specified in the configuration. More...
 
uint64_t activeInstPeriod
 Currently active instruction count breakpoint. More...
 
PerfKvmCounter hwCycles
 Guest cycle counter. More...
 
PerfKvmCounter hwInstructions
 Guest instruction counter. More...
 
bool perfControlledByTimer
 Does the runTimer control the performance counters? More...
 
void setupCounters ()
 Setup hardware performance counters. More...
 
void setupInstCounter (uint64_t period=0)
 Setup the guest instruction counter. More...
 

Additional Inherited Members

- Public Types inherited from BaseCPU
typedef BaseCPUParams Params
 
- Static Public Member Functions inherited from BaseCPU
static int numSimulatedInsts ()
 
static int numSimulatedOps ()
 
static void wakeup (ThreadID tid)
 
static int numSimulatedCPUs ()
 
static Counter numSimulatedInsts ()
 
static Counter numSimulatedOps ()
 
- Static Public Attributes inherited from BaseCPU
static const uint32_t invldPid = std::numeric_limits<uint32_t>::max()
 Invalid or unknown Pid. More...
 
static const Addr PCMask = ~((Addr)sizeof(TheISA::MachInst) - 1)
 

Detailed Description

Base class for KVM based CPU models.

All architecture specific KVM implementation should inherit from this class. The most basic CPU models only need to override the updateKvmState() and updateThreadContext() methods to implement state synchronization between gem5 and KVM.

The architecture specific implementation is also responsible for delivering interrupts into the VM. This is typically done by overriding tick() and checking the thread context before entering into the VM. In order to deliver an interrupt, the implementation then calls KvmVM::setIRQLine() or BaseKvmCPU::kvmInterrupt() depending on the specifics of the underlying hardware/drivers.

Definition at line 77 of file base.hh.

Member Enumeration Documentation

◆ Status

enum BaseKvmCPU::Status
protected
Enumerator
Idle 

Context not scheduled in KVM.

   The CPU generally enters this state when the guest execute
   an instruction that halts the CPU (e.g., WFI on ARM or HLT
   on X86) if KVM traps this instruction. Ticks are not
   scheduled in this state.

   @see suspendContext()
Running 

Running normally.

   This is the normal run state of the CPU. KVM will be
   entered next time tick() is called.
RunningService 

Requiring service at the beginning of the next cycle.

   The virtual machine has exited and requires service, tick()
   will call handleKvmExit() on the next cycle. The next state
   after running service is determined in handleKvmExit() and
   depends on what kind of service the guest requested:
   <ul>
     <li>IO/MMIO (Atomic): RunningServiceCompletion
     <li>IO/MMIO (Timing): RunningMMIOPending
     <li>Halt: Idle
     <li>Others: Running
   </ul>
RunningMMIOPending 

Timing MMIO request in flight or stalled.

    The VM has requested IO/MMIO and we are in timing mode.  A timing
    request is either stalled (and will be retried with recvReqRetry())
    or it is in flight.  After the timing request is complete, the CPU
    will transition to the RunningServiceCompletion state.
RunningServiceCompletion 

Service completion in progress.

   The VM has requested service that requires KVM to be
   entered once in order to get to a consistent state. This
   happens in handleKvmExit() or one of its friends after IO
   exits. After executing tick(), the CPU will transition into
   the Running or RunningService state.

Definition at line 178 of file base.hh.

Constructor & Destructor Documentation

◆ BaseKvmCPU()

BaseKvmCPU::BaseKvmCPU ( BaseKvmCPUParams *  params)

Definition at line 62 of file base.cc.

References tick().

◆ ~BaseKvmCPU()

BaseKvmCPU::~BaseKvmCPU ( )
virtual

Definition at line 98 of file base.cc.

References _kvmRun, vcpuFD, and vcpuMMapSize.

Member Function Documentation

◆ activateContext()

void BaseKvmCPU::activateContext ( ThreadID  thread_num)
overridevirtual

Notify the CPU that the indicated context is now active.

Reimplemented from BaseCPU.

Definition at line 484 of file base.cc.

References _status, DPRINTF, Idle, ThreadState::lastActivate, ThreadState::lastSuspend, BaseCPU::numCycles, Running, Event::scheduled(), thread, and tickEvent.

◆ archIsDrained()

virtual bool BaseKvmCPU::archIsDrained ( ) const
inlineprotectedvirtual

Is the architecture specific code in a state that prevents draining?

This method should return false if there are any pending events in the guest vCPU that won't be carried over to the gem5 state and thus will prevent correct checkpointing or CPU handover. It might, for example, check for pending interrupts that have been passed to the vCPU but not acknowledged by the OS. Architecures implementing this method must override kvmRunDrain().

See also
BaseKvmCPU::kvmRunDrain()
Returns
true if the vCPU is drained, false otherwise.

Reimplemented in X86KvmCPU.

Definition at line 521 of file base.hh.

Referenced by drain(), and tryDrain().

◆ deallocateContext()

void BaseKvmCPU::deallocateContext ( ThreadID  thread_num)

Definition at line 525 of file base.cc.

References suspendContext().

◆ deviceEventQueue()

EventQueue* BaseKvmCPU::deviceEventQueue ( )
inlineprotected

Get a pointer to the event queue owning devices.

Devices always live in a separate device event queue when running in multi-core mode. We need to temporarily migrate to this queue when accessing devices. By convention, devices and the VM use the same event queue.

Definition at line 427 of file base.hh.

References EventManager::eventQueue(), and vm.

Referenced by doMMIOAccess(), X86KvmCPU::handleKvmExitIO(), ArmV8KvmCPU::updateKvmState(), and ArmV8KvmCPU::updateThreadContext().

◆ discardPendingSignal()

bool BaseKvmCPU::discardPendingSignal ( int  signum) const
private

Discard a (potentially) pending signal.

Parameters
signumSignal to discard
Returns
true if the signal was pending, false otherwise.

Definition at line 1212 of file base.cc.

References panic.

Referenced by kvmRun().

◆ doMMIOAccess()

Tick BaseKvmCPU::doMMIOAccess ( Addr  paddr,
void *  data,
int  size,
bool  write 
)
protected

Inject a memory mapped IO request into gem5.

Parameters
paddrPhysical address
dataPointer to the source/destination buffer
sizeMemory access size
writeTrue if write, False if read
Returns
Number of ticks spent servicing the memory access

Definition at line 1070 of file base.cc.

References ThreadContext::contextId(), data, dataPort, BaseCPU::dataRequestorId(), Packet::dataStatic(), deviceEventQueue(), BaseTLB::finalizePhysical(), ThreadContext::getDTBPtr(), SimpleThread::getTC(), NoFault, BaseTLB::Read, MemCmd::ReadReq, BaseKvmCPU::KVMCpuPort::submitIO(), syncThreadContext(), tc, thread, threadContextDirty, Request::UNCACHEABLE, warn, BaseTLB::Write, and MemCmd::WriteReq.

Referenced by flushCoalescedMMIO(), and handleKvmExit().

◆ drain()

DrainState BaseKvmCPU::drain ( )
override

◆ drainResume()

void BaseKvmCPU::drainResume ( )
override

◆ dump()

void BaseKvmCPU::dump ( ) const
virtual

Dump the internal state to the terminal.

Reimplemented in ArmV8KvmCPU, and X86KvmCPU.

Definition at line 562 of file base.cc.

References inform.

Referenced by handleKvmExit(), handleKvmExitException(), handleKvmExitFailEntry(), handleKvmExitUnknown(), and serializeThread().

◆ finishMMIOPending()

void BaseKvmCPU::finishMMIOPending ( )

Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests have completed.

Definition at line 222 of file base.cc.

References _status, RunningMMIOPending, RunningServiceCompletion, Event::scheduled(), and tickEvent.

◆ flushCoalescedMMIO()

Tick BaseKvmCPU::flushCoalescedMMIO ( )
private

Service MMIO requests in the mmioRing.

Returns
Number of ticks spent servicing the MMIO requests in the MMIO ring buffer

Definition at line 1141 of file base.cc.

References doMMIOAccess(), DPRINTF, mmioRing, BaseKvmCPU::StatGroup::numCoalescedMMIO, and stats.

Referenced by kvmRun().

◆ getAndFormatOneReg()

std::string BaseKvmCPU::getAndFormatOneReg ( uint64_t  id) const
protected

Get and format one register for printout.

This function call getOneReg() to retrieve the contents of one register and automatically formats it for printing.

Note
The presence of this call depends on Kvm::capOneReg().

Definition at line 875 of file base.cc.

References panic, and ArmISA::ss.

Referenced by ArmV8KvmCPU::dump(), ArmKvmCPU::dumpKvmStateCoProc(), ArmKvmCPU::dumpKvmStateMisc(), ArmKvmCPU::dumpKvmStateVFP(), ArmV8KvmCPU::updateKvmState(), and ArmV8KvmCPU::updateThreadContext().

◆ getContext()

ThreadContext * BaseKvmCPU::getContext ( int  tn)
overridevirtual

Given a thread num get tho thread context for it.

Reimplemented from BaseCPU.

Definition at line 540 of file base.cc.

References syncThreadContext(), and tc.

◆ getDataPort()

Port& BaseKvmCPU::getDataPort ( )
inlineoverridevirtual

Purely virtual method that returns a reference to the data port.

All subclasses must implement this method.

Returns
a reference to the data port

Implements BaseCPU.

Definition at line 98 of file base.hh.

References dataPort.

◆ getFPUState()

void BaseKvmCPU::getFPUState ( struct kvm_fpu &  state) const
protected

Get/Set the guest FPU/vector state.

Definition at line 826 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::dumpFpuRegs(), and X86KvmCPU::updateThreadContext().

◆ getGuestData()

uint8_t* BaseKvmCPU::getGuestData ( uint64_t  offset) const
inlineprotected

Retrieve a pointer to guest data stored at the end of the kvm_run structure.

This is mainly used for PIO operations (KVM_EXIT_IO).

Parameters
offsetOffset as specified by the kvm_run structure
Returns
Pointer to guest data

Definition at line 307 of file base.hh.

References _kvmRun, and ArmISA::offset.

Referenced by X86KvmCPU::handleIOMiscReg32(), and X86KvmCPU::handleKvmExitIO().

◆ getHostCycles()

uint64_t BaseKvmCPU::getHostCycles ( ) const
protectedvirtual

Get the value of the hardware cycle counter in the guest.

This method is supposed to return the total number of cycles executed in hardware mode relative to some arbitrary point in the past. It's mainly used when estimating the number of cycles actually executed by the CPU in kvmRun(). The default behavior of this method is to use the cycles performance counter, but some architectures may want to use internal registers instead.

Returns
Number of host cycles executed relative to an undefined point in the past.

Reimplemented in X86KvmCPU.

Definition at line 678 of file base.cc.

References hwCycles, and PerfKvmCounter::read().

Referenced by kvmRun().

◆ getInstPort()

Port& BaseKvmCPU::getInstPort ( )
inlineoverridevirtual

Purely virtual method that returns a reference to the instruction port.

All subclasses must implement this method.

Returns
a reference to the instruction port

Implements BaseCPU.

Definition at line 99 of file base.hh.

References instPort.

◆ getKvmRunState()

struct kvm_run* BaseKvmCPU::getKvmRunState ( )
inlineprotected

Get a pointer to the kvm_run structure containing all the input and output parameters from kvmRun().

Definition at line 297 of file base.hh.

References _kvmRun.

Referenced by X86KvmCPU::handleIOMiscReg32(), X86KvmCPU::handleKvmExitIO(), BaseArmKvmCPU::kvmRun(), X86KvmCPU::kvmRun(), X86KvmCPU::kvmRunDrain(), X86KvmCPU::kvmRunWrapper(), and X86KvmCPU::updateThreadContextSRegs().

◆ getOneReg()

void BaseKvmCPU::getOneReg ( uint64_t  id,
void *  addr 
) const
protected

Definition at line 858 of file base.cc.

References addr, ArmISA::id, ioctl(), panic, and X86ISA::reg.

Referenced by getOneRegU32(), getOneRegU64(), and ArmV8KvmCPU::updateThreadContext().

◆ getOneRegU32()

uint32_t BaseKvmCPU::getOneRegU32 ( uint64_t  id) const
inlineprotected

◆ getOneRegU64()

uint64_t BaseKvmCPU::getOneRegU64 ( uint64_t  id) const
inlineprotected

◆ getRegisters()

void BaseKvmCPU::getRegisters ( struct kvm_regs &  regs) const
protected

Get/Set the register state of the guest vCPU.

KVM has two different interfaces for accessing the state of the guest CPU. One interface updates 'normal' registers and one updates 'special' registers. The distinction between special and normal registers isn't very clear and is architecture dependent.

Definition at line 798 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::dumpIntRegs(), and X86KvmCPU::updateThreadContext().

◆ getSpecialRegisters()

void BaseKvmCPU::getSpecialRegisters ( struct kvm_sregs &  regs) const
protected

Definition at line 812 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::dumpSpecRegs(), and X86KvmCPU::updateThreadContext().

◆ getVCpuID()

long BaseKvmCPU::getVCpuID ( ) const
inline

Definition at line 107 of file base.hh.

References vcpuID.

◆ haltContext()

void BaseKvmCPU::haltContext ( ThreadID  thread_num)
overridevirtual

Notify the CPU that the indicated context is now halted.

Reimplemented from BaseCPU.

Definition at line 532 of file base.cc.

References BaseCPU::CPU_STATE_SLEEP, suspendContext(), and BaseCPU::updateCycleCounters().

◆ handleKvmExit()

Tick BaseKvmCPU::handleKvmExit ( )
protectedvirtual

◆ handleKvmExitException()

Tick BaseKvmCPU::handleKvmExitException ( )
protectedvirtual

An unhandled virtualization exception occured.

Some KVM virtualization drivers return unhandled exceptions to the user-space monitor. This interface is currently only used by the Intel VMX KVM driver.

Returns
Number of ticks delay the next CPU tick

Definition at line 1053 of file base.cc.

References _kvmRun, dump(), and panic.

Referenced by handleKvmExit().

◆ handleKvmExitFailEntry()

Tick BaseKvmCPU::handleKvmExitFailEntry ( )
protectedvirtual

KVM failed to start the virtualized CPU.

The kvm_run data structure contains the hardware-specific error code.

Returns
Number of ticks delay the next CPU tick

Definition at line 1062 of file base.cc.

References _kvmRun, dump(), and panic.

Referenced by handleKvmExit().

◆ handleKvmExitHypercall()

Tick BaseKvmCPU::handleKvmExitHypercall ( )
protectedvirtual

The guest requested a monitor service using a hypercall.

Returns
Number of ticks spent servicing the hypercall

Definition at line 1031 of file base.cc.

References panic.

Referenced by handleKvmExit().

◆ handleKvmExitIO()

Tick BaseKvmCPU::handleKvmExitIO ( )
protectedvirtual

The guest performed a legacy IO request (out/inp on x86)

Returns
Number of ticks spent servicing the IO request

Reimplemented in X86KvmCPU.

Definition at line 1023 of file base.cc.

References _kvmRun, and panic.

Referenced by handleKvmExit().

◆ handleKvmExitIRQWindowOpen()

Tick BaseKvmCPU::handleKvmExitIRQWindowOpen ( )
protectedvirtual

The guest exited because an interrupt window was requested.

The guest exited because an interrupt window was requested (request_interrupt_window in the kvm_run structure was set to 1 before calling kvmRun) and it is now ready to receive

Returns
Number of ticks spent servicing the IRQ

Reimplemented in X86KvmCPU.

Definition at line 1037 of file base.cc.

References warn.

Referenced by handleKvmExit().

◆ handleKvmExitUnknown()

Tick BaseKvmCPU::handleKvmExitUnknown ( )
protectedvirtual

An unknown architecture dependent error occurred when starting the vCPU.

The kvm_run data structure contains the hardware error code. The defaults behavior of this method just prints the HW error code and panics. Architecture dependent implementations may want to override this method to provide better, hardware-aware, error messages.

Returns
Number of ticks delay the next CPU tick

Definition at line 1045 of file base.cc.

References _kvmRun, dump(), and panic.

Referenced by handleKvmExit().

◆ init()

void BaseKvmCPU::init ( )
override

◆ ioctlRun()

void BaseKvmCPU::ioctlRun ( )
private

Execute the KVM_RUN ioctl.

Definition at line 1293 of file base.cc.

References ioctl(), and panic.

Referenced by kvmRun().

◆ kick()

void BaseKvmCPU::kick ( ) const
inline

Force an exit from KVM.

Send a signal to the thread owning this vCPU to get it to exit from KVM. Ignored if the vCPU is not executing.

Definition at line 128 of file base.hh.

References KVM_KICK_SIGNAL, and vcpuThread.

Referenced by kvmRun(), and wakeup().

◆ kvmRun()

Tick BaseKvmCPU::kvmRun ( Tick  ticks)
protectedvirtual

Request KVM to run the guest for a given number of ticks.

The method returns the approximate number of ticks executed.

Note
The returned number of ticks can be both larger or smaller than the requested number of ticks. A smaller number can, for example, occur when the guest executes MMIO. A larger number is typically due to performance counter inaccuracies.
This method is virtual in order to allow implementations to check for architecture specific events (e.g., interrupts) before entering the VM.
It is the response of the caller (normally tick()) to make sure that the KVM state is synchronized and that the TC is invalidated after entering KVM.
This method does not normally cause any state transitions. However, if it may suspend the CPU by suspending the thread, which leads to a transition to the Idle state. In such a case, kvm must not be entered.
Parameters
ticksNumber of ticks to execute, set to 0 to exit immediately after finishing pending operations.
Returns
Number of ticks executed (see note)

Reimplemented in X86KvmCPU, BaseArmKvmCPU, and ArmKvmCPU.

Definition at line 684 of file base.cc.

References BaseKvmCPU::StatGroup::committedInsts, ctrInsts, curEventQueue(), discardPendingSignal(), DPRINTF, fatal_if, flushCoalescedMMIO(), getHostCycles(), hostFactor, hwCycles, hwInstructions, ioctlRun(), kick(), KVM_KICK_SIGNAL, BaseCPU::numCycles, BaseKvmCPU::StatGroup::numVMExits, BaseKvmCPU::StatGroup::numVMHalfEntries, perfControlledByTimer, PerfKvmCounter::read(), runTimer, PerfKvmCounter::start(), stats, PerfKvmCounter::stop(), BaseCPU::system, System::totalNumInsts, and vcpuFD.

Referenced by BaseArmKvmCPU::kvmRun(), ArmKvmCPU::kvmRun(), kvmRunDrain(), X86KvmCPU::kvmRunWrapper(), and tick().

◆ kvmRunDrain()

Tick BaseKvmCPU::kvmRunDrain ( )
protectedvirtual

Request the CPU to run until draining completes.

This function normally calls kvmRun(0) to make KVM finish pending MMIO operations. Architecures implementing archIsDrained() must override this method.

See also
BaseKvmCPU::archIsDrained()
Returns
Number of ticks executed

Reimplemented in X86KvmCPU.

Definition at line 664 of file base.cc.

References _status, kvmRun(), RunningMMIOPending, and RunningServiceCompletion.

Referenced by tick().

◆ notifyFork()

void BaseKvmCPU::notifyFork ( )
override

◆ serializeThread()

void BaseKvmCPU::serializeThread ( CheckpointOut cp,
ThreadID  tid 
) const
overridevirtual

Serialize a single thread.

Parameters
cpThe stream to serialize to.
tidID of the current thread.

Reimplemented from BaseCPU.

Definition at line 280 of file base.cc.

References _status, DPRINTF, DTRACE, dump(), Idle, SimpleThread::serialize(), and thread.

◆ setFPUState()

void BaseKvmCPU::setFPUState ( const struct kvm_fpu &  state)
protected

Definition at line 833 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::updateKvmStateFPULegacy().

◆ setOneReg() [1/3]

void BaseKvmCPU::setOneReg ( uint64_t  id,
const void *  addr 
)
protected

Get/Set single register using the KVM_(SET|GET)_ONE_REG API.

Note
The presence of this call depends on Kvm::capOneReg().

Definition at line 841 of file base.cc.

References addr, ArmISA::id, ioctl(), panic, and X86ISA::reg.

Referenced by ArmV8KvmCPU::startup(), ArmV8KvmCPU::updateKvmState(), ArmKvmCPU::updateKvmStateCoProc(), ArmKvmCPU::updateKvmStateCore(), and ArmKvmCPU::updateKvmStateVFP().

◆ setOneReg() [2/3]

void BaseKvmCPU::setOneReg ( uint64_t  id,
uint32_t  value 
)
inlineprotected

Definition at line 368 of file base.hh.

References setOneReg().

Referenced by setOneReg().

◆ setOneReg() [3/3]

void BaseKvmCPU::setOneReg ( uint64_t  id,
uint64_t  value 
)
inlineprotected

Definition at line 367 of file base.hh.

References setOneReg().

Referenced by setOneReg().

◆ setRegisters()

void BaseKvmCPU::setRegisters ( const struct kvm_regs &  regs)
protected

Definition at line 805 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::updateKvmStateRegs().

◆ setSignalMask()

void BaseKvmCPU::setSignalMask ( const sigset_t *  mask)
protected

Set the signal mask used in kvmRun()

This method allows the signal mask of the thread executing kvmRun() to be overridden inside the actual system call. This allows us to mask timer signals used to force KVM exits while in gem5.

The signal mask can be disabled by setting it to NULL.

Parameters
maskSignals to mask

Definition at line 1111 of file base.cc.

References ioctl(), ArmISA::mask, and panic.

Referenced by setupSignalHandler().

◆ setSpecialRegisters()

void BaseKvmCPU::setSpecialRegisters ( const struct kvm_sregs &  regs)
protected

Definition at line 819 of file base.cc.

References ioctl(), and panic.

Referenced by X86KvmCPU::updateKvmStateSRegs().

◆ setupCounters()

void BaseKvmCPU::setupCounters ( )
private

◆ setupInstCounter()

void BaseKvmCPU::setupInstCounter ( uint64_t  period = 0)
private

Setup the guest instruction counter.

Setup the guest instruction counter and optionally request a signal every N instructions executed by the guest. This method will re-attach the counter if the counter has already been attached and its sampling settings have changed.

Parameters
periodSignal period, set to 0 to disable signaling.

Definition at line 1315 of file base.cc.

References activeInstPeriod, PerfKvmCounter::attach(), PerfKvmCounter::attached(), PerfKvmCounter::detach(), PerfKvmCounter::enableSignals(), PerfKvmCounterConfig::exclude_host(), PerfKvmCounterConfig::exclude_hv(), hwCycles, hwInstructions, KVM_KICK_SIGNAL, PerfKvmCounterConfig::samplePeriod(), and PerfKvmCounterConfig::wakeupEvents().

Referenced by setupCounters(), and setupInstStop().

◆ setupInstStop()

void BaseKvmCPU::setupInstStop ( )
private

Setup an instruction break if there is one pending.

Check if there are pending instruction breaks in the CPU's instruction event queue and schedule an instruction break using PerfEvent.

Note
This method doesn't currently handle the main system instruction event queue.

Definition at line 1303 of file base.cc.

References SimpleThread::comInstEventQueue, ctrInsts, EventQueue::empty(), EventQueue::nextTick(), setupInstCounter(), and thread.

Referenced by tick().

◆ setupSignalHandler()

void BaseKvmCPU::setupSignalHandler ( )
private

Setup a signal handler to catch the timer signal used to switch back to the monitor.

Definition at line 1183 of file base.cc.

References KVM_KICK_SIGNAL, onKickSignal(), panic, ArmISA::sa, and setSignalMask().

Referenced by startupThread().

◆ startup()

void BaseKvmCPU::startup ( )
override

◆ startupThread()

void BaseKvmCPU::startupThread ( )
private

Thread-specific initialization.

Some KVM-related initialization requires us to know the TID of the thread that is going to execute our event queue. For example, when setting up timers, we need to know the TID of the thread executing in KVM in order to deliver the timer signal to that thread. This method is called as the first event in this SimObject's event queue.

See also
startup

Definition at line 232 of file base.cc.

References hwCycles, KVM_KICK_SIGNAL, MipsISA::p, BaseCPU::params(), runTimer, setupCounters(), setupSignalHandler(), and vcpuThread.

Referenced by startup().

◆ suspendContext()

void BaseKvmCPU::suspendContext ( ThreadID  thread_num)
overridevirtual

Notify the CPU that the indicated context is now suspended.

Check if possible to enter a lower power state

Reimplemented from BaseCPU.

Definition at line 502 of file base.cc.

References _status, DPRINTF, Idle, Running, RunningServiceCompletion, Event::scheduled(), thread, and tickEvent.

Referenced by deallocateContext(), and haltContext().

◆ switchOut()

void BaseKvmCPU::switchOut ( )
overridevirtual

Prepare for another CPU to take over execution.

When this method exits, all internal state should have been flushed. After the method returns, the simulator calls takeOverFrom() on the new CPU with this CPU as its parameter.

Reimplemented from BaseCPU.

Definition at line 421 of file base.cc.

References _status, DPRINTF, Idle, Event::scheduled(), BaseCPU::switchOut(), and tickEvent.

◆ syncKvmState()

void BaseKvmCPU::syncKvmState ( )
protected

Update the KVM if the thread context is dirty.

Definition at line 934 of file base.cc.

References kvmStateDirty, threadContextDirty, and updateKvmState().

Referenced by tick().

◆ syncThreadContext()

void BaseKvmCPU::syncThreadContext ( )
protected

Update a thread context if the KVM state is dirty with respect to the cached thread context.

Definition at line 922 of file base.cc.

References kvmStateDirty, threadContextDirty, and updateThreadContext().

Referenced by X86KvmCPU::deliverInterrupts(), doMMIOAccess(), drain(), getContext(), X86KvmCPU::kvmRun(), and tick().

◆ takeOverFrom()

void BaseKvmCPU::takeOverFrom ( BaseCPU cpu)
overridevirtual

Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be switched in.

A CPU model implementing this method is expected to initialize its state from the old CPU and connect its memory (unless they are already connected) to the memories connected to the old CPU.

Parameters
cpuCPU to initialize read state from.

Reimplemented from BaseCPU.

Definition at line 435 of file base.cc.

References _status, DPRINTF, Idle, Event::scheduled(), BaseCPU::takeOverFrom(), threadContextDirty, BaseCPU::threadContexts, tickEvent, and updateKvmState().

◆ tick()

void BaseKvmCPU::tick ( )
protected

◆ totalInsts()

Counter BaseKvmCPU::totalInsts ( ) const
overridevirtual

Implements BaseCPU.

Definition at line 549 of file base.cc.

References ctrInsts.

◆ totalOps()

Counter BaseKvmCPU::totalOps ( ) const
overridevirtual

Implements BaseCPU.

Definition at line 555 of file base.cc.

References ctrInsts, and hack_once.

◆ tryDrain()

bool BaseKvmCPU::tryDrain ( )
private

Try to drain the CPU if a drain is pending.

Definition at line 1271 of file base.cc.

References _status, archIsDrained(), DPRINTF, Draining, Idle, and Running.

Referenced by tick().

◆ unserializeThread()

void BaseKvmCPU::unserializeThread ( CheckpointIn cp,
ThreadID  tid 
)
overridevirtual

Unserialize one thread.

Parameters
cpThe checkpoint use.
tidID of the current thread.

Reimplemented from BaseCPU.

Definition at line 293 of file base.cc.

References _status, DPRINTF, Idle, thread, threadContextDirty, and SimpleThread::unserialize().

◆ updateKvmState()

virtual void BaseKvmCPU::updateKvmState ( )
protectedpure virtual

Update the KVM state from the current thread context.

The base CPU calls this method before starting the guest CPU when the contextDirty flag is set. The architecture dependent CPU implementation is expected to update all guest state (registers, special registers, and FPU state).

Implemented in X86KvmCPU, ArmV8KvmCPU, and ArmKvmCPU.

Referenced by syncKvmState(), and takeOverFrom().

◆ updateThreadContext()

virtual void BaseKvmCPU::updateThreadContext ( )
protectedpure virtual

Update the current thread context with the KVM state.

The base CPU after the guest updates any of the KVM state. In practice, this happens after kvmRun is called. The architecture dependent code is expected to read the state of the guest CPU and update gem5's thread state.

Implemented in X86KvmCPU, ArmV8KvmCPU, and ArmKvmCPU.

Referenced by syncThreadContext().

◆ verifyMemoryMode()

void BaseKvmCPU::verifyMemoryMode ( ) const
overridevirtual

Verify that the system is in a memory mode supported by the CPU.

Implementations are expected to query the system for the current memory mode and ensure that it is what the CPU model expects. If the check fails, the implementation should terminate the simulation using fatal().

Reimplemented from BaseCPU.

Definition at line 457 of file base.cc.

References System::bypassCaches(), fatal, and BaseCPU::system.

Referenced by drainResume().

◆ wakeup()

void BaseKvmCPU::wakeup ( ThreadID  tid = 0)
overridevirtual

Implements BaseCPU.

Definition at line 466 of file base.cc.

References SimpleThread::activate(), DPRINTF, kick(), SimpleThread::status(), ThreadContext::Suspended, and thread.

Member Data Documentation

◆ _kvmRun

struct kvm_run* BaseKvmCPU::_kvmRun
private

Pointer to the kvm_run structure used to communicate parameters with KVM.

Note
This is the base pointer of the MMAPed KVM region. The first page contains the kvm_run structure. Subsequent pages may contain other data such as the MMIO ring buffer.

Definition at line 696 of file base.hh.

Referenced by getGuestData(), getKvmRunState(), handleKvmExit(), handleKvmExitException(), handleKvmExitFailEntry(), handleKvmExitIO(), handleKvmExitUnknown(), notifyFork(), startup(), tick(), and ~BaseKvmCPU().

◆ _status

Status BaseKvmCPU::_status
protected

◆ activeInstPeriod

uint64_t BaseKvmCPU::activeInstPeriod
private

Currently active instruction count breakpoint.

Definition at line 736 of file base.hh.

Referenced by setupInstCounter().

◆ alwaysSyncTC

const bool BaseKvmCPU::alwaysSyncTC
protected

Be conservative and always synchronize the thread context on KVM entry/exit.

Definition at line 620 of file base.hh.

Referenced by tick().

◆ ctrInsts

Counter BaseKvmCPU::ctrInsts

Number of instructions executed by the CPU.

Definition at line 800 of file base.hh.

Referenced by kvmRun(), setupInstStop(), tick(), totalInsts(), and totalOps().

◆ dataPort

KVMCpuPort BaseKvmCPU::dataPort
protected

Port for data requests.

Definition at line 611 of file base.hh.

Referenced by doMMIOAccess(), getDataPort(), handleKvmExit(), and X86KvmCPU::handleKvmExitIO().

◆ hostFactor

float BaseKvmCPU::hostFactor
private

Host factor as specified in the configuration.

Definition at line 780 of file base.hh.

Referenced by kvmRun().

◆ hwCycles

PerfKvmCounter BaseKvmCPU::hwCycles
private

Guest cycle counter.

This is the group leader of all performance counters measuring the guest system. It can be used in conjunction with the PerfKvmTimer (see perfControlledByTimer) to trigger exits from KVM.

Definition at line 746 of file base.hh.

Referenced by getHostCycles(), kvmRun(), notifyFork(), setupCounters(), setupInstCounter(), and startupThread().

◆ hwInstructions

PerfKvmCounter BaseKvmCPU::hwInstructions
private

Guest instruction counter.

This counter is typically only used to measure the number of instructions executed by the guest. However, it can also be used to trigger exits from KVM if the configuration script requests an exit after a certain number of instructions.

See also
setupInstBreak
scheduleInstStop

Definition at line 759 of file base.hh.

Referenced by kvmRun(), notifyFork(), and setupInstCounter().

◆ instPort

KVMCpuPort BaseKvmCPU::instPort
protected

Unused dummy port for the instruction interface.

Definition at line 614 of file base.hh.

Referenced by getInstPort().

◆ kvmStateDirty

bool BaseKvmCPU::kvmStateDirty
protected

Is the KVM state dirty? Set to true to force an update of the KVM vCPU state upon the next call to kvmRun().

Definition at line 632 of file base.hh.

Referenced by syncKvmState(), syncThreadContext(), and tick().

◆ mmioRing

struct kvm_coalesced_mmio_ring* BaseKvmCPU::mmioRing
private

Coalesced MMIO ring buffer.

NULL if coalesced MMIO is not supported.

Definition at line 701 of file base.hh.

Referenced by flushCoalescedMMIO(), and startup().

◆ pageSize

const long BaseKvmCPU::pageSize
private

Cached page size of the host.

Definition at line 703 of file base.hh.

Referenced by startup().

◆ perfControlledByTimer

bool BaseKvmCPU::perfControlledByTimer
private

Does the runTimer control the performance counters?

The run timer will automatically enable and disable performance counters if a PerfEvent-based timer is used to control KVM exits.

Definition at line 768 of file base.hh.

Referenced by kvmRun(), and setupCounters().

◆ runTimer

std::unique_ptr<BaseKvmTimer> BaseKvmCPU::runTimer
private

Timer used to force execution into the monitor after a specified number of simulation tick equivalents have executed in the guest.

This counter generates the signal specified by KVM_TIMER_SIGNAL.

Definition at line 777 of file base.hh.

Referenced by kvmRun(), startupThread(), and tick().

◆ stats

BaseKvmCPU::StatGroup BaseKvmCPU::stats

◆ tc

ThreadContext* BaseKvmCPU::tc

◆ thread

SimpleThread* BaseKvmCPU::thread

A cached copy of a thread's state in the form of a SimpleThread object.

Normally the actual thread state is stored in the KVM vCPU. If KVM has been running this copy is will be out of date. If we recently handled some events within gem5 that required state to be updated this could be the most up-to-date copy. When getContext() or updateThreadContext() is called this copy gets updated. The method syncThreadContext can be used within a KVM CPU to update the thread context if the KVM state is dirty (i.e., the vCPU has been run since the last update).

Definition at line 143 of file base.hh.

Referenced by activateContext(), X86KvmCPU::deliverInterrupts(), doMMIOAccess(), handleKvmExit(), serializeThread(), setupInstStop(), suspendContext(), tick(), unserializeThread(), and wakeup().

◆ threadContextDirty

bool BaseKvmCPU::threadContextDirty
protected

Is the gem5 context dirty? Set to true to force an update of the KVM vCPU state upon the next call to kvmRun().

Definition at line 626 of file base.hh.

Referenced by X86KvmCPU::deliverInterrupts(), doMMIOAccess(), syncKvmState(), syncThreadContext(), takeOverFrom(), tick(), and unserializeThread().

◆ tickEvent

EventFunctionWrapper BaseKvmCPU::tickEvent
private

◆ vcpuFD

int BaseKvmCPU::vcpuFD
private

KVM vCPU file descriptor.

Definition at line 685 of file base.hh.

Referenced by ioctl(), kvmRun(), notifyFork(), startup(), and ~BaseKvmCPU().

◆ vcpuID

const long BaseKvmCPU::vcpuID
protected

KVM internal ID of the vCPU.

Definition at line 635 of file base.hh.

Referenced by getVCpuID(), BaseArmKvmCPU::kvmRun(), ArmKvmCPU::kvmRun(), and startup().

◆ vcpuMMapSize

int BaseKvmCPU::vcpuMMapSize
private

Size of MMAPed kvm_run area.

Definition at line 687 of file base.hh.

Referenced by notifyFork(), startup(), and ~BaseKvmCPU().

◆ vcpuThread

pthread_t BaseKvmCPU::vcpuThread
protected

ID of the vCPU thread.

Definition at line 638 of file base.hh.

Referenced by kick(), and startupThread().

◆ vm

KvmVM& BaseKvmCPU::vm

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

Generated on Wed Sep 30 2020 14:02:21 for gem5 by doxygen 1.8.17