gem5  v21.2.1.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  if (!inAArch64(tc))
261  auto v = tc->readVecReg(RegId(VecRegClass, i)).as<VecElem>();
262  for (int j = 0; j < FP_REGS_PER_VFP_REG; j++)
263  reg.s[j].i = v[j];
264 
265  setOneReg(kvmFPReg(i), reg.data);
266  DPRINTF(KvmContext, " Q%i: %s\n", i, getAndFormatOneReg(kvmFPReg(i)));
267  }
268 
269  for (const auto &ri : getSysRegMap()) {
270  uint64_t value;
271  if (ri.is_device) {
272  // This system register is backed by a device. This means
273  // we need to lock the device event queue.
275 
276  value = tc->readMiscReg(ri.idx);
277  } else {
278  value = tc->readMiscReg(ri.idx);
279  }
280 
281  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
282  setOneReg(ri.kvm, value);
283  }
284 
285  setOneReg(INT_REG(regs.pc), tc->pcState().instAddr());
286  DPRINTF(KvmContext, " PC := 0x%x\n", tc->pcState().instAddr());
287 }
288 
289 void
291 {
292  DPRINTF(KvmContext, "In updateThreadContext():\n");
293 
294  // Update pstate thread context
295  const CPSR cpsr(getOneRegU64(INT_REG(regs.pstate)));
296  DPRINTF(KvmContext, " %s := 0x%x\n", "PSTATE", cpsr);
298  tc->setCCReg(CCREG_NZ, cpsr.nz);
299  tc->setCCReg(CCREG_C, cpsr.c);
300  tc->setCCReg(CCREG_V, cpsr.v);
301  if (cpsr.width) {
302  tc->setCCReg(CCREG_GE, cpsr.ge);
303  }
304 
305  // Update core misc regs first as they
306  // affect how other registers are mapped.
307  for (const auto &ri : miscRegMap) {
308  const auto value(getOneRegU64(ri.kvm));
309  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
310  tc->setMiscRegNoEffect(ri.idx, value);
311  }
312 
313  for (int i = 0; i < NUM_XREGS; ++i) {
314  const auto value(getOneRegU64(kvmXReg(i)));
315  DPRINTF(KvmContext, " X%i := 0x%x\n", i, value);
316  // KVM64 returns registers in 64-bit layout. If we are in aarch32
317  // mode, we need to map these to banked ARM32 registers.
318  if (inAArch64(tc)) {
319  tc->setIntReg(INTREG_X0 + i, value);
320  } else {
321  tc->setIntRegFlat(IntReg64Map[INTREG_X0 + i], value);
322  }
323  }
324 
325  for (const auto &ri : intRegMap) {
326  const auto value(getOneRegU64(ri.kvm));
327  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
328  tc->setIntReg(ri.idx, value);
329  }
330 
331  for (int i = 0; i < NUM_QREGS; ++i) {
332  KvmFPReg reg;
333  DPRINTF(KvmContext, " Q%i: %s\n", i, getAndFormatOneReg(kvmFPReg(i)));
334  getOneReg(kvmFPReg(i), reg.data);
335  auto v = tc->getWritableVecReg(RegId(VecRegClass, i)).as<VecElem>();
336  for (int j = 0; j < FP_REGS_PER_VFP_REG; j++)
337  v[j] = reg.s[j].i;
338  if (!inAArch64(tc))
340  }
341 
342  for (const auto &ri : getSysRegMap()) {
343  const auto value(getOneRegU64(ri.kvm));
344  DPRINTF(KvmContext, " %s := 0x%x\n", ri.name, value);
345  if (ri.is_device) {
346  // This system register is backed by a device. This means
347  // we need to lock the device event queue.
349 
350  tc->setMiscReg(ri.idx, value);
351  } else {
352  tc->setMiscRegNoEffect(ri.idx, value);
353  }
354  }
355 
356  PCState pc(getOneRegU64(INT_REG(regs.pc)));
357  pc.aarch64(inAArch64(tc));
358  pc.thumb(cpsr.t);
359  pc.nextAArch64(inAArch64(tc));
360  // TODO: This is a massive assumption that will break when
361  // switching to thumb.
362  pc.nextThumb(cpsr.t);
363  DPRINTF(KvmContext, " PC := 0x%x (t: %i, a64: %i)\n",
364  pc.instAddr(), pc.thumb(), pc.aarch64());
365  tc->pcState(pc);
366 }
367 
370 {
371  // Try to use the cached map
372  if (!sysRegMap.empty())
373  return sysRegMap;
374 
375  for (const auto &reg : getRegList()) {
376  const uint64_t arch(reg & KVM_REG_ARCH_MASK);
377  if (arch != KVM_REG_ARM64)
378  continue;
379 
380  const uint64_t type(reg & KVM_REG_ARM_COPROC_MASK);
381  if (type != KVM_REG_ARM64_SYSREG)
382  continue;
383 
384  const uint64_t op0(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP0));
385  const uint64_t op1(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP1));
386  const uint64_t crn(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRN));
387  const uint64_t crm(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_CRM));
388  const uint64_t op2(EXTRACT_FIELD(reg, KVM_REG_ARM64_SYSREG_OP2));
389  const MiscRegIndex idx(decodeAArch64SysReg(op0, op1, crn, crm, op2));
390  const auto &info(miscRegInfo[idx]);
391  const bool writeable(
392  info[MISCREG_USR_NS_WR] || info[MISCREG_USR_S_WR] ||
393  info[MISCREG_PRI_S_WR] || info[MISCREG_PRI_NS_WR] ||
394  info[MISCREG_HYP_NS_WR] ||
395  info[MISCREG_MON_NS0_WR] || info[MISCREG_MON_NS1_WR]);
396  const bool implemented(
398 
399  // Only add implemented registers that we are going to be able
400  // to write.
401  if (implemented && writeable)
402  sysRegMap.emplace_back(reg, idx, miscRegName[idx],
403  deviceRegSet.find(idx) != deviceRegSet.end());
404  }
405 
406  return sysRegMap;
407 }
408 
409 } // 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:1130
gem5::ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: misc.hh:61
gem5::ArmISA::MISCREG_USR_NS_WR
@ MISCREG_USR_NS_WR
Definition: misc.hh:1123
gem5::ArmISA::CCREG_C
@ CCREG_C
Definition: cc.hh:50
gem5::PCStateBase::instAddr
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
Definition: pcstate.hh:107
gem5::ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
gem5::ArmV8KvmCPU::startup
void startup() override
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:447
gem5::KvmFPReg
Definition: armv8_cpu.cc:87
gem5::ArmISA::MISCREG_MON_NS0_WR
@ MISCREG_MON_NS0_WR
Definition: misc.hh:1143
gem5::ThreadContext::pcState
virtual const PCStateBase & pcState() const =0
gem5::ArmISA::CCREG_NZ
@ CCREG_NZ
Definition: cc.hh:49
gem5::ArmISA::MISCREG_PRI_NS_WR
@ MISCREG_PRI_NS_WR
Definition: misc.hh:1128
gem5::ArmV8KvmCPU::updateThreadContext
void updateThreadContext() override
Update the current thread context with the KVM state.
Definition: armv8_cpu.cc:290
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:1173
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:887
std::vector
STL vector class.
Definition: stl.hh:37
gem5::ArmISA::inAArch64
bool inAArch64(ThreadContext *tc)
Definition: utility.cc:121
gem5::BaseKvmCPU::getOneReg
void getOneReg(uint64_t id, void *addr) const
Definition: base.cc:870
gem5::ArmISA::MISCREG_IMPLEMENTED
@ MISCREG_IMPLEMENTED
Definition: misc.hh:1102
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::ArmISA::MISCREG_USR_S_WR
@ MISCREG_USR_S_WR
Definition: misc.hh:1125
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:3399
gem5::kvmFPReg
constexpr uint64_t kvmFPReg(const int num)
Definition: armv8_cpu.cc:81
gem5::ArmISA::IntReg64Map
const IntRegMap IntReg64Map
Definition: int.hh:317
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:1100
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:64
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:55
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::syncVecElemsToRegs
void syncVecElemsToRegs(ThreadContext *tc)
Definition: utility.cc:1358
gem5::ArmISA::s
Bitfield< 4 > s
Definition: misc_types.hh:562
gem5::ArmISA::MISCREG_MON_NS1_WR
@ MISCREG_MON_NS1_WR
Definition: misc.hh:1146
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:853
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::ArmV8KvmCPU::getSysRegMap
const std::vector< ArmV8KvmCPU::MiscRegInfo > & getSysRegMap() const
Get a map between system registers in kvm and gem5 registers.
Definition: armv8_cpu.cc:369
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::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:247
gem5::ArmISA::syncVecRegsToElems
void syncVecRegsToElems(ThreadContext *tc)
Definition: utility.cc:1345
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:390
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:251
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
gem5::VecRegClass
@ VecRegClass
Vector Register.
Definition: reg_class.hh:61
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
Definition: base_cpu.cc:94
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
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:113
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:1105
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:1133

Generated on Wed May 4 2022 12:13:48 for gem5 by doxygen 1.8.17