gem5  v21.1.0.2
armv8_cpu.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 2017, 2019 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 
39 
40 #include <linux/kvm.h>
41 
42 #include "debug/KvmContext.hh"
43 #include "params/ArmV8KvmCPU.hh"
44 
45 namespace gem5
46 {
47 
48 using namespace ArmISA;
49 
50 // Unlike gem5, kvm doesn't count the SP as a normal integer register,
51 // which means we only have 31 normal integer registers.
52 constexpr static unsigned NUM_XREGS = NUM_ARCH_INTREGS - 1;
53 static_assert(NUM_XREGS == 31, "Unexpected number of aarch64 int. regs.");
54 
55 // The KVM interface accesses vector registers of 4 single precision
56 // floats instead of individual registers.
57 constexpr static unsigned NUM_QREGS = NumVecV8ArchRegs;
58 static_assert(NUM_QREGS == 32, "Unexpected number of aarch64 vector regs.");
59 
60 #define EXTRACT_FIELD(v, name) \
61  (((v) & name ## _MASK) >> name ## _SHIFT)
62 
63 #define CORE_REG(name, size) \
64  (KVM_REG_ARM64 | KVM_REG_ARM_CORE | \
65  KVM_REG_SIZE_ ## size | \
66  KVM_REG_ARM_CORE_REG(name))
67 
68 #define INT_REG(name) CORE_REG(name, U64)
69 #define SIMD_REG(name) CORE_REG(name, U128)
70 
71 #define SYS_MPIDR_EL1 ARM64_SYS_REG(0b11, 0b000, 0b0000, 0b0000, 0b101)
72 
73 constexpr uint64_t
74 kvmXReg(const int num)
75 {
76  return INT_REG(regs.regs[0]) +
77  (INT_REG(regs.regs[1]) - INT_REG(regs.regs[0])) * num;
78 }
79 
80 constexpr uint64_t
81 kvmFPReg(const int num)
82 {
83  return SIMD_REG(fp_regs.vregs[0]) +
84  (SIMD_REG(fp_regs.vregs[1]) - SIMD_REG(fp_regs.vregs[0])) * num;
85 }
86 
87 union KvmFPReg
88 {
89  union
90  {
91  uint32_t i;
92  float f;
93  } s[4];
94 
95  union
96  {
97  uint64_t i;
98  double f;
99  } d[2];
100 
101  uint8_t data[32];
102 };
103 
104 #define FP_REGS_PER_VFP_REG 4
105 
107  { INT_REG(regs.sp), INTREG_SP0, "SP(EL0)" },
108  { INT_REG(sp_el1), INTREG_SP1, "SP(EL1)" },
109 };
110 
112  MiscRegInfo(INT_REG(elr_el1), MISCREG_ELR_EL1, "ELR(EL1)"),
113  MiscRegInfo(INT_REG(spsr[KVM_SPSR_EL1]), MISCREG_SPSR_EL1, "SPSR(EL1)"),
114  MiscRegInfo(INT_REG(spsr[KVM_SPSR_ABT]), MISCREG_SPSR_ABT, "SPSR(ABT)"),
115  MiscRegInfo(INT_REG(spsr[KVM_SPSR_UND]), MISCREG_SPSR_UND, "SPSR(UND)"),
116  MiscRegInfo(INT_REG(spsr[KVM_SPSR_IRQ]), MISCREG_SPSR_IRQ, "SPSR(IRQ)"),
117  MiscRegInfo(INT_REG(spsr[KVM_SPSR_FIQ]), MISCREG_SPSR_FIQ, "SPSR(FIQ)"),
118  MiscRegInfo(CORE_REG(fp_regs.fpsr, U32), MISCREG_FPSR, "FPSR"),
119  MiscRegInfo(CORE_REG(fp_regs.fpcr, U32), MISCREG_FPCR, "FPCR"),
120 };
121 
122 const std::set<MiscRegIndex> ArmV8KvmCPU::deviceRegSet = {
126 };
127 
130 };
131 
132 ArmV8KvmCPU::ArmV8KvmCPU(const ArmV8KvmCPUParams &params)
133  : BaseArmKvmCPU(params)
134 {
135 }
136 
138 {
139 }
140 
141 void
143 {
145 
146  // Override ID registers that KVM should "inherit" from gem5.
147  for (const auto &ri : miscRegIdMap) {
148  const uint64_t value(tc->readMiscReg(ri.idx));
149  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
150  setOneReg(ri.kvm, value);
151  }
152 }
153 
154 void
156 {
157  inform("Integer registers:\n");
158  inform(" PC: %s\n", getAndFormatOneReg(INT_REG(regs.pc)));
159  for (int i = 0; i < NUM_XREGS; ++i)
160  inform(" X%i: %s\n", i, getAndFormatOneReg(kvmXReg(i)));
161 
162  for (int i = 0; i < NUM_QREGS; ++i)
163  inform(" Q%i: %s\n", i, getAndFormatOneReg(kvmFPReg(i)));
164 
165  for (const auto &ri : intRegMap)
166  inform(" %s: %s\n", ri.name, getAndFormatOneReg(ri.kvm));
167 
168  inform(" %s: %s\n", "PSTATE", getAndFormatOneReg(INT_REG(regs.pstate)));
169 
170  for (const auto &ri : miscRegMap)
171  inform(" %s: %s\n", ri.name, getAndFormatOneReg(ri.kvm));
172 
173  for (const auto &ri : miscRegIdMap)
174  inform(" %s: %s\n", ri.name, getAndFormatOneReg(ri.kvm));
175 
176  for (const auto &reg : getRegList()) {
177  const uint64_t arch(reg & KVM_REG_ARCH_MASK);
178  if (arch != KVM_REG_ARM64) {
179  inform("0x%x: %s\n", reg, getAndFormatOneReg(reg));
180  continue;
181  }
182 
183  const uint64_t type(reg & KVM_REG_ARM_COPROC_MASK);
184  switch (type) {
185  case KVM_REG_ARM_CORE:
186  // These have already been printed
187  break;
188 
189  case KVM_REG_ARM64_SYSREG: {
190  const uint64_t op0(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP0));
191  const uint64_t op1(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP1));
192  const uint64_t crn(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRN));
193  const uint64_t crm(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRM));
194  const uint64_t op2(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP2));
195  const MiscRegIndex idx(
196  decodeAArch64SysReg(op0, op1, crn, crm, op2));
197 
198  inform(" %s (op0: %i, op1: %i, crn: %i, crm: %i, op2: %i): %s",
199  miscRegName[idx], op0, op1, crn, crm, op2,
201  } break;
202 
203  case KVM_REG_ARM_DEMUX: {
204  const uint64_t id(EXTRACT_FIELD(reg, KVM_REG_ARM_DEMUX_ID));
205  const uint64_t val(EXTRACT_FIELD(reg, KVM_REG_ARM_DEMUX_VAL));
206  if (id == KVM_REG_ARM_DEMUX_ID_CCSIDR) {
207  inform(" CSSIDR[%i]: %s\n", val,
209  } else {
210  inform(" UNKNOWN[%i:%i]: %s\n", id, val,
212  }
213  } break;
214 
215  default:
216  inform("0x%x: %s\n", reg, getAndFormatOneReg(reg));
217  }
218  }
219 }
220 
221 void
223 {
224  DPRINTF(KvmContext, "In updateKvmState():\n");
225 
226  // update pstate register state
227  CPSR cpsr(tc->readMiscReg(MISCREG_CPSR));
228  cpsr.nz = tc->readCCReg(CCREG_NZ);
229  cpsr.c = tc->readCCReg(CCREG_C);
230  cpsr.v = tc->readCCReg(CCREG_V);
231  if (cpsr.width) {
232  cpsr.ge = tc->readCCReg(CCREG_GE);
233  } else {
234  cpsr.ge = 0;
235  }
236  DPRINTF(KvmContext, " %s := 0x%x\n", "PSTATE", cpsr);
237  setOneReg(INT_REG(regs.pstate), static_cast<uint64_t>(cpsr));
238 
239  for (const auto &ri : miscRegMap) {
240  const uint64_t value(tc->readMiscReg(ri.idx));
241  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
242  setOneReg(ri.kvm, value);
243  }
244 
245  for (int i = 0; i < NUM_XREGS; ++i) {
246  const uint64_t value(tc->readIntReg(INTREG_X0 + i));
247  DPRINTF(KvmContext, " X%i := 0x%x\n", i, value);
248  setOneReg(kvmXReg(i), value);
249  }
250 
251  for (const auto &ri : intRegMap) {
252  const uint64_t value(tc->readIntReg(ri.idx));
253  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
254  setOneReg(ri.kvm, value);
255  }
256 
257  for (int i = 0; i < NUM_QREGS; ++i) {
258  KvmFPReg reg;
259  auto v = tc->readVecReg(RegId(VecRegClass, i)).as<VecElem>();
260  for (int j = 0; j < FP_REGS_PER_VFP_REG; j++)
261  reg.s[j].i = v[j];
262 
263  setOneReg(kvmFPReg(i), reg.data);
264  DPRINTF(KvmContext, " Q%i: %s\n", i, getAndFormatOneReg(kvmFPReg(i)));
265  }
266 
267  for (const auto &ri : getSysRegMap()) {
268  uint64_t value;
269  if (ri.is_device) {
270  // This system register is backed by a device. This means
271  // we need to lock the device event queue.
273 
274  value = tc->readMiscReg(ri.idx);
275  } else {
276  value = tc->readMiscReg(ri.idx);
277  }
278 
279  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
280  setOneReg(ri.kvm, value);
281  }
282 
283  setOneReg(INT_REG(regs.pc), tc->instAddr());
284  DPRINTF(KvmContext, " PC := 0x%x\n", tc->instAddr());
285 }
286 
287 void
289 {
290  DPRINTF(KvmContext, "In updateThreadContext():\n");
291 
292  // Update pstate thread context
293  const CPSR cpsr(getOneRegU64(INT_REG(regs.pstate)));
294  DPRINTF(KvmContext, " %s := 0x%x\n", "PSTATE", cpsr);
296  tc->setCCReg(CCREG_NZ, cpsr.nz);
297  tc->setCCReg(CCREG_C, cpsr.c);
298  tc->setCCReg(CCREG_V, cpsr.v);
299  if (cpsr.width) {
300  tc->setCCReg(CCREG_GE, cpsr.ge);
301  }
302 
303  // Update core misc regs first as they
304  // affect how other registers are mapped.
305  for (const auto &ri : miscRegMap) {
306  const auto value(getOneRegU64(ri.kvm));
307  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
308  tc->setMiscRegNoEffect(ri.idx, value);
309  }
310 
311  for (int i = 0; i < NUM_XREGS; ++i) {
312  const auto value(getOneRegU64(kvmXReg(i)));
313  DPRINTF(KvmContext, " X%i := 0x%x\n", i, value);
314  // KVM64 returns registers in 64-bit layout. If we are in aarch32
315  // mode, we need to map these to banked ARM32 registers.
316  if (inAArch64(tc)) {
317  tc->setIntReg(INTREG_X0 + i, value);
318  } else {
319  tc->setIntRegFlat(IntReg64Map[INTREG_X0 + i], value);
320  }
321  }
322 
323  for (const auto &ri : intRegMap) {
324  const auto value(getOneRegU64(ri.kvm));
325  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
326  tc->setIntReg(ri.idx, value);
327  }
328 
329  for (int i = 0; i < NUM_QREGS; ++i) {
330  KvmFPReg reg;
331  DPRINTF(KvmContext, " Q%i: %s\n", i, getAndFormatOneReg(kvmFPReg(i)));
332  getOneReg(kvmFPReg(i), reg.data);
333  auto v = tc->getWritableVecReg(RegId(VecRegClass, i)).as<VecElem>();
334  for (int j = 0; j < FP_REGS_PER_VFP_REG; j++)
335  v[j] = reg.s[j].i;
336  }
337 
338  for (const auto &ri : getSysRegMap()) {
339  const auto value(getOneRegU64(ri.kvm));
340  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
341  if (ri.is_device) {
342  // This system register is backed by a device. This means
343  // we need to lock the device event queue.
345 
346  tc->setMiscReg(ri.idx, value);
347  } else {
348  tc->setMiscRegNoEffect(ri.idx, value);
349  }
350  }
351 
352  PCState pc(getOneRegU64(INT_REG(regs.pc)));
353  pc.aarch64(inAArch64(tc));
354  pc.thumb(cpsr.t);
355  pc.nextAArch64(inAArch64(tc));
356  // TODO: This is a massive assumption that will break when
357  // switching to thumb.
358  pc.nextThumb(cpsr.t);
359  DPRINTF(KvmContext, " PC := 0x%x (t: %i, a64: %i)\n",
360  pc.instAddr(), pc.thumb(), pc.aarch64());
361  tc->pcState(pc);
362 }
363 
366 {
367  // Try to use the cached map
368  if (!sysRegMap.empty())
369  return sysRegMap;
370 
371  for (const auto &reg : getRegList()) {
372  const uint64_t arch(reg & KVM_REG_ARCH_MASK);
373  if (arch != KVM_REG_ARM64)
374  continue;
375 
376  const uint64_t type(reg & KVM_REG_ARM_COPROC_MASK);
377  if (type != KVM_REG_ARM64_SYSREG)
378  continue;
379 
380  const uint64_t op0(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP0));
381  const uint64_t op1(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP1));
382  const uint64_t crn(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRN));
383  const uint64_t crm(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRM));
384  const uint64_t op2(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP2));
385  const MiscRegIndex idx(decodeAArch64SysReg(op0, op1, crn, crm, op2));
386  const auto &info(miscRegInfo[idx]);
387  const bool writeable(
388  info[MISCREG_USR_NS_WR] || info[MISCREG_USR_S_WR] ||
389  info[MISCREG_PRI_S_WR] || info[MISCREG_PRI_NS_WR] ||
390  info[MISCREG_HYP_NS_WR] ||
391  info[MISCREG_MON_NS0_WR] || info[MISCREG_MON_NS1_WR]);
392  const bool implemented(
394 
395  // Only add implemented registers that we are going to be able
396  // to write.
397  if (implemented && writeable)
398  sysRegMap.emplace_back(reg, idx, miscRegName[idx],
399  deviceRegSet.find(idx) != deviceRegSet.end());
400  }
401 
402  return sysRegMap;
403 }
404 
405 } // namespace gem5
gem5::ThreadContext::setIntReg
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
gem5::ArmISA::MISCREG_PRI_S_WR
@ MISCREG_PRI_S_WR
Definition: misc.hh:1129
gem5::ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: misc.hh:61
gem5::ArmISA::MISCREG_USR_NS_WR
@ MISCREG_USR_NS_WR
Definition: misc.hh:1122
gem5::ArmISA::CCREG_C
@ CCREG_C
Definition: cc.hh:50
gem5::ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
gem5::ArmV8KvmCPU::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: armv8_cpu.cc:142
INT_REG
#define INT_REG(name)
Definition: armv8_cpu.cc:68
gem5::ArmV8KvmCPU::miscRegMap
static const std::vector< ArmV8KvmCPU::MiscRegInfo > miscRegMap
Mapping between gem5 misc registers and registers in kvm.
Definition: armv8_cpu.hh:143
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::ArmISA::MISCREG_CNTV_CTL_EL0
@ MISCREG_CNTV_CTL_EL0
Definition: misc.hh:759
gem5::ArmISA::MISCREG_SPSR_FIQ
@ MISCREG_SPSR_FIQ
Definition: misc.hh:63
gem5::BaseKvmCPU::deviceEventQueue
EventQueue * deviceEventQueue()
Get a pointer to the event queue owning devices.
Definition: base.hh:438
gem5::KvmFPReg
Definition: armv8_cpu.cc:87
gem5::ArmISA::MISCREG_MON_NS0_WR
@ MISCREG_MON_NS0_WR
Definition: misc.hh:1142
gem5::ArmISA::CCREG_NZ
@ CCREG_NZ
Definition: cc.hh:49
gem5::ArmISA::MISCREG_PRI_NS_WR
@ MISCREG_PRI_NS_WR
Definition: misc.hh:1127
gem5::ArmV8KvmCPU::updateThreadContext
void updateThreadContext() override
Update the current thread context with the KVM state.
Definition: armv8_cpu.cc:288
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:775
SYS_MPIDR_EL1
#define SYS_MPIDR_EL1
Definition: armv8_cpu.cc:71
gem5::ArmISA::decodeAArch64SysReg
MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, unsigned crn, unsigned crm, unsigned op2)
Definition: misc.cc:1454
gem5::ArmISA::miscRegName
const char *const miscRegName[]
Definition: misc.hh:1172
gem5::ArmV8KvmCPU::miscRegIdMap
static const std::vector< ArmV8KvmCPU::MiscRegInfo > miscRegIdMap
Mapping between gem5 ID misc registers and registers in kvm.
Definition: armv8_cpu.hh:147
gem5::BaseKvmCPU::getAndFormatOneReg
std::string getAndFormatOneReg(uint64_t id) const
Get and format one register for printout.
Definition: base.cc:884
std::vector
STL vector class.
Definition: stl.hh:37
gem5::ThreadContext::instAddr
virtual Addr instAddr() const =0
gem5::ArmISA::inAArch64
bool inAArch64(ThreadContext *tc)
Definition: utility.cc:120
gem5::BaseKvmCPU::getOneReg
void getOneReg(uint64_t id, void *addr) const
Definition: base.cc:867
gem5::ArmISA::MISCREG_IMPLEMENTED
@ MISCREG_IMPLEMENTED
Definition: misc.hh:1101
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::ArmISA::MISCREG_USR_S_WR
@ MISCREG_USR_S_WR
Definition: misc.hh:1124
gem5::PowerISA::PCState
Definition: pcstate.hh:42
gem5::ThreadContext::readCCReg
virtual RegVal readCCReg(RegIndex reg_idx) const =0
gem5::ArmISA::miscRegInfo
std::bitset< NUM_MISCREG_INFOS > miscRegInfo[NUM_MISCREGS]
Definition: misc.cc:3397
gem5::kvmFPReg
constexpr uint64_t kvmFPReg(const int num)
Definition: armv8_cpu.cc:81
gem5::ArmISA::IntReg64Map
const IntRegMap IntReg64Map
Definition: int.hh:318
armv8_cpu.hh
gem5::ArmISA::MISCREG_CNTKCTL_EL1
@ MISCREG_CNTKCTL_EL1
Definition: misc.hh:768
gem5::kvmXReg
constexpr uint64_t kvmXReg(const int num)
Definition: armv8_cpu.cc:74
gem5::ArmISA::MiscRegInfo
MiscRegInfo
Definition: misc.hh:1099
gem5::ThreadContext::readVecReg
virtual const TheISA::VecRegContainer & readVecReg(const RegId &reg) const =0
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::ArmISA::MISCREG_ELR_EL1
@ MISCREG_ELR_EL1
Definition: misc.hh:614
gem5::PowerISA::ri
Bitfield< 1 > ri
Definition: misc.hh:120
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:186
gem5::ArmISA::d
Bitfield< 9 > d
Definition: misc_types.hh:63
gem5::BaseKvmCPU::tc
ThreadContext * tc
ThreadContext object, provides an interface for external objects to modify this thread's state.
Definition: base.hh:158
gem5::BaseArmKvmCPU
Definition: base_cpu.hh:54
gem5::ArmISA::MISCREG_SPSR_IRQ
@ MISCREG_SPSR_IRQ
Definition: misc.hh:64
FP_REGS_PER_VFP_REG
#define FP_REGS_PER_VFP_REG
Definition: armv8_cpu.cc:104
gem5::ThreadContext::setIntRegFlat
virtual void setIntRegFlat(RegIndex idx, RegVal val)=0
gem5::ArmV8KvmCPU::intRegMap
static const std::vector< ArmV8KvmCPU::IntRegInfo > intRegMap
Mapping between gem5 integer registers and integer registers in kvm.
Definition: armv8_cpu.hh:141
gem5::X86ISA::type
type
Definition: misc.hh:733
gem5::ArmISA::v
Bitfield< 28 > v
Definition: misc_types.hh:54
gem5::ArmISA::s
Bitfield< 4 > s
Definition: misc_types.hh:561
gem5::ArmISA::MISCREG_MON_NS1_WR
@ MISCREG_MON_NS1_WR
Definition: misc.hh:1145
gem5::ThreadContext::getWritableVecReg
virtual TheISA::VecRegContainer & getWritableVecReg(const RegId &reg)=0
gem5::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:850
gem5::EventQueue::ScopedMigration
Definition: eventq.hh:672
gem5::ArmISA::MISCREG_MPIDR_EL1
@ MISCREG_MPIDR_EL1
Definition: misc.hh:540
SIMD_REG
#define SIMD_REG(name)
Definition: armv8_cpu.cc:69
gem5::ThreadContext::pcState
virtual TheISA::PCState pcState() const =0
gem5::ArmV8KvmCPU::getSysRegMap
const std::vector< ArmV8KvmCPU::MiscRegInfo > & getSysRegMap() const
Get a map between system registers in kvm and gem5 registers.
Definition: armv8_cpu.cc:365
gem5::ArmISA::MISCREG_CNTV_CVAL_EL0
@ MISCREG_CNTV_CVAL_EL0
Definition: misc.hh:760
gem5::ArmISA::MISCREG_SPSR_EL1
@ MISCREG_SPSR_EL1
Definition: misc.hh:612
gem5::ArmV8KvmCPU::updateKvmState
void updateKvmState() override
Update the KVM state from the current thread context.
Definition: armv8_cpu.cc:222
gem5::KvmFPReg::i
uint64_t i
Definition: armv8_cpu.cc:97
gem5::ThreadContext::readIntReg
virtual RegVal readIntReg(RegIndex reg_idx) const =0
gem5::NUM_XREGS
constexpr static unsigned NUM_XREGS
Definition: armv8_cpu.cc:52
gem5::ArmV8KvmCPU::dump
void dump() const override
Dump the internal state to the terminal.
Definition: armv8_cpu.cc:155
gem5::ArmISA::MiscRegIndex
MiscRegIndex
Definition: misc.hh:59
gem5::ArmISA::CCREG_GE
@ CCREG_GE
Definition: cc.hh:52
gem5::ArmV8KvmCPU::ArmV8KvmCPU
ArmV8KvmCPU(const ArmV8KvmCPUParams &params)
Definition: armv8_cpu.cc:132
gem5::X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:92
gem5::VecRegClass
@ VecRegClass
Vector Register.
Definition: reg_class.hh:60
gem5::KvmFPReg::f
double f
Definition: armv8_cpu.cc:98
gem5::ArmV8KvmCPU::~ArmV8KvmCPU
virtual ~ArmV8KvmCPU()
Definition: armv8_cpu.cc:137
inform
#define inform(...)
Definition: logging.hh:246
gem5::NUM_QREGS
constexpr static unsigned NUM_QREGS
Definition: armv8_cpu.cc:57
gem5::ArmISA::VecElem
uint32_t VecElem
Definition: vec.hh:60
gem5::BaseKvmCPU::getOneRegU64
uint64_t getOneRegU64(uint64_t id) const
Definition: base.hh:381
gem5::ThreadContext::setMiscReg
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::KvmFPReg::f
float f
Definition: armv8_cpu.cc:92
gem5::ArmISA::NumVecV8ArchRegs
const int NumVecV8ArchRegs
Definition: vec.hh:77
gem5::BaseArmKvmCPU::getRegList
const RegIndexVector & getRegList() const
Get a list of registers supported by getOneReg() and setOneReg().
Definition: base_cpu.cc:191
gem5::ArmISA::id
Bitfield< 33 > id
Definition: misc_types.hh:250
gem5::ThreadContext::setCCReg
virtual void setCCReg(RegIndex reg_idx, RegVal val)=0
gem5::ArmISA::MISCREG_SPSR_ABT
@ MISCREG_SPSR_ABT
Definition: misc.hh:67
gem5::ArmISA::MISCREG_FPSR
@ MISCREG_FPSR
Definition: misc.hh:622
gem5::ArmV8KvmCPU::sysRegMap
std::vector< ArmV8KvmCPU::MiscRegInfo > sysRegMap
Cached mapping between system registers in kvm and misc regs in gem5.
Definition: armv8_cpu.hh:150
gem5::ArmISA::MISCREG_FPCR
@ MISCREG_FPCR
Definition: misc.hh:621
EXTRACT_FIELD
#define EXTRACT_FIELD(v, name)
Definition: armv8_cpu.cc:60
gem5::KvmFPReg::i
uint32_t i
Definition: armv8_cpu.cc:91
gem5::BaseArmKvmCPU::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: base_cpu.cc:94
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::ArmV8KvmCPU::deviceRegSet
static const std::set< ArmISA::MiscRegIndex > deviceRegSet
Device registers (needing "effectful" MiscReg writes)
Definition: armv8_cpu.hh:145
gem5::ArmISA::CCREG_V
@ CCREG_V
Definition: cc.hh:51
CORE_REG
#define CORE_REG(name, size)
Definition: armv8_cpu.cc:63
gem5::RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:88
gem5::ThreadContext::setMiscRegNoEffect
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
gem5::ArmISA::MISCREG_WARN_NOT_FAIL
@ MISCREG_WARN_NOT_FAIL
Definition: misc.hh:1104
gem5::ArmISA::MISCREG_SPSR_UND
@ MISCREG_SPSR_UND
Definition: misc.hh:69
gem5::ArmISA::MISCREG_HYP_NS_WR
@ MISCREG_HYP_NS_WR
Definition: misc.hh:1132

Generated on Tue Sep 21 2021 12:24:36 for gem5 by doxygen 1.8.17