Go to the documentation of this file.
40 #include <linux/kvm.h>
41 #include <sys/ioctl.h>
49 #include "arch/utility.hh"
50 #include "debug/Checkpoint.hh"
51 #include "debug/Drain.hh"
52 #include "debug/Kvm.hh"
53 #include "debug/KvmIO.hh"
54 #include "debug/KvmRun.hh"
55 #include "params/BaseKvmCPU.hh"
60 #define PAGE_SIZE pageSize
66 dataPort(
name() +
".dcache_port", this),
67 instPort(
name() +
".icache_port", this),
68 alwaysSyncTC(params->alwaysSyncTC),
69 threadContextDirty(true),
71 vcpuID(
vm.allocVCPUID()), vcpuFD(-1), vcpuMMapSize(0),
72 _kvmRun(NULL), mmioRing(NULL),
73 pageSize(sysconf(_SC_PAGE_SIZE)),
74 tickEvent([this]{
tick(); },
"BaseKvmCPU tick",
77 perfControlledByTimer(params->usePerfOverflow),
78 hostFactor(params->hostFactor), stats(
this),
82 panic(
"KVM: Failed to determine host page size (%i)\n",
86 thread =
new SimpleThread(
this, 0, params->system, params->itb, params->dtb,
90 params->workload[0], params->itb,
91 params->dtb, params->isa[0]);
95 threadContexts.push_back(tc);
111 fatal(
"KVM: Multithreading not supported");
119 const BaseKvmCPUParams *
const p(
120 dynamic_cast<const BaseKvmCPUParams *
>(
params()));
139 PROT_READ | PROT_WRITE, MAP_SHARED,
142 panic(
"KVM: Failed to map run data structure\n");
148 if (!
p->useCoalescedMMIO) {
149 inform(
"KVM: Coalesced MMIO disabled by config.\n");
150 }
else if (mmioOffset) {
151 inform(
"KVM: Coalesced IO available\n");
152 mmioRing = (
struct kvm_coalesced_mmio_ring *)(
155 inform(
"KVM: Coalesced not supported by host OS\n");
160 schedule(startupEvent,
curTick());
173 if (cpu->system->isAtomicMode()) {
174 Tick delay = sendAtomic(pkt);
178 if (pendingMMIOPkts.empty() && sendTimingReq(pkt)) {
181 pendingMMIOPkts.push(pkt);
191 DPRINTF(KvmIO,
"KVM: Finished timing request\n");
198 if (!(activeMMIOReqs || pendingMMIOPkts.size())) {
199 DPRINTF(KvmIO,
"KVM: Finished all outstanding timing requests\n");
200 cpu->finishMMIOPending();
208 DPRINTF(KvmIO,
"KVM: Retry for timing request\n");
210 assert(pendingMMIOPkts.size());
215 while (pendingMMIOPkts.size() && sendTimingReq(pendingMMIOPkts.front())) {
216 pendingMMIOPkts.pop();
238 const BaseKvmCPUParams *
const p(
239 dynamic_cast<const BaseKvmCPUParams *
>(
params()));
249 if (
p->usePerfOverflow)
262 :
Stats::Group(parent),
263 ADD_STAT(committedInsts,
"Number of instructions committed"),
264 ADD_STAT(numVMExits,
"total number of KVM exits"),
266 "number of KVM entries to finalize pending operations"),
267 ADD_STAT(numExitSignal,
"exits due to signal delivery"),
268 ADD_STAT(numMMIO,
"number of VM exits due to memory mapped IO"),
270 "number of coalesced memory mapped IO requests"),
271 ADD_STAT(numIO,
"number of VM exits due to legacy IO"),
273 "number of VM exits due to wait for interrupt instructions"),
274 ADD_STAT(numInterrupts,
"number of interrupts delivered"),
275 ADD_STAT(numHypercalls,
"number of hypercalls")
283 DPRINTF(Checkpoint,
"KVM: Serializing thread %i:\n", tid);
295 DPRINTF(Checkpoint,
"KVM: Unserialize thread %i:\n", tid);
309 DPRINTF(Drain,
"BaseKvmCPU::drain\n");
315 std::lock_guard<EventQueue>
lock(*this->eventQueue());
353 DPRINTF(Drain,
"KVM CPU is waiting for service completion, "
354 "requesting drain.\n");
359 DPRINTF(Drain,
"KVM CPU is waiting for timing accesses to complete, "
360 "requesting drain.\n");
365 DPRINTF(Drain,
"KVM CPU is waiting for service, requesting drain.\n");
369 panic(
"KVM: Unhandled CPU state in drain()\n");
407 warn(
"kvm CPU: notifyFork failed to close vcpuFD\n");
460 fatal(
"The KVM-based CPUs requires the memory system to be in the "
461 "'noncaching' mode.\n");
486 DPRINTF(
Kvm,
"ActivateContext %d\n", thread_num);
488 assert(thread_num == 0);
504 DPRINTF(
Kvm,
"SuspendContext %d\n", thread_num);
506 assert(thread_num == 0);
557 hack_once(
"Pretending totalOps is equivalent to totalInsts()\n");
564 inform(
"State dumping not implemented.");
585 const uint64_t nextInstEvent(
586 queue.empty() ?
MaxTick : queue.nextTick());
589 const Tick ticksToExecute(
602 if (ticksToExecute > 0)
605 DPRINTF(KvmRun,
"Entering KVM...\n");
613 delay =
kvmRun(ticksToExecute);
632 if (
_kvmRun->exit_reason != KVM_EXIT_INTR) {
649 panic(
"BaseKvmCPU entered tick() in an illegal state (%i)\n",
656 schedule(
tickEvent, clockEdge(ticksToCycles(
659 schedule(
tickEvent, clockEdge(ticksToCycles(delay)));
688 "Trying to run a KVM CPU in a forked child process. "
689 "This is not supported.\n");
690 DPRINTF(KvmRun,
"KVM: Executing for %i ticks\n", ticks);
696 DPRINTF(KvmRun,
"KVM: Delivering IO without full guest entry\n");
717 ticksExecuted = clockPeriod();
727 if (ticks < runTimer->resolution()) {
728 DPRINTF(KvmRun,
"KVM: Adjusting tick count (%i -> %i)\n",
759 const uint64_t hostCyclesExecuted(
getHostCycles() - baseCycles);
760 const uint64_t simCyclesExecuted(hostCyclesExecuted *
hostFactor);
762 ticksExecuted =
runTimer->ticksFromHostCycles(hostCyclesExecuted);
771 "KVM: Executed %i instructions in %i cycles "
772 "(%i ticks, sim cycles: %i).\n",
773 instsExecuted, hostCyclesExecuted, ticksExecuted, simCyclesExecuted);
785 if (
ioctl(KVM_NMI) == -1)
786 panic(
"KVM: Failed to deliver NMI to virtual CPU\n");
793 if (
ioctl(KVM_INTERRUPT, (
void *)&interrupt) == -1)
794 panic(
"KVM: Failed to deliver interrupt to virtual CPU\n");
800 if (
ioctl(KVM_GET_REGS, ®s) == -1)
801 panic(
"KVM: Failed to get guest registers\n");
807 if (
ioctl(KVM_SET_REGS, (
void *)®s) == -1)
808 panic(
"KVM: Failed to set guest registers\n");
814 if (
ioctl(KVM_GET_SREGS, ®s) == -1)
815 panic(
"KVM: Failed to get guest special registers\n");
821 if (
ioctl(KVM_SET_SREGS, (
void *)®s) == -1)
822 panic(
"KVM: Failed to set guest special registers\n");
828 if (
ioctl(KVM_GET_FPU, &state) == -1)
829 panic(
"KVM: Failed to get guest FPU state\n");
835 if (
ioctl(KVM_SET_FPU, (
void *)&state) == -1)
836 panic(
"KVM: Failed to set guest FPU state\n");
843 #ifdef KVM_SET_ONE_REG
844 struct kvm_one_reg
reg;
848 if (
ioctl(KVM_SET_ONE_REG, &
reg) == -1) {
849 panic(
"KVM: Failed to set register (0x%x) value (errno: %i)\n",
853 panic(
"KVM_SET_ONE_REG is unsupported on this platform.\n");
860 #ifdef KVM_GET_ONE_REG
861 struct kvm_one_reg
reg;
865 if (
ioctl(KVM_GET_ONE_REG, &
reg) == -1) {
866 panic(
"KVM: Failed to get register (0x%x) value (errno: %i)\n",
870 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
877 #ifdef KVM_GET_ONE_REG
878 std::ostringstream
ss;
880 ss.setf(std::ios::hex, std::ios::basefield);
881 ss.setf(std::ios::showbase);
882 #define HANDLE_INTTYPE(len) \
883 case KVM_REG_SIZE_U ## len: { \
884 uint ## len ## _t value; \
885 getOneReg(id, &value); \
889 #define HANDLE_ARRAY(len) \
890 case KVM_REG_SIZE_U ## len: { \
891 uint8_t value[len / 8]; \
892 getOneReg(id, value); \
893 ccprintf(ss, "[0x%x", value[0]); \
894 for (int i = 1; i < len / 8; ++i) \
895 ccprintf(ss, ", 0x%x", value[i]); \
899 switch (
id & KVM_REG_SIZE_MASK) {
912 #undef HANDLE_INTTYPE
917 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
948 DPRINTF(KvmRun,
"handleKvmExit (exit_reason: %i)\n",
_kvmRun->exit_reason);
954 switch (
_kvmRun->exit_reason) {
955 case KVM_EXIT_UNKNOWN:
958 case KVM_EXIT_EXCEPTION:
969 case KVM_EXIT_HYPERCALL:
987 DPRINTF(KvmIO,
"KVM: Handling MMIO (w: %u, addr: 0x%x, len: %u)\n",
1001 case KVM_EXIT_IRQ_WINDOW_OPEN:
1004 case KVM_EXIT_FAIL_ENTRY:
1012 case KVM_EXIT_INTERNAL_ERROR:
1013 panic(
"KVM: Internal error (suberror: %u)\n",
1018 panic(
"KVM: Unexpected exit (exit_reason: %u)\n",
_kvmRun->exit_reason);
1025 panic(
"KVM: Unhandled guest IO (dir: %i, size: %i, port: 0x%x, count: %i)\n",
1033 panic(
"KVM: Unhandled hypercall\n");
1039 warn(
"KVM: Unhandled IRQ window.\n");
1048 panic(
"KVM: Unknown error when starting vCPU (hw reason: 0x%llx)\n",
1049 _kvmRun->hw.hardware_exit_reason);
1056 panic(
"KVM: Got exception when starting vCPU "
1057 "(exception: %u, error_code: %u)\n",
1065 panic(
"KVM: Failed to enter virtualized mode (hw reason: 0x%llx)\n",
1066 _kvmRun->fail_entry.hardware_entry_failure_reason);
1075 RequestPtr mmio_req = std::make_shared<Request>(
1086 warn(
"Finalization of MMIO address failed: %s\n", fault->name());
1093 if (mmio_req->isLocalAccess()) {
1097 const Cycles ipr_delay = mmio_req->localAccessor(
tc, pkt);
1100 return clockPeriod() * ipr_delay;
1113 std::unique_ptr<struct kvm_signal_mask> kvm_mask;
1116 kvm_mask.reset((
struct kvm_signal_mask *)
operator new(
1117 sizeof(
struct kvm_signal_mask) +
sizeof(*
mask)));
1121 assert(
sizeof(*
mask) >= 8);
1123 memcpy(kvm_mask->sigset,
mask, kvm_mask->len);
1126 if (
ioctl(KVM_SET_SIGNAL_MASK, (
void *)kvm_mask.get()) == -1)
1127 panic(
"KVM: Failed to set vCPU signal mask (errno: %i)\n",
1135 panic(
"KVM: CPU ioctl called before initialization\n");
1137 return ::ioctl(
vcpuFD, request, p1);
1146 DPRINTF(KvmIO,
"KVM: Flushing the coalesced MMIO ring buffer\n");
1152 struct kvm_coalesced_mmio &ent(
1155 DPRINTF(KvmIO,
"KVM: Handling coalesced MMIO (addr: 0x%x, len: %u)\n",
1156 ent.phys_addr, ent.len);
1159 ticks +=
doMMIOAccess(ent.phys_addr, ent.data, ent.len,
true);
1185 struct sigaction
sa;
1187 memset(&
sa, 0,
sizeof(
sa));
1189 sa.sa_flags = SA_SIGINFO | SA_RESTART;
1191 panic(
"KVM: Failed to setup vCPU timer signal handler\n");
1194 if (pthread_sigmask(SIG_BLOCK, NULL, &sigset) == -1)
1195 panic(
"KVM: Failed get signal mask\n");
1207 if (pthread_sigmask(SIG_SETMASK, &sigset, NULL) == -1)
1208 panic(
"KVM: Failed mask the KVM control signals\n");
1214 int discardedSignal;
1218 struct timespec timeout;
1220 timeout.tv_nsec = 0;
1223 sigemptyset(&sigset);
1224 sigaddset(&sigset, signum);
1227 discardedSignal = sigtimedwait(&sigset, NULL, &timeout);
1228 }
while (discardedSignal == -1 && errno == EINTR);
1230 if (discardedSignal == signum)
1232 else if (discardedSignal == -1 && errno == EAGAIN)
1235 panic(
"Unexpected return value from sigtimedwait: %i (errno: %i)\n",
1236 discardedSignal, errno);
1242 DPRINTF(
Kvm,
"Attaching cycle counter...\n");
1244 PERF_COUNT_HW_CPU_CYCLES);
1277 DPRINTF(Drain,
"tryDrain: Architecture code is not ready.\n");
1283 "tryDrain: CPU transitioned into the Idle state, drain done\n");
1287 DPRINTF(Drain,
"tryDrain: CPU not ready.\n");
1295 if (
ioctl(KVM_RUN) == -1) {
1297 panic(
"KVM: Failed to start virtual CPU (errno: %i)\n",
1323 PERF_COUNT_HW_INSTRUCTIONS);
Kvm * kvm
Global KVM interface.
EventFunctionWrapper tickEvent
#define fatal(...)
This implements a cprintf based fatal() function.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void setOneReg(uint64_t id, const void *addr)
Get/Set single register using the KVM_(SET|GET)_ONE_REG API.
void kvmNonMaskableInterrupt()
Send a non-maskable interrupt to the guest.
bool scheduled() const
Determine if the current event is scheduled.
const bool alwaysSyncTC
Be conservative and always synchronize the thread context on KVM entry/exit.
@ Running
Running normally.
const long pageSize
Cached page size of the host.
void setupSignalHandler()
Setup a signal handler to catch the timer signal used to switch back to the monitor.
void setupInstStop()
Setup an instruction break if there is one pending.
pthread_t vcpuThread
ID of the vCPU thread.
bool kvmStateDirty
Is the KVM state dirty? Set to true to force an update of the KVM vCPU state upon the next call to kv...
int getVCPUMMapSize() const
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and ...
void ioctlRun()
Execute the KVM_RUN ioctl.
KVMCpuPort dataPort
Port for data requests.
#define KVM_KICK_SIGNAL
Signal to use to trigger exits from KVM.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
ThreadContext * getContext(int tn) override
Given a thread num get tho thread context for it.
PerfKvmCounterConfig & exclude_host(bool val)
Exclude the events from the host (i.e., only include events from the guest system).
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 sw...
int16_t ThreadID
Thread index/ID type.
Tick lastActivate
Last time activate was called on this thread.
std::string getAndFormatOneReg(uint64_t id) const
Get and format one register for printout.
PerfKvmCounterConfig & samplePeriod(uint64_t period)
Set the initial sample period (overflow count) of an event.
Stats::Scalar numVMHalfEntries
bool discardPendingSignal(int signum) const
Discard a (potentially) pending signal.
Status _status
CPU run state.
BaseKvmCPU(BaseKvmCPUParams *params)
PerfKvmCounterConfig & wakeupEvents(uint32_t events)
Set the number of samples that need to be triggered before reporting data as being available on the p...
uint64_t Tick
Tick count type.
void setFPUState(const struct kvm_fpu &state)
void setupInstCounter(uint64_t period=0)
Setup the guest instruction counter.
void setRegisters(const struct kvm_regs ®s)
void suspend() override
Set the status to Suspended.
virtual Tick handleKvmExitException()
An unhandled virtualization exception occured.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
void detach()
Detach a counter from PerfEvent.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::shared_ptr< Request > RequestPtr
void switchOut() override
Prepare for another CPU to take over execution.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Status status() const override
virtual Tick handleKvmExit()
Main kvmRun exit handler, calls the relevant handleKvmExit* depending on exit type.
void getOneReg(uint64_t id, void *addr) const
PerfEvent counter configuration.
virtual uint64_t getHostCycles() const
Get the value of the hardware cycle counter in the guest.
Tick submitIO(PacketPtr pkt)
Interface to send Atomic or Timing IO request.
void cpuStartup()
VM CPU initialization code.
Stats::Scalar numCoalescedMMIO
virtual Tick handleKvmExitUnknown()
An unknown architecture dependent error occurred when starting the vCPU.
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
@ Drained
Buffers drained, ready for serialization/handover.
BaseKvmCPU::StatGroup stats
DrainState
Object drain/handover states.
void kvmInterrupt(const struct kvm_interrupt &interrupt)
Send a normal interrupt to the guest.
void enableSignals(pid_t tid, int signal)
Enable signal delivery to a thread on counter overflow.
int64_t Counter
Statistics counter type.
int vcpuFD
KVM vCPU file descriptor.
Counter totalOps() const override
void syncThreadContext()
Update a thread context if the KVM state is dirty with respect to the cached thread context.
int createVCPU(long vcpuID)
Create a new vCPU within a VM.
virtual void initMemProxies(ThreadContext *tc)=0
Initialise the physical and virtual port proxies and tie them to the data port of the CPU.
@ RunningServiceCompletion
Service completion in progress.
SimpleThread * thread
A cached copy of a thread's state in the form of a SimpleThread object.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void suspendContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now suspended.
virtual Tick handleKvmExitHypercall()
The guest requested a monitor service using a hypercall.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
Tick lastSuspend
Last time suspend was called on this thread.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
virtual Tick handleKvmExitIO()
The guest performed a legacy IO request (out/inp on x86)
@ Halted
Permanently shut down.
Stats::Scalar numInterrupts
bool perfControlledByTimer
Does the runTimer control the performance counters?
std::shared_ptr< FaultBase > Fault
void start()
Start counting.
bool empty() const
Returns true if no events are queued.
void setupCounters()
Setup hardware performance counters.
std::vector< ThreadContext * > threadContexts
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
virtual Tick kvmRun(Tick ticks)
Request KVM to run the guest for a given number of ticks.
StatGroup(Stats::Group *parent)
bool bypassCaches() const
Should caches be bypassed?
virtual ContextID contextId() const =0
EventQueue * curEventQueue()
Stats::Scalar numExitSignal
@ RunningMMIOPending
Timing MMIO request in flight or stalled.
@ UNCACHEABLE
The request is to an uncacheable address.
Tick doMMIOAccess(Addr paddr, void *data, int size, bool write)
Inject a memory mapped IO request into gem5.
EventQueue * deviceEventQueue()
Get a pointer to the event queue owning devices.
virtual void dump() const
Dump the internal state to the terminal.
void startupThread()
Thread-specific initialization.
constexpr decltype(nullptr) NoFault
virtual Status status() const =0
static void onKickSignal(int signo, siginfo_t *si, void *data)
Dummy handler for KVM kick signals.
void getFPUState(struct kvm_fpu &state) const
Get/Set the guest FPU/vector state.
void kick() const
Force an exit from KVM.
void notifyFork() override
int capCoalescedMMIO() const
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in.
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual Tick kvmRunDrain()
Request the CPU to run until draining completes.
const Params * params() const
DrainState drain() override
const std::string & name()
void activate() override
Set the status to Active.
void tick()
Execute the CPU until the next event in the main event queue or until the guest needs service from ge...
int ioctl(int request, long p1) const
vCPU ioctl interface.
bool threadContextDirty
Is the gem5 context dirty? Set to true to force an update of the KVM vCPU state upon the next call to...
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
const long vcpuID
KVM internal ID of the vCPU.
EventQueue comInstEventQueue
An instruction-based event queue.
Counter ctrInsts
Number of instructions executed by the CPU.
void finishMMIOPending()
Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests hav...
@ RunningService
Requiring service at the beginning of the next cycle.
@ Suspended
Temporarily inactive.
Counter totalInsts() const override
uint64_t activeInstPeriod
Currently active instruction count breakpoint.
virtual void updateThreadContext()=0
Update the current thread context with the KVM state.
@ Idle
Context not scheduled in KVM.
std::unique_ptr< BaseKvmTimer > runTimer
Timer used to force execution into the monitor after a specified number of simulation tick equivalent...
ThreadContext * tc
ThreadContext object, provides an interface for external objects to modify this thread's state.
void stop()
Stop counting.
virtual Tick handleKvmExitIRQWindowOpen()
The guest exited because an interrupt window was requested.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
uint64_t read() const
Read the current value of a counter.
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void getSpecialRegisters(struct kvm_sregs ®s) const
virtual void switchOut()
Prepare for another CPU to take over execution.
int vcpuMMapSize
Size of MMAPed kvm_run area.
Stats::Scalar committedInsts
unsigned int activeMMIOReqs
Number of MMIO requests in flight.
PerfKvmCounterConfig & disabled(bool val)
Don't start the performance counter automatically when attaching it.
void drainResume() override
struct kvm_run * _kvmRun
Pointer to the kvm_run structure used to communicate parameters with KVM.
void syncKvmState()
Update the KVM if the thread context is dirty.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
virtual void updateKvmState()=0
Update the KVM state from the current thread context.
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
Cycles is a wrapper class for representing cycle counts, i.e.
Tick flushCoalescedMMIO()
Service MMIO requests in the mmioRing.
virtual bool archIsDrained() const
Is the architecture specific code in a state that prevents draining?
std::ostream CheckpointOut
Stats::Scalar numHypercalls
struct kvm_coalesced_mmio_ring * mmioRing
Coalesced MMIO ring buffer.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
void setSpecialRegisters(const struct kvm_sregs ®s)
void wakeup(ThreadID tid=0) override
bool attached() const
Check if a counter is attached.
Timer based on standard POSIX timers.
void getRegisters(struct kvm_regs ®s) const
Get/Set the register state of the guest vCPU.
std::queue< PacketPtr > pendingMMIOPkts
Pending MMIO packets.
float hostFactor
Host factor as specified in the configuration.
bool tryDrain()
Try to drain the CPU if a drain is pending.
bool switchedOut() const
Determine if the CPU is switched out.
void attach(PerfKvmCounterConfig &config, pid_t tid)
Attach a counter.
PerfKvmCounterConfig & exclude_hv(bool val)
Exclude the hyper visor (i.e., only include events from the guest system).
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
PerfKvmCounter hwInstructions
Guest instruction counter.
PerfKvmCounter hwCycles
Guest cycle counter.
void activateContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now active.
void deallocateContext(ThreadID thread_num)
void setSignalMask(const sigset_t *mask)
Set the signal mask used in kvmRun()
virtual Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const =0
Do post-translation physical address finalization.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
virtual BaseTLB * getDTBPtr()=0
@ Draining
Draining buffers pending serialization/handover.
PerfKvmCounterConfig & pinned(bool val)
Force the group to be on the active all the time (i.e., disallow multiplexing).
PerfEvent based timer using the host's CPU cycle counter.
virtual Tick handleKvmExitFailEntry()
KVM failed to start the virtualized CPU.
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Status nextIOState() const
Returns next valid state after one or more IO accesses.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17