Go to the documentation of this file.
40 #include <linux/kvm.h>
41 #include <sys/ioctl.h>
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
69 dataPort(
name() +
".dcache_port", this),
70 instPort(
name() +
".icache_port", this),
71 alwaysSyncTC(params.alwaysSyncTC),
72 threadContextDirty(true),
74 vcpuID(
vm.allocVCPUID()), vcpuFD(-1), vcpuMMapSize(0),
75 _kvmRun(NULL), mmioRing(NULL),
76 pageSize(sysconf(_SC_PAGE_SIZE)),
77 tickEvent([this]{
tick(); },
"BaseKvmCPU tick",
80 perfControlledByTimer(params.usePerfOverflow),
81 hostFactor(params.hostFactor), stats(
this),
85 panic(
"KVM: Failed to determine host page size (%i)\n",
89 thread =
new SimpleThread(
this, 0, params.system, params.mmu,
90 params.isa[0], params.decoder[0]);
93 params.workload[0], params.mmu,
94 params.isa[0], params.decoder[0]);
98 threadContexts.push_back(tc);
112 fatal_if(numThreads != 1,
"KVM: Multithreading not supported");
118 const BaseKvmCPUParams &
p =
119 dynamic_cast<const BaseKvmCPUParams &
>(params());
138 PROT_READ | PROT_WRITE, MAP_SHARED,
141 panic(
"KVM: Failed to map run data structure\n");
147 if (!
p.useCoalescedMMIO) {
148 inform(
"KVM: Coalesced MMIO disabled by config.\n");
149 }
else if (mmioOffset) {
150 inform(
"KVM: Coalesced IO available\n");
151 mmioRing = (
struct kvm_coalesced_mmio_ring *)(
154 inform(
"KVM: Coalesced not supported by host OS\n");
172 if (cpu->system->isAtomicMode()) {
173 Tick delay = sendAtomic(pkt);
177 if (pendingMMIOPkts.empty() && sendTimingReq(pkt)) {
180 pendingMMIOPkts.push(pkt);
190 DPRINTF(KvmIO,
"KVM: Finished timing request\n");
197 if (!(activeMMIOReqs || pendingMMIOPkts.size())) {
198 DPRINTF(KvmIO,
"KVM: Finished all outstanding timing requests\n");
199 cpu->finishMMIOPending();
207 DPRINTF(KvmIO,
"KVM: Retry for timing request\n");
209 assert(pendingMMIOPkts.size());
214 while (pendingMMIOPkts.size() && sendTimingReq(pendingMMIOPkts.front())) {
215 pendingMMIOPkts.pop();
237 const BaseKvmCPUParams &
p =
238 dynamic_cast<const BaseKvmCPUParams &
>(params());
248 if (
p.usePerfOverflow) {
261 : statistics::
Group(parent),
262 ADD_STAT(committedInsts, statistics::units::Count::get(),
263 "Number of instructions committed"),
264 ADD_STAT(numVMExits, statistics::units::Count::get(),
265 "total number of KVM exits"),
266 ADD_STAT(numVMHalfEntries, statistics::units::Count::get(),
267 "number of KVM entries to finalize pending operations"),
268 ADD_STAT(numExitSignal, statistics::units::Count::get(),
269 "exits due to signal delivery"),
270 ADD_STAT(numMMIO, statistics::units::Count::get(),
271 "number of VM exits due to memory mapped IO"),
272 ADD_STAT(numCoalescedMMIO, statistics::units::Count::get(),
273 "number of coalesced memory mapped IO requests"),
274 ADD_STAT(numIO, statistics::units::Count::get(),
275 "number of VM exits due to legacy IO"),
276 ADD_STAT(numHalt, statistics::units::Count::get(),
277 "number of VM exits due to wait for interrupt instructions"),
278 ADD_STAT(numInterrupts, statistics::units::Count::get(),
279 "number of interrupts delivered"),
280 ADD_STAT(numHypercalls, statistics::units::Count::get(),
"number of hypercalls")
287 if (debug::Checkpoint) {
288 DPRINTF(Checkpoint,
"KVM: Serializing thread %i:\n", tid);
300 DPRINTF(Checkpoint,
"KVM: Unserialize thread %i:\n", tid);
314 DPRINTF(Drain,
"BaseKvmCPU::drain\n");
320 std::lock_guard<EventQueue>
lock(*this->eventQueue());
358 DPRINTF(Drain,
"KVM CPU is waiting for service completion, "
359 "requesting drain.\n");
364 DPRINTF(Drain,
"KVM CPU is waiting for timing accesses to complete, "
365 "requesting drain.\n");
370 DPRINTF(Drain,
"KVM CPU is waiting for service, requesting drain.\n");
374 panic(
"KVM: Unhandled CPU state in drain()\n");
419 warn(
"kvm CPU: notifyFork failed to close vcpuFD\n");
437 BaseCPU::switchOut();
458 assert(threadContexts.size() == 1);
471 if (!(
system->bypassCaches())) {
472 fatal(
"The KVM-based CPUs requires the memory system to be in the "
473 "'noncaching' mode.\n");
498 DPRINTF(
Kvm,
"ActivateContext %d\n", thread_num);
500 assert(thread_num == 0);
506 baseStats.numCycles +=
517 DPRINTF(
Kvm,
"SuspendContext %d\n", thread_num);
519 assert(thread_num == 0);
549 updateCycleCounters(BaseCPU::CPU_STATE_SLEEP);
570 hack_once(
"Pretending totalOps is equivalent to totalInsts()\n");
577 inform(
"State dumping not implemented.");
598 const uint64_t nextInstEvent(
599 queue.empty() ?
MaxTick : queue.nextTick());
602 const Tick ticksToExecute(
615 if (ticksToExecute > 0)
618 DPRINTF(KvmRun,
"Entering KVM...\n");
626 delay =
kvmRun(ticksToExecute);
645 if (
_kvmRun->exit_reason != KVM_EXIT_INTR) {
662 panic(
"BaseKvmCPU entered tick() in an illegal state (%i)\n",
669 schedule(
tickEvent, clockEdge(ticksToCycles(
672 schedule(
tickEvent, clockEdge(ticksToCycles(delay)));
701 "Trying to run a KVM CPU in a forked child process. "
702 "This is not supported.\n");
703 DPRINTF(KvmRun,
"KVM: Executing for %i ticks\n", ticks);
709 DPRINTF(KvmRun,
"KVM: Delivering IO without full guest entry\n");
730 ticksExecuted = clockPeriod();
740 if (ticks < runTimer->resolution()) {
741 DPRINTF(KvmRun,
"KVM: Adjusting tick count (%i -> %i)\n",
772 const uint64_t hostCyclesExecuted(
getHostCycles() - baseCycles);
773 const uint64_t simCyclesExecuted(hostCyclesExecuted *
hostFactor);
775 ticksExecuted =
runTimer->ticksFromHostCycles(hostCyclesExecuted);
778 baseStats.numCycles += simCyclesExecuted;;
783 "KVM: Executed %i instructions in %i cycles "
784 "(%i ticks, sim cycles: %i).\n",
785 instsExecuted, hostCyclesExecuted, ticksExecuted, simCyclesExecuted);
797 if (
ioctl(KVM_NMI) == -1)
798 panic(
"KVM: Failed to deliver NMI to virtual CPU\n");
805 if (
ioctl(KVM_INTERRUPT, (
void *)&interrupt) == -1)
806 panic(
"KVM: Failed to deliver interrupt to virtual CPU\n");
812 if (
ioctl(KVM_GET_REGS, ®s) == -1)
813 panic(
"KVM: Failed to get guest registers\n");
819 if (
ioctl(KVM_SET_REGS, (
void *)®s) == -1)
820 panic(
"KVM: Failed to set guest registers\n");
826 if (
ioctl(KVM_GET_SREGS, ®s) == -1)
827 panic(
"KVM: Failed to get guest special registers\n");
833 if (
ioctl(KVM_SET_SREGS, (
void *)®s) == -1)
834 panic(
"KVM: Failed to set guest special registers\n");
840 if (
ioctl(KVM_GET_FPU, &state) == -1)
841 panic(
"KVM: Failed to get guest FPU state\n");
847 if (
ioctl(KVM_SET_FPU, (
void *)&state) == -1)
848 panic(
"KVM: Failed to set guest FPU state\n");
855 #ifdef KVM_SET_ONE_REG
856 struct kvm_one_reg
reg;
860 if (
ioctl(KVM_SET_ONE_REG, &
reg) == -1) {
861 panic(
"KVM: Failed to set register (0x%x) value (errno: %i)\n",
865 panic(
"KVM_SET_ONE_REG is unsupported on this platform.\n");
872 #ifdef KVM_GET_ONE_REG
873 struct kvm_one_reg
reg;
877 if (
ioctl(KVM_GET_ONE_REG, &
reg) == -1) {
878 panic(
"KVM: Failed to get register (0x%x) value (errno: %i)\n",
882 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
889 #ifdef KVM_GET_ONE_REG
890 std::ostringstream
ss;
892 ss.setf(std::ios::hex, std::ios::basefield);
893 ss.setf(std::ios::showbase);
894 #define HANDLE_INTTYPE(len) \
895 case KVM_REG_SIZE_U ## len: { \
896 uint ## len ## _t value; \
897 getOneReg(id, &value); \
901 #define HANDLE_ARRAY(len) \
902 case KVM_REG_SIZE_U ## len: { \
903 uint8_t value[len / 8]; \
904 getOneReg(id, value); \
905 ccprintf(ss, "[0x%x", value[0]); \
906 for (int i = 1; i < len / 8; ++i) \
907 ccprintf(ss, ", 0x%x", value[i]); \
911 switch (
id & KVM_REG_SIZE_MASK) {
924 #undef HANDLE_INTTYPE
929 panic(
"KVM_GET_ONE_REG is unsupported on this platform.\n");
960 DPRINTF(KvmRun,
"handleKvmExit (exit_reason: %i)\n",
_kvmRun->exit_reason);
966 switch (
_kvmRun->exit_reason) {
967 case KVM_EXIT_UNKNOWN:
970 case KVM_EXIT_EXCEPTION:
981 case KVM_EXIT_HYPERCALL:
999 DPRINTF(KvmIO,
"KVM: Handling MMIO (w: %u, addr: 0x%x, len: %u)\n",
1013 case KVM_EXIT_IRQ_WINDOW_OPEN:
1016 case KVM_EXIT_FAIL_ENTRY:
1024 case KVM_EXIT_INTERNAL_ERROR:
1025 panic(
"KVM: Internal error (suberror: %u)\n",
1030 panic(
"KVM: Unexpected exit (exit_reason: %u)\n",
_kvmRun->exit_reason);
1037 panic(
"KVM: Unhandled guest IO (dir: %i, size: %i, port: 0x%x, count: %i)\n",
1045 panic(
"KVM: Unhandled hypercall\n");
1051 warn(
"KVM: Unhandled IRQ window.\n");
1060 panic(
"KVM: Unknown error when starting vCPU (hw reason: 0x%llx)\n",
1061 _kvmRun->hw.hardware_exit_reason);
1068 panic(
"KVM: Got exception when starting vCPU "
1069 "(exception: %u, error_code: %u)\n",
1077 panic(
"KVM: Failed to enter virtualized mode (hw reason: 0x%llx)\n",
1078 _kvmRun->fail_entry.hardware_entry_failure_reason);
1087 RequestPtr mmio_req = std::make_shared<Request>(
1098 warn(
"Finalization of MMIO address failed: %s\n", fault->name());
1105 if (mmio_req->isLocalAccess()) {
1120 const Cycles ipr_delay = mmio_req->localAccessor(
tc, pkt);
1123 return clockPeriod() * ipr_delay;
1136 std::unique_ptr<
struct kvm_signal_mask, void(*)(
void *
p)>
1137 kvm_mask(
nullptr, [](
void *
p) {
operator delete(
p); });
1140 kvm_mask.reset((
struct kvm_signal_mask *)
operator new(
1141 sizeof(
struct kvm_signal_mask) + sizeof(*
mask)));
1145 assert(
sizeof(*
mask) >= 8);
1147 memcpy(kvm_mask->sigset,
mask, kvm_mask->len);
1150 if (
ioctl(KVM_SET_SIGNAL_MASK, (
void *)kvm_mask.get()) == -1)
1151 panic(
"KVM: Failed to set vCPU signal mask (errno: %i)\n",
1159 panic(
"KVM: CPU ioctl called before initialization\n");
1161 return ::ioctl(
vcpuFD, request, p1);
1170 DPRINTF(KvmIO,
"KVM: Flushing the coalesced MMIO ring buffer\n");
1176 struct kvm_coalesced_mmio &ent(
1179 DPRINTF(KvmIO,
"KVM: Handling coalesced MMIO (addr: 0x%x, len: %u)\n",
1180 ent.phys_addr, ent.len);
1183 ticks +=
doMMIOAccess(ent.phys_addr, ent.data, ent.len,
true);
1209 struct sigaction
sa;
1211 memset(&
sa, 0,
sizeof(
sa));
1213 sa.sa_flags = SA_SIGINFO | SA_RESTART;
1215 panic(
"KVM: Failed to setup vCPU timer signal handler\n");
1218 if (pthread_sigmask(SIG_BLOCK, NULL, &sigset) == -1)
1219 panic(
"KVM: Failed get signal mask\n");
1231 if (pthread_sigmask(SIG_SETMASK, &sigset, NULL) == -1)
1232 panic(
"KVM: Failed mask the KVM control signals\n");
1238 int discardedSignal;
1242 struct timespec timeout;
1244 timeout.tv_nsec = 0;
1247 sigemptyset(&sigset);
1248 sigaddset(&sigset, signum);
1251 discardedSignal = sigtimedwait(&sigset, NULL, &timeout);
1252 }
while (discardedSignal == -1 && errno == EINTR);
1254 if (discardedSignal == signum)
1256 else if (discardedSignal == -1 && errno == EAGAIN)
1259 panic(
"Unexpected return value from sigtimedwait: %i (errno: %i)\n",
1260 discardedSignal, errno);
1266 DPRINTF(
Kvm,
"Attaching cycle counter...\n");
1268 PERF_COUNT_HW_CPU_CYCLES);
1306 DPRINTF(Drain,
"tryDrain: Architecture code is not ready.\n");
1312 "tryDrain: CPU transitioned into the Idle state, drain done\n");
1316 DPRINTF(Drain,
"tryDrain: CPU not ready.\n");
1324 if (
ioctl(KVM_RUN) == -1) {
1326 panic(
"KVM: Failed to start virtual CPU (errno: %i)\n",
1352 PERF_COUNT_HW_INSTRUCTIONS);
Tick curTick()
The universal simulation clock.
gem5::BaseKvmCPU::StatGroup stats
#define fatal(...)
This implements a cprintf based fatal() function.
Status _status
CPU run state.
int createVCPU(long vcpuID)
Create a new vCPU within a VM.
constexpr decltype(nullptr) NoFault
int capCoalescedMMIO() const
Check if coalesced MMIO is supported and which page in the MMAP'ed structure it stores requests in.
#define KVM_KICK_SIGNAL
Signal to use to trigger exits from KVM.
bool perfControlledByTimer
Does the runTimer control the performance counters?
@ Halted
Permanently shut down.
StatGroup(statistics::Group *parent)
int ioctl(int request, long p1) const
vCPU ioctl interface.
statistics::Scalar numVMHalfEntries
@ RunningServiceCompletion
Service completion in progress.
EventQueue * deviceEventQueue()
Get a pointer to the event queue owning devices.
void kvmInterrupt(const struct kvm_interrupt &interrupt)
Send a normal interrupt to the guest.
void syncThreadContext()
Update a thread context if the KVM state is dirty with respect to the cached thread context.
bool attached() const
Check if a counter is attached.
void drainResume() override
PerfKvmCounterConfig & pinned(bool val)
Force the group to be on the active all the time (i.e., disallow multiplexing).
virtual BaseMMU * getMMUPtr()=0
virtual const PCStateBase & pcState() const =0
void restartEqThread()
Thread-specific initialization.
const bool alwaysSyncTC
Be conservative and always synchronize the thread context on KVM entry/exit.
virtual void stutterPC(PCStateBase &pc) const =0
Modify a PCStatePtr's value so that its next PC is the current PC.
void kick() const
Force an exit from KVM.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick flushCoalescedMMIO()
Service MMIO requests in the mmioRing.
virtual ContextID contextId() const =0
virtual Tick handleKvmExitFailEntry()
KVM failed to start the virtualized CPU.
std::string getAndFormatOneReg(uint64_t id) const
Get and format one register for printout.
float hostFactor
Host factor as specified in the configuration.
@ RunningService
Requiring service at the beginning of the next cycle.
void suspendContext(ThreadID thread_num) override
void deallocateContext(ThreadID thread_num)
void setupCounters()
Setup hardware performance counters.
void getOneReg(uint64_t id, void *addr) const
virtual Tick handleKvmExit()
Main kvmRun exit handler, calls the relevant handleKvmExit* depending on exit type.
void setFPUState(const struct kvm_fpu &state)
PerfKvmCounter hwCycles
Guest cycle counter.
void activate() override
Set the status to Active.
void wakeup(ThreadID tid=0) override
bool tryDrain()
Try to drain the CPU if a drain is pending.
@ RunningMMIOPending
Timing MMIO request in flight or stalled.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Tick doMMIOAccess(Addr paddr, void *data, int size, bool write)
Inject a memory mapped IO request into gem5.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
void getFPUState(struct kvm_fpu &state) const
Get/Set the guest FPU/vector state.
void notifyFork() override
void verifyMemoryMode() const override
statistics::Scalar committedInsts
void takeOverFrom(ThreadContext &ntc, ThreadContext &otc)
Copy state between thread contexts in preparation for CPU handover.
virtual Status status() const =0
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
void kvmNonMaskableInterrupt()
Send a non-maskable interrupt to the guest.
statistics::Scalar numInterrupts
statistics::Scalar numVMExits
Cycles is a wrapper class for representing cycle counts, i.e.
void detach()
Detach a counter from PerfEvent.
void stop()
Stop counting.
virtual Tick handleKvmExitException()
An unhandled virtualization exception occured.
bool discardPendingSignal(int signum) const
Discard a (potentially) pending signal.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
pthread_t vcpuThread
ID of the vCPU thread.
Tick lastSuspend
Last time suspend was called on this thread.
SimpleThread * thread
A cached copy of a thread's state in the form of a SimpleThread object.
DrainState
Object drain/handover states.
int vcpuFD
KVM vCPU file descriptor.
void enableSignals(pid_t tid, int signal)
Enable signal delivery to a thread on counter overflow.
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...
virtual void ioctlRun()
Execute the KVM_RUN ioctl.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
std::shared_ptr< FaultBase > Fault
EventFunctionWrapper tickEvent
@ Suspended
Temporarily inactive.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
unsigned int activeMMIOReqs
Number of MMIO requests in flight.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setupSignalHandler()
Setup a signal handler to catch the timer signal used to switch back to the monitor.
ThreadContext * tc
ThreadContext object, provides an interface for external objects to modify this thread's state.
void takeOverFrom(BaseCPU *cpu) override
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Tick
Tick count type.
virtual bool archIsDrained() const
Is the architecture specific code in a state that prevents draining?
void switchOut() override
int getVCPUMMapSize() const
Get the size of the MMAPed parameter area used to communicate vCPU parameters between the kernel and ...
std::shared_ptr< Request > RequestPtr
virtual Tick handleKvmExitUnknown()
An unknown architecture dependent error occurred when starting the vCPU.
void tick()
Execute the CPU until the next event in the main event queue or until the guest needs service from ge...
void attach(PerfKvmCounterConfig &config, pid_t tid)
Attach a counter.
void setOneReg(uint64_t id, const void *addr)
Get/Set single register using the KVM_(SET|GET)_ONE_REG API.
void getSpecialRegisters(struct kvm_sregs ®s) const
Status nextIOState() const
Returns next valid state after one or more IO accesses.
PerfKvmCounterConfig & wakeupEvents(uint32_t events)
Set the number of samples that need to be triggered before reporting data as being available on the p...
bool empty() const
Returns true if no events are queued.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
const long vcpuID
KVM internal ID of the vCPU.
Counter ctrInsts
Number of instructions executed by the CPU.
@ Drained
Buffers drained, ready for serialization/handover.
std::queue< PacketPtr > pendingMMIOPkts
Pending MMIO packets.
void finishMMIOPending()
Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests hav...
ThreadContext * getContext(int tn) override
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
virtual Tick handleKvmExitIO()
The guest performed a legacy IO request (out/inp on x86)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void setSignalMask(const sigset_t *mask)
Set the signal mask used in kvmRun()
@ Idle
Context not scheduled in KVM.
const std::string & name()
void setRegisters(const struct kvm_regs ®s)
@ Running
Running normally.
virtual Tick kvmRunDrain()
Request the CPU to run until draining completes.
Kvm * kvm
Global KVM interface.
virtual void updateThreadContext()=0
Update the current thread context with the KVM state.
virtual uint64_t getHostCycles() const
Get the value of the hardware cycle counter in the guest.
PerfEvent based timer using the host's CPU cycle counter.
void cpuStartup()
VM CPU initialization code.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
PerfKvmCounterConfig & exclude_host(bool val)
Exclude the events from the host (i.e., only include events from the guest system).
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
statistics::Scalar numExitSignal
virtual Tick handleKvmExitHypercall()
The guest requested a monitor service using a hypercall.
Tick lastActivate
Last time activate was called on this thread.
void activateContext(ThreadID thread_num) override
BaseKvmCPU(const BaseKvmCPUParams ¶ms)
void suspend() override
Set the status to Suspended.
EventQueue * curEventQueue()
Timer based on standard POSIX timers.
PerfKvmCounterConfig & exclude_hv(bool val)
Exclude the hyper visor (i.e., only include events from the guest system).
int vcpuMMapSize
Size of MMAPed kvm_run area.
uint64_t read() const
Read the current value of a counter.
double Counter
All counters are of 64-bit values.
Counter totalInsts() const override
Tick submitIO(PacketPtr pkt)
Interface to send Atomic or Timing IO request.
@ UNCACHEABLE
The request is to an uncacheable address.
virtual void dump() const
Dump the internal state to the terminal.
statistics::Scalar numMMIO
virtual void updateKvmState()=0
Update the KVM state from the current thread context.
uint64_t activeInstPeriod
Currently active instruction count breakpoint.
struct kvm_run * _kvmRun
Pointer to the kvm_run structure used to communicate parameters with KVM.
struct kvm_coalesced_mmio_ring * mmioRing
Coalesced MMIO ring buffer.
std::unique_ptr< BaseKvmTimer > runTimer
Timer used to force execution into the monitor after a specified number of simulation tick equivalent...
PerfKvmCounterConfig & samplePeriod(uint64_t period)
Set the initial sample period (overflow count) of an event.
void setupInstStop()
Setup an instruction break if there is one pending.
std::ostream CheckpointOut
const FlagsType init
This Stat is Initialized.
virtual Tick kvmRun(Tick ticks)
Request KVM to run the guest for a given number of ticks.
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 getRegisters(struct kvm_regs ®s) const
Get/Set the register state of the guest vCPU.
const long pageSize
Cached page size of the host.
statistics::Scalar numCoalescedMMIO
PerfEvent counter configuration.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
virtual Tick handleKvmExitIRQWindowOpen()
The guest exited because an interrupt window was requested.
virtual Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const
void haltContext(ThreadID thread_num) override
KVMCpuPort dataPort
Port for data requests.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
statistics::Scalar numHalt
Counter totalOps() const override
static void onKickSignal(int signo, siginfo_t *si, void *data)
Dummy handler for KVM kick signals.
void start()
Start counting.
statistics::Scalar numHypercalls
Status status() const override
void setSpecialRegisters(const struct kvm_sregs ®s)
EventQueue comInstEventQueue
An instruction-based event queue.
void setupInstCounter(uint64_t period=0)
Setup the guest instruction counter.
PerfKvmCounter hwInstructions
Guest instruction counter.
PerfKvmCounterConfig & disabled(bool val)
Don't start the performance counter automatically when attaching it.
virtual PCStateBase * clone() const =0
@ Draining
Draining buffers pending serialization/handover.
void syncKvmState()
Update the KVM if the thread context is dirty.
bool scheduled() const
Determine if the current event is scheduled.
int16_t ThreadID
Thread index/ID type.
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define panic(...)
This implements a cprintf based panic() function.
DrainState drain() override
Generated on Tue Feb 8 2022 11:47:02 for gem5 by doxygen 1.8.17