gem5  v20.1.0.0
base.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __CPU_KVM_BASE_HH__
39 #define __CPU_KVM_BASE_HH__
40 
41 #include <pthread.h>
42 
43 #include <csignal>
44 #include <memory>
45 #include <queue>
46 
47 #include "base/statistics.hh"
48 #include "cpu/kvm/perfevent.hh"
49 #include "cpu/kvm/timer.hh"
50 #include "cpu/kvm/vm.hh"
51 #include "cpu/base.hh"
52 #include "cpu/simple_thread.hh"
53 #include "sim/faults.hh"
54 
56 #define KVM_KICK_SIGNAL SIGRTMIN
57 
58 // forward declarations
59 class ThreadContext;
60 struct BaseKvmCPUParams;
61 
77 class BaseKvmCPU : public BaseCPU
78 {
79  public:
80  BaseKvmCPU(BaseKvmCPUParams *params);
81  virtual ~BaseKvmCPU();
82 
83  void init() override;
84  void startup() override;
85 
86  void serializeThread(CheckpointOut &cp, ThreadID tid) const override;
87  void unserializeThread(CheckpointIn &cp, ThreadID tid) override;
88 
89  DrainState drain() override;
90  void drainResume() override;
91  void notifyFork() override;
92 
93  void switchOut() override;
94  void takeOverFrom(BaseCPU *cpu) override;
95 
96  void verifyMemoryMode() const override;
97 
98  Port &getDataPort() override { return dataPort; }
99  Port &getInstPort() override { return instPort; }
100 
101  void wakeup(ThreadID tid = 0) override;
102  void activateContext(ThreadID thread_num) override;
103  void suspendContext(ThreadID thread_num) override;
104  void deallocateContext(ThreadID thread_num);
105  void haltContext(ThreadID thread_num) override;
106 
107  long getVCpuID() const { return vcpuID; }
108  ThreadContext *getContext(int tn) override;
109 
110  Counter totalInsts() const override;
111  Counter totalOps() const override;
112 
117  void finishMMIOPending();
118 
120  virtual void dump() const;
121 
128  void kick() const { pthread_kill(vcpuThread, KVM_KICK_SIGNAL); }
129 
144 
149 
151 
152  protected:
178  enum Status {
226  };
227 
230 
235  void tick();
236 
250  virtual uint64_t getHostCycles() const;
251 
278  virtual Tick kvmRun(Tick ticks);
279 
291  virtual Tick kvmRunDrain();
292 
297  struct kvm_run *getKvmRunState() { return _kvmRun; };
298 
307  uint8_t *getGuestData(uint64_t offset) const {
308  return (uint8_t *)_kvmRun + offset;
309  };
310 
321 
332  void kvmInterrupt(const struct kvm_interrupt &interrupt);
333 
346  void getRegisters(struct kvm_regs &regs) const;
347  void setRegisters(const struct kvm_regs &regs);
348  void getSpecialRegisters(struct kvm_sregs &regs) const;
349  void setSpecialRegisters(const struct kvm_sregs &regs);
356  void getFPUState(struct kvm_fpu &state) const;
357  void setFPUState(const struct kvm_fpu &state);
366  void setOneReg(uint64_t id, const void *addr);
367  void setOneReg(uint64_t id, uint64_t value) { setOneReg(id, &value); }
368  void setOneReg(uint64_t id, uint32_t value) { setOneReg(id, &value); }
369  void getOneReg(uint64_t id, void *addr) const;
370  uint64_t getOneRegU64(uint64_t id) const {
371  uint64_t value;
372  getOneReg(id, &value);
373  return value;
374  }
375  uint32_t getOneRegU32(uint64_t id) const {
376  uint32_t value;
377  getOneReg(id, &value);
378  return value;
379  }
390  std::string getAndFormatOneReg(uint64_t id) const;
391 
401  virtual void updateKvmState() = 0;
402 
411  virtual void updateThreadContext() = 0;
412 
417  void syncThreadContext();
418 
428 
432  void syncKvmState();
442  virtual Tick handleKvmExit();
443 
449  virtual Tick handleKvmExitIO();
450 
456  virtual Tick handleKvmExitHypercall();
457 
468 
481  virtual Tick handleKvmExitUnknown();
482 
492  virtual Tick handleKvmExitException();
493 
502  virtual Tick handleKvmExitFailEntry();
521  virtual bool archIsDrained() const { return true; }
522 
532  Tick doMMIOAccess(Addr paddr, void *data, int size, bool write);
533 
547  void setSignalMask(const sigset_t *mask);
563  int ioctl(int request, long p1) const;
564  int ioctl(int request, void *p1) const {
565  return ioctl(request, (long)p1);
566  }
567  int ioctl(int request) const {
568  return ioctl(request, 0L);
569  }
577  class KVMCpuPort : public RequestPort
578  {
579 
580  public:
581  KVMCpuPort(const std::string &_name, BaseKvmCPU *_cpu)
582  : RequestPort(_name, _cpu), cpu(_cpu), activeMMIOReqs(0)
583  { }
589  Tick submitIO(PacketPtr pkt);
590 
592  Status nextIOState() const;
593 
594  protected:
597 
599  std::queue<PacketPtr> pendingMMIOPkts;
600 
602  unsigned int activeMMIOReqs;
603 
604  bool recvTimingResp(PacketPtr pkt) override;
605 
606  void recvReqRetry() override;
607 
608  };
609 
612 
615 
620  const bool alwaysSyncTC;
621 
627 
633 
635  const long vcpuID;
636 
638  pthread_t vcpuThread;
639 
640  private:
649 
654  void setupSignalHandler();
655 
662  bool discardPendingSignal(int signum) const;
663 
676  void startupThread();
677 
679  bool tryDrain();
680 
682  void ioctlRun();
683 
685  int vcpuFD;
696  struct kvm_run *_kvmRun;
701  struct kvm_coalesced_mmio_ring *mmioRing;
703  const long pageSize;
704 
706 
717  void setupInstStop();
718 
721  void setupCounters();
722 
733  void setupInstCounter(uint64_t period = 0);
734 
737 
747 
760 
777  std::unique_ptr<BaseKvmTimer> runTimer;
778 
780  float hostFactor;
781 
782  public:
783  /* @{ */
784  struct StatGroup : public Stats::Group {
785  StatGroup(Stats::Group *parent);
796  } stats;
797  /* @} */
798 
801 };
802 
803 #endif
KvmVM
KVM VM container.
Definition: vm.hh:289
BaseKvmCPU::tickEvent
EventFunctionWrapper tickEvent
Definition: base.hh:705
BaseKvmCPU::StatGroup::numHalt
Stats::Scalar numHalt
Definition: base.hh:793
PerfKvmCounter
An instance of a performance counter.
Definition: perfevent.hh:168
BaseKvmCPU::setOneReg
void setOneReg(uint64_t id, const void *addr)
Get/Set single register using the KVM_(SET|GET)_ONE_REG API.
Definition: base.cc:841
BaseKvmCPU::kvmNonMaskableInterrupt
void kvmNonMaskableInterrupt()
Send a non-maskable interrupt to the guest.
Definition: base.cc:782
BaseKvmCPU::getInstPort
Port & getInstPort() override
Purely virtual method that returns a reference to the instruction port.
Definition: base.hh:99
BaseKvmCPU::ioctl
int ioctl(int request) const
Definition: base.hh:567
BaseKvmCPU::alwaysSyncTC
const bool alwaysSyncTC
Be conservative and always synchronize the thread context on KVM entry/exit.
Definition: base.hh:620
BaseKvmCPU::Running
@ Running
Running normally.
Definition: base.hh:194
X86ISA::L
Bitfield< 7, 0 > L
Definition: int.hh:57
BaseKvmCPU::StatGroup
Definition: base.hh:784
BaseKvmCPU::pageSize
const long pageSize
Cached page size of the host.
Definition: base.hh:703
BaseKvmCPU::setupSignalHandler
void setupSignalHandler()
Setup a signal handler to catch the timer signal used to switch back to the monitor.
Definition: base.cc:1183
BaseKvmCPU::setupInstStop
void setupInstStop()
Setup an instruction break if there is one pending.
Definition: base.cc:1303
BaseKvmCPU::vcpuThread
pthread_t vcpuThread
ID of the vCPU thread.
Definition: base.hh:638
BaseKvmCPU::kvmStateDirty
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...
Definition: base.hh:632
BaseKvmCPU::ioctlRun
void ioctlRun()
Execute the KVM_RUN ioctl.
Definition: base.cc:1293
BaseKvmCPU::vm
KvmVM & vm
Definition: base.hh:150
BaseKvmCPU::dataPort
KVMCpuPort dataPort
Port for data requests.
Definition: base.hh:611
BaseKvmCPU::setOneReg
void setOneReg(uint64_t id, uint64_t value)
Definition: base.hh:367
KVM_KICK_SIGNAL
#define KVM_KICK_SIGNAL
Signal to use to trigger exits from KVM.
Definition: base.hh:56
data
const char data[]
Definition: circlebuf.test.cc:42
BaseKvmCPU::StatGroup::numIO
Stats::Scalar numIO
Definition: base.hh:792
BaseKvmCPU::getContext
ThreadContext * getContext(int tn) override
Given a thread num get tho thread context for it.
Definition: base.cc:540
BaseKvmCPU::KVMCpuPort
KVM memory port.
Definition: base.hh:577
BaseKvmCPU::StatGroup::numMMIO
Stats::Scalar numMMIO
Definition: base.hh:790
BaseKvmCPU::takeOverFrom
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...
Definition: base.cc:435
ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:227
BaseKvmCPU::getAndFormatOneReg
std::string getAndFormatOneReg(uint64_t id) const
Get and format one register for printout.
Definition: base.cc:875
BaseKvmCPU::StatGroup::numVMHalfEntries
Stats::Scalar numVMHalfEntries
Definition: base.hh:788
BaseKvmCPU::discardPendingSignal
bool discardPendingSignal(int signum) const
Discard a (potentially) pending signal.
Definition: base.cc:1212
BaseKvmCPU::_status
Status _status
CPU run state.
Definition: base.hh:229
BaseKvmCPU::BaseKvmCPU
BaseKvmCPU(BaseKvmCPUParams *params)
Definition: base.cc:62
BaseKvmCPU::getGuestData
uint8_t * getGuestData(uint64_t offset) const
Retrieve a pointer to guest data stored at the end of the kvm_run structure.
Definition: base.hh:307
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
BaseKvmCPU::setFPUState
void setFPUState(const struct kvm_fpu &state)
Definition: base.cc:833
BaseKvmCPU::setupInstCounter
void setupInstCounter(uint64_t period=0)
Setup the guest instruction counter.
Definition: base.cc:1315
BaseKvmCPU::setRegisters
void setRegisters(const struct kvm_regs &regs)
Definition: base.cc:805
BaseKvmCPU::handleKvmExitException
virtual Tick handleKvmExitException()
An unhandled virtualization exception occured.
Definition: base.cc:1053
BaseKvmCPU::KVMCpuPort::recvReqRetry
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: base.cc:206
BaseKvmCPU::switchOut
void switchOut() override
Prepare for another CPU to take over execution.
Definition: base.cc:421
BaseKvmCPU::handleKvmExit
virtual Tick handleKvmExit()
Main kvmRun exit handler, calls the relevant handleKvmExit* depending on exit type.
Definition: base.cc:946
BaseKvmCPU::getVCpuID
long getVCpuID() const
Definition: base.hh:107
BaseKvmCPU::getOneReg
void getOneReg(uint64_t id, void *addr) const
Definition: base.cc:858
BaseKvmCPU::StatGroup::numVMExits
Stats::Scalar numVMExits
Definition: base.hh:787
faults.hh
BaseKvmCPU::KVMCpuPort::cpu
BaseKvmCPU * cpu
KVM cpu pointer for finishMMIOPending() callback.
Definition: base.hh:596
BaseKvmCPU::getHostCycles
virtual uint64_t getHostCycles() const
Get the value of the hardware cycle counter in the guest.
Definition: base.cc:678
BaseKvmCPU::getDataPort
Port & getDataPort() override
Purely virtual method that returns a reference to the data port.
Definition: base.hh:98
BaseKvmCPU::getOneRegU64
uint64_t getOneRegU64(uint64_t id) const
Definition: base.hh:370
BaseKvmCPU::KVMCpuPort::submitIO
Tick submitIO(PacketPtr pkt)
Interface to send Atomic or Timing IO request.
Definition: base.cc:171
BaseKvmCPU::StatGroup::numCoalescedMMIO
Stats::Scalar numCoalescedMMIO
Definition: base.hh:791
BaseKvmCPU::handleKvmExitUnknown
virtual Tick handleKvmExitUnknown()
An unknown architecture dependent error occurred when starting the vCPU.
Definition: base.cc:1045
SimpleThread
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Definition: simple_thread.hh:89
EventFunctionWrapper
Definition: eventq.hh:1101
BaseKvmCPU::stats
BaseKvmCPU::StatGroup stats
DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:71
Stats::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2533
BaseKvmCPU::kvmInterrupt
void kvmInterrupt(const struct kvm_interrupt &interrupt)
Send a normal interrupt to the guest.
Definition: base.cc:790
Counter
int64_t Counter
Statistics counter type.
Definition: types.hh:58
BaseKvmCPU::vcpuFD
int vcpuFD
KVM vCPU file descriptor.
Definition: base.hh:685
cp
Definition: cprintf.cc:40
BaseKvmCPU::totalOps
Counter totalOps() const override
Definition: base.cc:555
BaseKvmCPU::syncThreadContext
void syncThreadContext()
Update a thread context if the KVM state is dirty with respect to the cached thread context.
Definition: base.cc:922
BaseKvmCPU
Base class for KVM based CPU models.
Definition: base.hh:77
BaseKvmCPU::RunningServiceCompletion
@ RunningServiceCompletion
Service completion in progress.
Definition: base.hh:225
BaseKvmCPU::thread
SimpleThread * thread
A cached copy of a thread's state in the form of a SimpleThread object.
Definition: base.hh:143
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
BaseKvmCPU::suspendContext
void suspendContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now suspended.
Definition: base.cc:502
BaseKvmCPU::handleKvmExitHypercall
virtual Tick handleKvmExitHypercall()
The guest requested a monitor service using a hypercall.
Definition: base.cc:1031
BaseKvmCPU::unserializeThread
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Definition: base.cc:293
BaseKvmCPU::handleKvmExitIO
virtual Tick handleKvmExitIO()
The guest performed a legacy IO request (out/inp on x86)
Definition: base.cc:1023
BaseKvmCPU::StatGroup::numInterrupts
Stats::Scalar numInterrupts
Definition: base.hh:794
BaseKvmCPU::perfControlledByTimer
bool perfControlledByTimer
Does the runTimer control the performance counters?
Definition: base.hh:768
statistics.hh
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
BaseKvmCPU::setupCounters
void setupCounters()
Setup hardware performance counters.
Definition: base.cc:1240
BaseKvmCPU::startup
void startup() override
Definition: base.cc:117
BaseKvmCPU::haltContext
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
Definition: base.cc:532
BaseKvmCPU::kvmRun
virtual Tick kvmRun(Tick ticks)
Request KVM to run the guest for a given number of ticks.
Definition: base.cc:684
BaseKvmCPU::getKvmRunState
struct kvm_run * getKvmRunState()
Get a pointer to the kvm_run structure containing all the input and output parameters from kvmRun().
Definition: base.hh:297
BaseKvmCPU::StatGroup::StatGroup
StatGroup(Stats::Group *parent)
Definition: base.cc:261
BaseKvmCPU::StatGroup::numExitSignal
Stats::Scalar numExitSignal
Definition: base.hh:789
BaseKvmCPU::RunningMMIOPending
@ RunningMMIOPending
Timing MMIO request in flight or stalled.
Definition: base.hh:216
BaseKvmCPU::doMMIOAccess
Tick doMMIOAccess(Addr paddr, void *data, int size, bool write)
Inject a memory mapped IO request into gem5.
Definition: base.cc:1070
BaseKvmCPU::deviceEventQueue
EventQueue * deviceEventQueue()
Get a pointer to the event queue owning devices.
Definition: base.hh:427
RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:74
BaseKvmCPU::dump
virtual void dump() const
Dump the internal state to the terminal.
Definition: base.cc:562
BaseKvmCPU::startupThread
void startupThread()
Thread-specific initialization.
Definition: base.cc:232
BaseKvmCPU::getFPUState
void getFPUState(struct kvm_fpu &state) const
Get/Set the guest FPU/vector state.
Definition: base.cc:826
BaseKvmCPU::kick
void kick() const
Force an exit from KVM.
Definition: base.hh:128
BaseKvmCPU::notifyFork
void notifyFork() override
Definition: base.cc:398
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
BaseKvmCPU::kvmRunDrain
virtual Tick kvmRunDrain()
Request the CPU to run until draining completes.
Definition: base.cc:664
BaseCPU::params
const Params * params() const
Definition: base.hh:296
EventManager::eventQueue
EventQueue * eventQueue() const
Definition: eventq.hh:996
BaseKvmCPU::drain
DrainState drain() override
Definition: base.cc:304
vm.hh
BaseKvmCPU::tick
void tick()
Execute the CPU until the next event in the main event queue or until the guest needs service from ge...
Definition: base.cc:568
BaseKvmCPU::ioctl
int ioctl(int request, long p1) const
vCPU ioctl interface.
Definition: base.cc:1132
BaseKvmCPU::threadContextDirty
bool threadContextDirty
Is the gem5 context dirty? Set to true to force an update of the KVM vCPU state upon the next call to...
Definition: base.hh:626
BaseKvmCPU::instPort
KVMCpuPort instPort
Unused dummy port for the instruction interface.
Definition: base.hh:614
BaseKvmCPU::verifyMemoryMode
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
Definition: base.cc:457
perfevent.hh
BaseKvmCPU::vcpuID
const long vcpuID
KVM internal ID of the vCPU.
Definition: base.hh:635
BaseCPU
Definition: cpu_dummy.hh:43
BaseKvmCPU::KVMCpuPort::KVMCpuPort
KVMCpuPort(const std::string &_name, BaseKvmCPU *_cpu)
Definition: base.hh:581
BaseKvmCPU::ctrInsts
Counter ctrInsts
Number of instructions executed by the CPU.
Definition: base.hh:800
BaseKvmCPU::finishMMIOPending
void finishMMIOPending()
Callback from KvmCPUPort to transition the CPU out of RunningMMIOPending when all timing requests hav...
Definition: base.cc:222
BaseKvmCPU::RunningService
@ RunningService
Requiring service at the beginning of the next cycle.
Definition: base.hh:208
BaseKvmCPU::~BaseKvmCPU
virtual ~BaseKvmCPU()
Definition: base.cc:98
BaseKvmCPU::totalInsts
Counter totalInsts() const override
Definition: base.cc:549
simple_thread.hh
BaseKvmCPU::activeInstPeriod
uint64_t activeInstPeriod
Currently active instruction count breakpoint.
Definition: base.hh:736
BaseKvmCPU::updateThreadContext
virtual void updateThreadContext()=0
Update the current thread context with the KVM state.
BaseKvmCPU::Idle
@ Idle
Context not scheduled in KVM.
Definition: base.hh:188
timer.hh
BaseKvmCPU::runTimer
std::unique_ptr< BaseKvmTimer > runTimer
Timer used to force execution into the monitor after a specified number of simulation tick equivalent...
Definition: base.hh:777
BaseKvmCPU::tc
ThreadContext * tc
ThreadContext object, provides an interface for external objects to modify this thread's state.
Definition: base.hh:148
base.hh
BaseKvmCPU::handleKvmExitIRQWindowOpen
virtual Tick handleKvmExitIRQWindowOpen()
The guest exited because an interrupt window was requested.
Definition: base.cc:1037
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
BaseKvmCPU::getSpecialRegisters
void getSpecialRegisters(struct kvm_sregs &regs) const
Definition: base.cc:812
Stats::Group
Statistics container.
Definition: group.hh:83
BaseKvmCPU::vcpuMMapSize
int vcpuMMapSize
Size of MMAPed kvm_run area.
Definition: base.hh:687
BaseKvmCPU::StatGroup::committedInsts
Stats::Scalar committedInsts
Definition: base.hh:786
BaseKvmCPU::KVMCpuPort::activeMMIOReqs
unsigned int activeMMIOReqs
Number of MMIO requests in flight.
Definition: base.hh:602
addr
ip6_addr_t addr
Definition: inet.hh:423
BaseKvmCPU::drainResume
void drainResume() override
Definition: base.cc:375
BaseKvmCPU::_kvmRun
struct kvm_run * _kvmRun
Pointer to the kvm_run structure used to communicate parameters with KVM.
Definition: base.hh:696
BaseKvmCPU::syncKvmState
void syncKvmState()
Update the KVM if the thread context is dirty.
Definition: base.cc:934
BaseKvmCPU::updateKvmState
virtual void updateKvmState()=0
Update the KVM state from the current thread context.
BaseKvmCPU::setOneReg
void setOneReg(uint64_t id, uint32_t value)
Definition: base.hh:368
BaseKvmCPU::flushCoalescedMMIO
Tick flushCoalescedMMIO()
Service MMIO requests in the mmioRing.
Definition: base.cc:1141
BaseKvmCPU::archIsDrained
virtual bool archIsDrained() const
Is the architecture specific code in a state that prevents draining?
Definition: base.hh:521
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
BaseKvmCPU::StatGroup::numHypercalls
Stats::Scalar numHypercalls
Definition: base.hh:795
BaseKvmCPU::mmioRing
struct kvm_coalesced_mmio_ring * mmioRing
Coalesced MMIO ring buffer.
Definition: base.hh:701
BaseKvmCPU::KVMCpuPort::recvTimingResp
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition: base.cc:189
BaseKvmCPU::setSpecialRegisters
void setSpecialRegisters(const struct kvm_sregs &regs)
Definition: base.cc:819
BaseKvmCPU::wakeup
void wakeup(ThreadID tid=0) override
Definition: base.cc:466
EventQueue
Queue of events sorted in time order.
Definition: eventq.hh:617
BaseKvmCPU::getRegisters
void getRegisters(struct kvm_regs &regs) const
Get/Set the register state of the guest vCPU.
Definition: base.cc:798
BaseKvmCPU::KVMCpuPort::pendingMMIOPkts
std::queue< PacketPtr > pendingMMIOPkts
Pending MMIO packets.
Definition: base.hh:599
BaseKvmCPU::ioctl
int ioctl(int request, void *p1) const
Definition: base.hh:564
BaseKvmCPU::hostFactor
float hostFactor
Host factor as specified in the configuration.
Definition: base.hh:780
BaseKvmCPU::tryDrain
bool tryDrain()
Try to drain the CPU if a drain is pending.
Definition: base.cc:1271
BaseKvmCPU::hwInstructions
PerfKvmCounter hwInstructions
Guest instruction counter.
Definition: base.hh:759
CheckpointIn
Definition: serialize.hh:67
BaseKvmCPU::hwCycles
PerfKvmCounter hwCycles
Guest cycle counter.
Definition: base.hh:746
BaseKvmCPU::activateContext
void activateContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now active.
Definition: base.cc:484
BaseKvmCPU::getOneRegU32
uint32_t getOneRegU32(uint64_t id) const
Definition: base.hh:375
BaseKvmCPU::deallocateContext
void deallocateContext(ThreadID thread_num)
Definition: base.cc:525
BaseKvmCPU::setSignalMask
void setSignalMask(const sigset_t *mask)
Set the signal mask used in kvmRun()
Definition: base.cc:1111
BaseKvmCPU::init
void init() override
Definition: base.cc:106
BaseKvmCPU::serializeThread
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
Definition: base.cc:280
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
BaseKvmCPU::handleKvmExitFailEntry
virtual Tick handleKvmExitFailEntry()
KVM failed to start the virtualized CPU.
Definition: base.cc:1062
BaseKvmCPU::Status
Status
Definition: base.hh:178
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153
BaseKvmCPU::KVMCpuPort::nextIOState
Status nextIOState() const
Returns next valid state after one or more IO accesses.
Definition: base.cc:164

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