gem5  v22.1.0.0
isa.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2022 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 #include "arch/arm/isa.hh"
39 
40 #include "arch/arm/decoder.hh"
41 #include "arch/arm/faults.hh"
42 #include "arch/arm/htm.hh"
43 #include "arch/arm/interrupts.hh"
44 #include "arch/arm/mmu.hh"
45 #include "arch/arm/pmu.hh"
46 #include "arch/arm/regs/misc.hh"
47 #include "arch/arm/self_debug.hh"
48 #include "arch/arm/system.hh"
49 #include "arch/arm/utility.hh"
50 #include "arch/generic/decoder.hh"
51 #include "base/cprintf.hh"
52 #include "cpu/base.hh"
53 #include "cpu/checker/cpu.hh"
54 #include "cpu/reg_class.hh"
55 #include "debug/Arm.hh"
56 #include "debug/LLSC.hh"
57 #include "debug/VecPredRegs.hh"
58 #include "debug/VecRegs.hh"
59 #include "dev/arm/generic_timer.hh"
60 #include "dev/arm/gic_v3.hh"
62 #include "params/ArmISA.hh"
63 #include "sim/faults.hh"
64 #include "sim/stat_control.hh"
65 #include "sim/system.hh"
66 
67 namespace gem5
68 {
69 
70 namespace ArmISA
71 {
72 
73 namespace
74 {
75 
76 /* Not applicable to ARM */
77 RegClass floatRegClass(FloatRegClass, FloatRegClassName, 0, debug::FloatRegs);
78 
79 } // anonymous namespace
80 
81 ISA::ISA(const Params &p) : BaseISA(p), system(NULL),
82  _decoderFlavor(p.decoderFlavor), pmu(p.pmu), impdefAsNop(p.impdef_nop)
83 {
84  _regClasses.push_back(&flatIntRegClass);
85  _regClasses.push_back(&floatRegClass);
86  _regClasses.push_back(&vecRegClass);
87  _regClasses.push_back(&vecElemClass);
88  _regClasses.push_back(&vecPredRegClass);
89  _regClasses.push_back(&ccRegClass);
90  _regClasses.push_back(&miscRegClass);
91 
93 
94  // Hook up a dummy device if we haven't been configured with a
95  // real PMU. By using a dummy device, we don't need to check that
96  // the PMU exist every time we try to access a PMU register.
97  if (!pmu)
98  pmu = &dummyDevice;
99 
100  // Give all ISA devices a pointer to this ISA
101  pmu->setISA(this);
102 
103  system = dynamic_cast<ArmSystem *>(p.system);
104 
105  // Cache system-level properties
106  if (FullSystem && system) {
110  sveVL = system->sveVL();
111 
112  release = system->releaseFS();
113  } else {
114  highestELIs64 = true; // ArmSystem::highestELIs64 does the same
115  haveLargeAsid64 = false;
116  physAddrRange = 32; // dummy value
117  sveVL = p.sve_vl_se;
118 
119  release = p.release_se;
120  }
121 
122  selfDebug = new SelfDebug();
125 
126  clear();
127 }
128 
129 void
131 {
132  const Params &p(params());
133 
134  // Invalidate cached copies of miscregs in the TLBs
135  if (tc) {
137  }
138 
139  SCTLR sctlr_rst = miscRegs[MISCREG_SCTLR_RST];
140  memset(miscRegs, 0, sizeof(miscRegs));
141 
142  initID32(p);
143 
144  // We always initialize AArch64 ID registers even
145  // if we are in AArch32. This is done since if we
146  // are in SE mode we don't know if our ArmProcess is
147  // AArch32 or AArch64
148  initID64(p);
149 
150  // Start with an event in the mailbox
152 
153  // Separate Instruction and Data TLBs
154  miscRegs[MISCREG_TLBTR] = 1;
155 
156  MVFR0 mvfr0 = 0;
157  mvfr0.advSimdRegisters = 2;
158  mvfr0.singlePrecision = 2;
159  mvfr0.doublePrecision = 2;
160  mvfr0.vfpExceptionTrapping = 0;
161  mvfr0.divide = 1;
162  mvfr0.squareRoot = 1;
163  mvfr0.shortVectors = 1;
164  mvfr0.roundingModes = 1;
165  miscRegs[MISCREG_MVFR0] = mvfr0;
166 
167  MVFR1 mvfr1 = 0;
168  mvfr1.flushToZero = 1;
169  mvfr1.defaultNaN = 1;
170  mvfr1.advSimdLoadStore = 1;
171  mvfr1.advSimdInteger = 1;
172  mvfr1.advSimdSinglePrecision = 1;
173  mvfr1.advSimdHalfPrecision = 1;
174  mvfr1.vfpHalfPrecision = 1;
175  miscRegs[MISCREG_MVFR1] = mvfr1;
176 
177  // Reset values of PRRR and NMRR are implementation dependent
178 
179  // @todo: PRRR and NMRR in secure state?
181  (1 << 19) | // 19
182  (0 << 18) | // 18
183  (0 << 17) | // 17
184  (1 << 16) | // 16
185  (2 << 14) | // 15:14
186  (0 << 12) | // 13:12
187  (2 << 10) | // 11:10
188  (2 << 8) | // 9:8
189  (2 << 6) | // 7:6
190  (2 << 4) | // 5:4
191  (1 << 2) | // 3:2
192  0; // 1:0
193 
195  (1 << 30) | // 31:30
196  (0 << 26) | // 27:26
197  (0 << 24) | // 25:24
198  (3 << 22) | // 23:22
199  (2 << 20) | // 21:20
200  (0 << 18) | // 19:18
201  (0 << 16) | // 17:16
202  (1 << 14) | // 15:14
203  (0 << 12) | // 13:12
204  (2 << 10) | // 11:10
205  (0 << 8) | // 9:8
206  (3 << 6) | // 7:6
207  (2 << 4) | // 5:4
208  (0 << 2) | // 3:2
209  0; // 1:0
210 
211  if (FullSystem && system->highestELIs64()) {
212  // Initialize AArch64 state
213  clear64(p);
214  return;
215  }
216 
217  // Initialize AArch32 state...
218  clear32(p, sctlr_rst);
219 }
220 
221 void
222 ISA::clear32(const ArmISAParams &p, const SCTLR &sctlr_rst)
223 {
224  CPSR cpsr = 0;
225  cpsr.mode = MODE_USER;
226 
227  if (FullSystem) {
229  }
230 
231  miscRegs[MISCREG_CPSR] = cpsr;
232  updateRegMap(cpsr);
233 
234  SCTLR sctlr = 0;
235  sctlr.te = (bool) sctlr_rst.te;
236  sctlr.nmfi = (bool) sctlr_rst.nmfi;
237  sctlr.v = (bool) sctlr_rst.v;
238  sctlr.u = 1;
239  sctlr.xp = 1;
240  sctlr.rao2 = 1;
241  sctlr.rao3 = 1;
242  sctlr.rao4 = 0xf; // SCTLR[6:3]
243  sctlr.uci = 1;
244  sctlr.dze = 1;
245  miscRegs[MISCREG_SCTLR_NS] = sctlr;
246  miscRegs[MISCREG_SCTLR_RST] = sctlr_rst;
247  miscRegs[MISCREG_HCPTR] = 0;
248 
249  miscRegs[MISCREG_CPACR] = 0;
250 
251  miscRegs[MISCREG_FPSID] = p.fpsid;
252 
253  if (release->has(ArmExtension::LPAE)) {
254  TTBCR ttbcr = miscRegs[MISCREG_TTBCR_NS];
255  ttbcr.eae = 0;
256  miscRegs[MISCREG_TTBCR_NS] = ttbcr;
257  // Enforce consistency with system-level settings
259  }
260 
261  if (release->has(ArmExtension::SECURITY)) {
262  miscRegs[MISCREG_SCTLR_S] = sctlr;
263  miscRegs[MISCREG_SCR] = 0;
265  } else {
266  // we're always non-secure
267  miscRegs[MISCREG_SCR] = 1;
268  }
269 
270  //XXX We need to initialize the rest of the state.
271 }
272 
273 void
274 ISA::clear64(const ArmISAParams &p)
275 {
276  CPSR cpsr = 0;
277  Addr rvbar = system->resetAddr();
278  switch (system->highestEL()) {
279  // Set initial EL to highest implemented EL using associated stack
280  // pointer (SP_ELx); set RVBAR_ELx to implementation defined reset
281  // value
282  case EL3:
283  cpsr.mode = MODE_EL3H;
284  miscRegs[MISCREG_RVBAR_EL3] = rvbar;
285  break;
286  case EL2:
287  cpsr.mode = MODE_EL2H;
288  miscRegs[MISCREG_RVBAR_EL2] = rvbar;
289  break;
290  case EL1:
291  cpsr.mode = MODE_EL1H;
292  miscRegs[MISCREG_RVBAR_EL1] = rvbar;
293  break;
294  default:
295  panic("Invalid highest implemented exception level");
296  break;
297  }
298 
299  // Initialize rest of CPSR
300  cpsr.daif = 0xf; // Mask all interrupts
301  cpsr.ss = 0;
302  cpsr.il = 0;
303  miscRegs[MISCREG_CPSR] = cpsr;
304  updateRegMap(cpsr);
305 
306  // Initialize other control registers
307  miscRegs[MISCREG_MPIDR_EL1] = 0x80000000;
308  if (release->has(ArmExtension::SECURITY)) {
309  miscRegs[MISCREG_SCTLR_EL3] = 0x30c50830;
310  miscRegs[MISCREG_SCR_EL3] = 0x00000030; // RES1 fields
311  } else if (release->has(ArmExtension::VIRTUALIZATION)) {
312  // also MISCREG_SCTLR_EL2 (by mapping)
313  miscRegs[MISCREG_HSCTLR] = 0x30c50830;
314  } else {
315  // also MISCREG_SCTLR_EL1 (by mapping)
316  miscRegs[MISCREG_SCTLR_NS] = 0x30d00800 | 0x00050030; // RES1 | init
317  // Always non-secure
319  }
320 }
321 
322 void
323 ISA::initID32(const ArmISAParams &p)
324 {
325  // Initialize configurable default values
326 
327  uint32_t midr;
328  if (p.midr != 0x0)
329  midr = p.midr;
330  else if (highestELIs64)
331  // Cortex-A57 TRM r0p0 MIDR
332  midr = 0x410fd070;
333  else
334  // Cortex-A15 TRM r0p0 MIDR
335  midr = 0x410fc0f0;
336 
337  miscRegs[MISCREG_MIDR] = midr;
338  miscRegs[MISCREG_MIDR_EL1] = midr;
339  miscRegs[MISCREG_VPIDR] = midr;
340 
341  miscRegs[MISCREG_ID_ISAR0] = p.id_isar0;
342  miscRegs[MISCREG_ID_ISAR1] = p.id_isar1;
343  miscRegs[MISCREG_ID_ISAR2] = p.id_isar2;
344  miscRegs[MISCREG_ID_ISAR3] = p.id_isar3;
345  miscRegs[MISCREG_ID_ISAR4] = p.id_isar4;
346  miscRegs[MISCREG_ID_ISAR5] = p.id_isar5;
347  miscRegs[MISCREG_ID_ISAR6] = p.id_isar6;
348 
349  miscRegs[MISCREG_ID_MMFR0] = p.id_mmfr0;
350  miscRegs[MISCREG_ID_MMFR1] = p.id_mmfr1;
351  miscRegs[MISCREG_ID_MMFR2] = p.id_mmfr2;
352  miscRegs[MISCREG_ID_MMFR3] = p.id_mmfr3;
353  miscRegs[MISCREG_ID_MMFR4] = p.id_mmfr4;
354 
356  // Crypto
358  miscRegs[MISCREG_ID_ISAR5], 19, 4,
359  release->has(ArmExtension::CRYPTO) ? 0x1112 : 0x0);
360  // RDM
362  miscRegs[MISCREG_ID_ISAR5], 27, 24,
363  release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0);
364  // FCMA
366  miscRegs[MISCREG_ID_ISAR5], 31, 28,
367  release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0);
368 
371  miscRegs[MISCREG_ID_ISAR6], 3, 0,
372  release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0);
373 }
374 
375 void
376 ISA::initID64(const ArmISAParams &p)
377 {
378  // Initialize configurable id registers
379  miscRegs[MISCREG_ID_AA64AFR0_EL1] = p.id_aa64afr0_el1;
380  miscRegs[MISCREG_ID_AA64AFR1_EL1] = p.id_aa64afr1_el1;
382  (p.id_aa64dfr0_el1 & 0xfffffffffffff0ffULL) |
383  (p.pmu ? 0x0000000000000100ULL : 0); // Enable PMUv3
384 
385  miscRegs[MISCREG_ID_AA64DFR1_EL1] = p.id_aa64dfr1_el1;
386  miscRegs[MISCREG_ID_AA64ISAR0_EL1] = p.id_aa64isar0_el1;
387  miscRegs[MISCREG_ID_AA64ISAR1_EL1] = p.id_aa64isar1_el1;
388  miscRegs[MISCREG_ID_AA64MMFR0_EL1] = p.id_aa64mmfr0_el1;
389  miscRegs[MISCREG_ID_AA64MMFR1_EL1] = p.id_aa64mmfr1_el1;
390  miscRegs[MISCREG_ID_AA64MMFR2_EL1] = p.id_aa64mmfr2_el1;
391 
393  (p.pmu ? 0x03000000ULL : 0); // Enable PMUv3
394 
396 
397  // SVE
398  miscRegs[MISCREG_ID_AA64ZFR0_EL1] = 0; // SVEver 0
399  if (release->has(ArmExtension::SECURITY)) {
401  } else if (release->has(ArmExtension::VIRTUALIZATION)) {
403  } else {
405  }
406 
407  // Enforce consistency with system-level settings...
408 
409  // EL3
412  release->has(ArmExtension::SECURITY) ? 0x2 : 0x0);
413  // EL2
416  release->has(ArmExtension::VIRTUALIZATION) ? 0x2 : 0x0);
417  // SVE
420  release->has(ArmExtension::FEAT_SVE) ? 0x1 : 0x0);
421  // SecEL2
424  release->has(ArmExtension::FEAT_SEL2) ? 0x1 : 0x0);
425 
426  // Large ASID support
429  haveLargeAsid64 ? 0x2 : 0x0);
430  // Physical address size
434 
436  // Crypto
439  release->has(ArmExtension::CRYPTO) ? 0x1112 : 0x0);
440  // LSE
443  release->has(ArmExtension::FEAT_LSE) ? 0x2 : 0x0);
444  // RDM
447  release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0);
448 
450  // PAuth, APA
453  release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0);
454  // JSCVT
457  release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0);
458  // FCMA
461  release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0);
462  // PAuth, GPA
465  release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0);
466 
468  // VMID16
471  release->has(ArmExtension::FEAT_VMID16) ? 0x2 : 0x0);
472  // VHE
475  release->has(ArmExtension::FEAT_VHE) ? 0x1 : 0x0);
476  // HPDS
479  release->has(ArmExtension::FEAT_HPDS) ? 0x1 : 0x0);
480  // PAN
483  release->has(ArmExtension::FEAT_PAN) ? 0x1 : 0x0);
484 
486  // UAO
489  release->has(ArmExtension::FEAT_UAO) ? 0x1 : 0x0);
490  // LVA
493  release->has(ArmExtension::FEAT_LVA) ? 0x1 : 0x0);
494 
495 
496  // TME
499  release->has(ArmExtension::TME) ? 0x1 : 0x0);
500 }
501 
502 void
504 {
506 
507  if (tc) {
509 
510  if (release->has(ArmExtension::TME)) {
511  std::unique_ptr<BaseHTMCheckpoint> cpt(new HTMCheckpoint());
512  tc->setHtmCheckpointPtr(std::move(cpt));
513  }
514  }
515 }
516 
517 void
519 {
521 
522  if (!system)
523  return;
524 
525  selfDebug->init(tc);
526 
527  if (auto gicv3_ifc = getGICv3CPUInterface(tc); gicv3_ifc) {
528  gicv3_ifc->setISA(this);
529  gicv3_ifc->setThreadContext(tc);
530  }
531 }
532 
533 void
535 {
536  tc = new_tc;
538 }
539 
540 void
542 {
543  for (auto &id: flatIntRegClass)
544  tc->setReg(id, src->getReg(id));
545 
546  for (auto &id: ccRegClass)
547  tc->setReg(id, src->getReg(id));
548 
549  for (int i = 0; i < NUM_MISCREGS; i++)
551 
553  for (auto &id: vecRegClass) {
554  src->getReg(id, &vc);
555  tc->setReg(id, &vc);
556  }
557 
558  for (auto &id: vecElemClass)
559  tc->setReg(id, src->getReg(id));
560 
561  // setMiscReg "with effect" will set the misc register mapping correctly.
562  // e.g. updateRegMap(val)
564 
565  // Copy over the PC State
566  tc->pcState(src->pcState());
567 
568  // Invalidate the tlb misc register cache
569  static_cast<MMU *>(tc->getMMUPtr())->invalidateMiscReg();
570 }
571 
576 int
577 ISA::redirectRegVHE(int misc_reg)
578 {
579  const HCR hcr = readMiscRegNoEffect(MISCREG_HCR_EL2);
580  if (hcr.e2h == 0x0)
581  return misc_reg;
583  bool sec_el2 = scr.eel2 && release->has(ArmExtension::FEAT_SEL2);
584  switch(misc_reg) {
585  case MISCREG_SPSR_EL1:
586  return currEL() == EL2 ? MISCREG_SPSR_EL2 : misc_reg;
587  case MISCREG_ELR_EL1:
588  return currEL() == EL2 ? MISCREG_ELR_EL2 : misc_reg;
589  case MISCREG_SCTLR_EL1:
590  return currEL() == EL2 ? MISCREG_SCTLR_EL2 : misc_reg;
591  case MISCREG_CPACR_EL1:
592  return currEL() == EL2 ? MISCREG_CPTR_EL2 : misc_reg;
593 // case MISCREG_TRFCR_EL1:
594 // return currEL() == EL2 ? MISCREG_TRFCR_EL2 : misc_reg;
595  case MISCREG_TTBR0_EL1:
596  return currEL() == EL2 ? MISCREG_TTBR0_EL2 : misc_reg;
597  case MISCREG_TTBR1_EL1:
598  return currEL() == EL2 ? MISCREG_TTBR1_EL2 : misc_reg;
599  case MISCREG_TCR_EL1:
600  return currEL() == EL2 ? MISCREG_TCR_EL2 : misc_reg;
601  case MISCREG_AFSR0_EL1:
602  return currEL() == EL2 ? MISCREG_AFSR0_EL2 : misc_reg;
603  case MISCREG_AFSR1_EL1:
604  return currEL() == EL2 ? MISCREG_AFSR1_EL2 : misc_reg;
605  case MISCREG_ESR_EL1:
606  return currEL() == EL2 ? MISCREG_ESR_EL2 : misc_reg;
607  case MISCREG_FAR_EL1:
608  return currEL() == EL2 ? MISCREG_FAR_EL2 : misc_reg;
609  case MISCREG_MAIR_EL1:
610  return currEL() == EL2 ? MISCREG_MAIR_EL2 : misc_reg;
611  case MISCREG_AMAIR_EL1:
612  return currEL() == EL2 ? MISCREG_AMAIR_EL2 : misc_reg;
613  case MISCREG_VBAR_EL1:
614  return currEL() == EL2 ? MISCREG_VBAR_EL2 : misc_reg;
616  return currEL() == EL2 ? MISCREG_CONTEXTIDR_EL2 : misc_reg;
617  case MISCREG_CNTKCTL_EL1:
618  return currEL() == EL2 ? MISCREG_CNTHCTL_EL2 : misc_reg;
619  case MISCREG_CNTP_TVAL:
621  if (ELIsInHost(tc, currEL())) {
622  return sec_el2 && !scr.ns ? MISCREG_CNTHPS_TVAL_EL2:
624  } else {
625  return misc_reg;
626  }
627  case MISCREG_CNTP_CTL:
629  if (ELIsInHost(tc, currEL())) {
630  return sec_el2 && !scr.ns ? MISCREG_CNTHPS_CTL_EL2:
632  } else {
633  return misc_reg;
634  }
635  case MISCREG_CNTP_CVAL:
637  if (ELIsInHost(tc, currEL())) {
638  return sec_el2 && !scr.ns ? MISCREG_CNTHPS_CVAL_EL2:
640  } else {
641  return misc_reg;
642  }
643  case MISCREG_CNTV_TVAL:
645  if (ELIsInHost(tc, currEL())) {
646  return sec_el2 && !scr.ns ? MISCREG_CNTHVS_TVAL_EL2:
648  } else {
649  return misc_reg;
650  }
651  case MISCREG_CNTV_CTL:
653  if (ELIsInHost(tc, currEL())) {
654  return sec_el2 && !scr.ns ? MISCREG_CNTHVS_CTL_EL2:
656  } else {
657  return misc_reg;
658  }
659  case MISCREG_CNTV_CVAL:
661  if (ELIsInHost(tc, currEL())) {
662  return sec_el2 && !scr.ns ? MISCREG_CNTHVS_CVAL_EL2:
664  } else {
665  return misc_reg;
666  }
667  case MISCREG_CNTVCT:
668  case MISCREG_CNTVCT_EL0:
669  return ELIsInHost(tc, currEL()) ? MISCREG_CNTPCT_EL0 : misc_reg;
670  case MISCREG_SCTLR_EL12:
671  return MISCREG_SCTLR_EL1;
672  case MISCREG_CPACR_EL12:
673  return MISCREG_CPACR_EL1;
674  case MISCREG_ZCR_EL12:
675  return MISCREG_ZCR_EL1;
676  case MISCREG_TTBR0_EL12:
677  return MISCREG_TTBR0_EL1;
678  case MISCREG_TTBR1_EL12:
679  return MISCREG_TTBR1_EL1;
680  case MISCREG_TCR_EL12:
681  return MISCREG_TCR_EL1;
682  case MISCREG_SPSR_EL12:
683  return MISCREG_SPSR_EL1;
684  case MISCREG_ELR_EL12:
685  return MISCREG_ELR_EL1;
686  case MISCREG_AFSR0_EL12:
687  return MISCREG_AFSR0_EL1;
688  case MISCREG_AFSR1_EL12:
689  return MISCREG_AFSR1_EL1;
690  case MISCREG_ESR_EL12:
691  return MISCREG_ESR_EL1;
692  case MISCREG_FAR_EL12:
693  return MISCREG_FAR_EL1;
694  case MISCREG_MAIR_EL12:
695  return MISCREG_MAIR_EL1;
696  case MISCREG_AMAIR_EL12:
697  return MISCREG_AMAIR_EL1;
698  case MISCREG_VBAR_EL12:
699  return MISCREG_VBAR_EL1;
701  return MISCREG_CONTEXTIDR_EL1;
703  return MISCREG_CNTKCTL_EL1;
704  // _EL02 registers
706  return MISCREG_CNTP_TVAL_EL0;
708  return MISCREG_CNTP_CTL_EL0;
710  return MISCREG_CNTP_CVAL_EL0;
712  return MISCREG_CNTV_TVAL_EL0;
714  return MISCREG_CNTV_CTL_EL0;
716  return MISCREG_CNTV_CVAL_EL0;
717  default:
718  return misc_reg;
719  }
720 }
721 
722 RegVal
724 {
725  assert(idx < NUM_MISCREGS);
726 
727  const auto &reg = lookUpMiscReg[idx]; // bit masks
728  const auto &map = getMiscIndices(idx);
729  int lower = map.first, upper = map.second;
730  // NB!: apply architectural masks according to desired register,
731  // despite possibly getting value from different (mapped) register.
732  auto val = !upper ? miscRegs[lower] : ((miscRegs[lower] & mask(32))
733  |(miscRegs[upper] << 32));
734  if (val & reg.res0()) {
735  DPRINTF(MiscRegs, "Reading MiscReg %s with set res0 bits: %#x\n",
736  miscRegName[idx], val & reg.res0());
737  }
738  if ((val & reg.res1()) != reg.res1()) {
739  DPRINTF(MiscRegs, "Reading MiscReg %s with clear res1 bits: %#x\n",
740  miscRegName[idx], (val & reg.res1()) ^ reg.res1());
741  }
742  return (val & ~reg.raz()) | reg.rao(); // enforce raz/rao
743 }
744 
745 
746 RegVal
748 {
749  CPSR cpsr = 0;
750  SCR scr = 0;
751 
752  if (idx == MISCREG_CPSR) {
753  cpsr = miscRegs[idx];
754  auto pc = tc->pcState().as<PCState>();
755  cpsr.j = pc.jazelle() ? 1 : 0;
756  cpsr.t = pc.thumb() ? 1 : 0;
757  return cpsr;
758  }
759 
760 #ifndef NDEBUG
761  auto& miscreg_info = lookUpMiscReg[idx].info;
762  if (!miscreg_info[MISCREG_IMPLEMENTED]) {
763  if (miscreg_info[MISCREG_WARN_NOT_FAIL])
764  warn("Unimplemented system register %s read.\n",
765  miscRegName[idx]);
766  else
767  panic("Unimplemented system register %s read.\n",
768  miscRegName[idx]);
769  }
770 #endif
771  idx = redirectRegVHE(idx);
772 
773  switch (unflattenMiscReg(idx)) {
774  case MISCREG_HCR:
775  case MISCREG_HCR2:
776  if (!release->has(ArmExtension::VIRTUALIZATION))
777  return 0;
778  break;
779  case MISCREG_CPACR:
780  {
781  const uint32_t ones = (uint32_t)(-1);
782  CPACR cpacrMask = 0;
783  // Only cp10, cp11, and ase are implemented, nothing else should
784  // be readable? (straight copy from the write code)
785  cpacrMask.cp10 = ones;
786  cpacrMask.cp11 = ones;
787  cpacrMask.asedis = ones;
788 
789  // Security Extensions may limit the readability of CPACR
790  if (release->has(ArmExtension::SECURITY)) {
793  if (scr.ns && (cpsr.mode != MODE_MON) && ELIs32(tc, EL3)) {
794  NSACR nsacr = readMiscRegNoEffect(MISCREG_NSACR);
795  // NB: Skipping the full loop, here
796  if (!nsacr.cp10) cpacrMask.cp10 = 0;
797  if (!nsacr.cp11) cpacrMask.cp11 = 0;
798  }
799  }
801  val &= cpacrMask;
802  DPRINTF(MiscRegs, "Reading misc reg %s: %#x\n",
803  miscRegName[idx], val);
804  return val;
805  }
806  case MISCREG_MPIDR:
807  case MISCREG_MPIDR_EL1:
808  return readMPIDR(system, tc);
809  case MISCREG_VMPIDR:
810  case MISCREG_VMPIDR_EL2:
811  // top bit defined as RES1
812  return readMiscRegNoEffect(idx) | 0x80000000;
813  case MISCREG_ID_AFR0: // not implemented, so alias MIDR
814  case MISCREG_REVIDR: // not implemented, so alias MIDR
815  case MISCREG_MIDR:
818  if ((cpsr.mode == MODE_HYP) || isSecure(tc)) {
819  return readMiscRegNoEffect(idx);
820  } else {
822  }
823  break;
824  case MISCREG_JOSCR: // Jazelle trivial implementation, RAZ/WI
825  case MISCREG_JMCR: // Jazelle trivial implementation, RAZ/WI
826  case MISCREG_JIDR: // Jazelle trivial implementation, RAZ/WI
827  case MISCREG_AIDR: // AUX ID set to 0
828  case MISCREG_TCMTR: // No TCM's
829  return 0;
830 
831  case MISCREG_CLIDR:
832  warn_once("The clidr register always reports 0 caches.\n");
833  warn_once("clidr LoUIS field of 0b001 to match current "
834  "ARM implementations.\n");
835  return 0x00200000;
836  case MISCREG_CCSIDR:
837  warn_once("The ccsidr register isn't implemented and "
838  "always reads as 0.\n");
839  break;
840  case MISCREG_CTR: // AArch32, ARMv7, top bit set
841  case MISCREG_CTR_EL0: // AArch64
842  {
843  //all caches have the same line size in gem5
844  //4 byte words in ARM
845  unsigned lineSizeWords =
846  tc->getSystemPtr()->cacheLineSize() / 4;
847  unsigned log2LineSizeWords = 0;
848 
849  while (lineSizeWords >>= 1) {
850  ++log2LineSizeWords;
851  }
852 
853  CTR ctr = 0;
854  //log2 of minimun i-cache line size (words)
855  ctr.iCacheLineSize = log2LineSizeWords;
856  //b11 - gem5 uses pipt
857  ctr.l1IndexPolicy = 0x3;
858  //log2 of minimum d-cache line size (words)
859  ctr.dCacheLineSize = log2LineSizeWords;
860  //log2 of max reservation size (words)
861  ctr.erg = log2LineSizeWords;
862  //log2 of max writeback size (words)
863  ctr.cwg = log2LineSizeWords;
864  //b100 - gem5 format is ARMv7
865  ctr.format = 0x4;
866 
867  return ctr;
868  }
869  case MISCREG_ACTLR:
870  warn("Not doing anything for miscreg ACTLR\n");
871  break;
872 
877  return pmu->readMiscReg(idx);
878 
879  case MISCREG_CPSR_Q:
880  panic("shouldn't be reading this register seperately\n");
881  case MISCREG_FPSCR_QC:
883  case MISCREG_FPSCR_EXC:
885  case MISCREG_FPSR:
886  {
887  const uint32_t ones = (uint32_t)(-1);
888  FPSCR fpscrMask = 0;
889  fpscrMask.ioc = ones;
890  fpscrMask.dzc = ones;
891  fpscrMask.ofc = ones;
892  fpscrMask.ufc = ones;
893  fpscrMask.ixc = ones;
894  fpscrMask.idc = ones;
895  fpscrMask.qc = ones;
896  fpscrMask.v = ones;
897  fpscrMask.c = ones;
898  fpscrMask.z = ones;
899  fpscrMask.n = ones;
900  return readMiscRegNoEffect(MISCREG_FPSCR) & (uint32_t)fpscrMask;
901  }
902  case MISCREG_FPCR:
903  {
904  const uint32_t ones = (uint32_t)(-1);
905  FPSCR fpscrMask = 0;
906  fpscrMask.len = ones;
907  fpscrMask.fz16 = ones;
908  fpscrMask.stride = ones;
909  fpscrMask.rMode = ones;
910  fpscrMask.fz = ones;
911  fpscrMask.dn = ones;
912  fpscrMask.ahp = ones;
913  return readMiscRegNoEffect(MISCREG_FPSCR) & (uint32_t)fpscrMask;
914  }
915  case MISCREG_NZCV:
916  {
917  CPSR cpsr = 0;
918  cpsr.nz = tc->getReg(cc_reg::Nz);
919  cpsr.c = tc->getReg(cc_reg::C);
920  cpsr.v = tc->getReg(cc_reg::V);
921  return cpsr;
922  }
923  case MISCREG_DAIF:
924  {
925  CPSR cpsr = 0;
926  cpsr.daif = (uint8_t) ((CPSR) miscRegs[MISCREG_CPSR]).daif;
927  return cpsr;
928  }
929  case MISCREG_SP_EL0:
930  {
931  return tc->getReg(int_reg::Sp0);
932  }
933  case MISCREG_SP_EL1:
934  {
935  return tc->getReg(int_reg::Sp1);
936  }
937  case MISCREG_SP_EL2:
938  {
939  return tc->getReg(int_reg::Sp2);
940  }
941  case MISCREG_SPSEL:
942  {
943  return miscRegs[MISCREG_CPSR] & 0x1;
944  }
945  case MISCREG_CURRENTEL:
946  {
947  return miscRegs[MISCREG_CPSR] & 0xc;
948  }
949  case MISCREG_PAN:
950  {
951  return miscRegs[MISCREG_CPSR] & 0x400000;
952  }
953  case MISCREG_UAO:
954  {
955  return miscRegs[MISCREG_CPSR] & 0x800000;
956  }
957  case MISCREG_L2CTLR:
958  {
959  // mostly unimplemented, just set NumCPUs field from sim and return
960  L2CTLR l2ctlr = 0;
961  // b00:1CPU to b11:4CPUs
962  l2ctlr.numCPUs = tc->getSystemPtr()->threads.size() - 1;
963  return l2ctlr;
964  }
965  case MISCREG_DBGDIDR:
966  /* For now just implement the version number.
967  * ARMv7, v7.1 Debug architecture (0b0101 --> 0x5)
968  */
969  return 0x5 << 16;
970  case MISCREG_DBGDSCRint:
972  case MISCREG_ISR:
973  case MISCREG_ISR_EL1:
974  {
975  auto ic = dynamic_cast<ArmISA::Interrupts *>(
977  return ic->getISR(
981  }
982  case MISCREG_DCZID_EL0:
983  return 0x04; // DC ZVA clear 64-byte chunks
984  case MISCREG_HCPTR:
985  {
987  // The trap bit associated with CP14 is defined as RAZ
988  val &= ~(1 << 14);
989  // If a CP bit in NSACR is 0 then the corresponding bit in
990  // HCPTR is RAO/WI
991  bool secure_lookup = release->has(ArmExtension::SECURITY) &&
992  isSecure(tc);
993  if (!secure_lookup) {
995  val |= (mask ^ 0x7FFF) & 0xBFFF;
996  }
997  // Set the bits for unimplemented coprocessors to RAO/WI
998  val |= 0x33FF;
999  return (val);
1000  }
1001  case MISCREG_HDFAR: // alias for secure DFAR
1003  case MISCREG_HIFAR: // alias for secure IFAR
1005 
1006  case MISCREG_ID_PFR0:
1007  // !ThumbEE | !Jazelle | Thumb | ARM
1008  return 0x00000031;
1009  case MISCREG_ID_PFR1:
1010  { // Timer | Virti | !M Profile | TrustZone | ARMv4
1011  bool have_timer = (system->getGenericTimer() != nullptr);
1012  return 0x00000001 |
1013  (release->has(ArmExtension::SECURITY) ?
1014  0x00000010 : 0x0) |
1015  (release->has(ArmExtension::VIRTUALIZATION) ?
1016  0x00001000 : 0x0) |
1017  (have_timer ? 0x00010000 : 0x0);
1018  }
1020  return 0x0000000000000002 | // AArch{64,32} supported at EL0
1021  0x0000000000000020 | // EL1
1022  (release->has(ArmExtension::VIRTUALIZATION) ?
1023  0x0000000000000200 : 0) | // EL2
1024  (release->has(ArmExtension::SECURITY) ?
1025  0x0000000000002000 : 0) | // EL3
1026  (release->has(ArmExtension::FEAT_SVE) ?
1027  0x0000000100000000 : 0) | // SVE
1028  (release->has(ArmExtension::FEAT_SEL2) ?
1029  0x0000001000000000 : 0) | // SecEL2
1030  (gicv3CpuInterface ? 0x0000000001000000 : 0);
1032  return 0; // bits [63:0] RES0 (reserved for future use)
1033 
1034  // Generic Timer registers
1037  return getGenericTimer().readMiscReg(idx);
1038 
1042  return getGICv3CPUInterface().readMiscReg(idx);
1043 
1044  default:
1045  break;
1046 
1047  }
1048  return readMiscRegNoEffect(idx);
1049 }
1050 
1051 void
1053 {
1054  assert(idx < NUM_MISCREGS);
1055 
1056  const auto &reg = lookUpMiscReg[idx]; // bit masks
1057  const auto &map = getMiscIndices(idx);
1058  int lower = map.first, upper = map.second;
1059 
1060  auto v = (val & ~reg.wi()) | reg.rao();
1061  if (upper > 0) {
1062  miscRegs[lower] = bits(v, 31, 0);
1063  miscRegs[upper] = bits(v, 63, 32);
1064  DPRINTF(MiscRegs, "Writing MiscReg %s (%d %d:%d) : %#x\n",
1065  miscRegName[idx], idx, lower, upper, v);
1066  } else {
1067  miscRegs[lower] = v;
1068  DPRINTF(MiscRegs, "Writing MiscReg %s (%d %d) : %#x\n",
1069  miscRegName[idx], idx, lower, v);
1070  }
1071 }
1072 
1073 void
1075 {
1076 
1077  RegVal newVal = val;
1078  bool secure_lookup;
1079  SCR scr;
1080 
1081  if (idx == MISCREG_CPSR) {
1082  updateRegMap(val);
1083 
1084 
1085  CPSR old_cpsr = miscRegs[MISCREG_CPSR];
1086  int old_mode = old_cpsr.mode;
1087  CPSR cpsr = val;
1088  if (cpsr.pan != old_cpsr.pan || cpsr.il != old_cpsr.il) {
1090  }
1091 
1092  DPRINTF(Arm, "Updating CPSR from %#x to %#x f:%d i:%d a:%d mode:%#x\n",
1093  miscRegs[idx], cpsr, cpsr.f, cpsr.i, cpsr.a, cpsr.mode);
1094  PCState pc = tc->pcState().as<PCState>();
1095  pc.nextThumb(cpsr.t);
1096  pc.nextJazelle(cpsr.j);
1097  pc.illegalExec(cpsr.il == 1);
1098  selfDebug->setDebugMask(cpsr.d == 1);
1099 
1100  tc->getDecoderPtr()->as<Decoder>().setSveLen(
1101  (getCurSveVecLenInBits() >> 7) - 1);
1102 
1103  // Follow slightly different semantics if a CheckerCPU object
1104  // is connected
1105  CheckerCPU *checker = tc->getCheckerCpuPtr();
1106  if (checker) {
1107  tc->pcStateNoRecord(pc);
1108  } else {
1109  tc->pcState(pc);
1110  }
1111 
1112  setMiscRegNoEffect(idx, newVal);
1113 
1114  if (old_mode != cpsr.mode) {
1116  if (gicv3CpuInterface) {
1117  // The assertion and de-assertion of IRQs and FIQs are
1118  // affected by the current Exception level and Security
1119  // state of the PE. As part of the Context
1120  // Synchronization that occurs as the result of taking
1121  // or returning from an exception, the CPU interface
1122  // ensures that IRQ and FIQ are both appropriately
1123  // asserted or deasserted for the Exception level and
1124  // Security state that the PE is entering.
1125  static_cast<Gicv3CPUInterface&>(
1126  getGICv3CPUInterface()).update();
1127  }
1128  }
1129  } else {
1130 #ifndef NDEBUG
1131  auto& miscreg_info = lookUpMiscReg[idx].info;
1132  if (!miscreg_info[MISCREG_IMPLEMENTED]) {
1133  if (miscreg_info[MISCREG_WARN_NOT_FAIL])
1134  warn("Unimplemented system register %s write with %#x.\n",
1135  miscRegName[idx], val);
1136  else
1137  panic("Unimplemented system register %s write with %#x.\n",
1138  miscRegName[idx], val);
1139  }
1140 #endif
1141  idx = redirectRegVHE(idx);
1142 
1143  switch (unflattenMiscReg(idx)) {
1144  case MISCREG_CPACR:
1145  {
1146 
1147  const uint32_t ones = (uint32_t)(-1);
1148  CPACR cpacrMask = 0;
1149  // Only cp10, cp11, and ase are implemented, nothing else should
1150  // be writable
1151  cpacrMask.cp10 = ones;
1152  cpacrMask.cp11 = ones;
1153  cpacrMask.asedis = ones;
1154 
1155  // Security Extensions may limit the writability of CPACR
1156  if (release->has(ArmExtension::SECURITY)) {
1158  CPSR cpsr = readMiscRegNoEffect(MISCREG_CPSR);
1159  if (scr.ns && (cpsr.mode != MODE_MON) && ELIs32(tc, EL3)) {
1160  NSACR nsacr = readMiscRegNoEffect(MISCREG_NSACR);
1161  // NB: Skipping the full loop, here
1162  if (!nsacr.cp10) cpacrMask.cp10 = 0;
1163  if (!nsacr.cp11) cpacrMask.cp11 = 0;
1164  }
1165  }
1166 
1168  newVal &= cpacrMask;
1169  newVal |= old_val & ~cpacrMask;
1170  DPRINTF(MiscRegs, "Writing misc reg %s: %#x\n",
1171  miscRegName[idx], newVal);
1172  }
1173  break;
1174  case MISCREG_CPACR_EL1:
1175  {
1176  const uint32_t ones = (uint32_t)(-1);
1177  CPACR cpacrMask = 0;
1178  cpacrMask.tta = ones;
1179  cpacrMask.fpen = ones;
1180  if (release->has(ArmExtension::FEAT_SVE)) {
1181  cpacrMask.zen = ones;
1182  }
1183  newVal &= cpacrMask;
1184  DPRINTF(MiscRegs, "Writing misc reg %s: %#x\n",
1185  miscRegName[idx], newVal);
1186  }
1187  break;
1188  case MISCREG_CPTR_EL2:
1189  {
1190  const HCR hcr = readMiscRegNoEffect(MISCREG_HCR_EL2);
1191  const uint32_t ones = (uint32_t)(-1);
1192  CPTR cptrMask = 0;
1193  cptrMask.tcpac = ones;
1194  cptrMask.tta = ones;
1195  cptrMask.tfp = ones;
1196  if (release->has(ArmExtension::FEAT_SVE)) {
1197  cptrMask.tz = ones;
1198  cptrMask.zen = hcr.e2h ? ones : 0;
1199  }
1200  cptrMask.fpen = hcr.e2h ? ones : 0;
1201  newVal &= cptrMask;
1202  cptrMask = 0;
1203  cptrMask.res1_13_12_el2 = ones;
1204  cptrMask.res1_7_0_el2 = ones;
1205  if (!release->has(ArmExtension::FEAT_SVE)) {
1206  cptrMask.res1_8_el2 = ones;
1207  }
1208  cptrMask.res1_9_el2 = ones;
1209  newVal |= cptrMask;
1210  DPRINTF(MiscRegs, "Writing misc reg %s: %#x\n",
1211  miscRegName[idx], newVal);
1212  }
1213  break;
1214  case MISCREG_CPTR_EL3:
1215  {
1216  const uint32_t ones = (uint32_t)(-1);
1217  CPTR cptrMask = 0;
1218  cptrMask.tcpac = ones;
1219  cptrMask.tta = ones;
1220  cptrMask.tfp = ones;
1221  if (release->has(ArmExtension::FEAT_SVE)) {
1222  cptrMask.ez = ones;
1223  }
1224  newVal &= cptrMask;
1225  DPRINTF(MiscRegs, "Writing misc reg %s: %#x\n",
1226  miscRegName[idx], newVal);
1227  }
1228  break;
1229  case MISCREG_CSSELR:
1230  warn_once("The csselr register isn't implemented.\n");
1231  return;
1232 
1233  case MISCREG_DC_ZVA_Xt:
1234  warn("Calling DC ZVA! Not Implemeted! Expect WEIRD results\n");
1235  return;
1236 
1237  case MISCREG_FPSCR:
1238  {
1239  const uint32_t ones = (uint32_t)(-1);
1240  FPSCR fpscrMask = 0;
1241  fpscrMask.ioc = ones;
1242  fpscrMask.dzc = ones;
1243  fpscrMask.ofc = ones;
1244  fpscrMask.ufc = ones;
1245  fpscrMask.ixc = ones;
1246  fpscrMask.idc = ones;
1247  fpscrMask.ioe = ones;
1248  fpscrMask.dze = ones;
1249  fpscrMask.ofe = ones;
1250  fpscrMask.ufe = ones;
1251  fpscrMask.ixe = ones;
1252  fpscrMask.ide = ones;
1253  fpscrMask.len = ones;
1254  fpscrMask.fz16 = ones;
1255  fpscrMask.stride = ones;
1256  fpscrMask.rMode = ones;
1257  fpscrMask.fz = ones;
1258  fpscrMask.dn = ones;
1259  fpscrMask.ahp = ones;
1260  fpscrMask.qc = ones;
1261  fpscrMask.v = ones;
1262  fpscrMask.c = ones;
1263  fpscrMask.z = ones;
1264  fpscrMask.n = ones;
1265  newVal = (newVal & (uint32_t)fpscrMask) |
1267  ~(uint32_t)fpscrMask);
1268  tc->getDecoderPtr()->as<Decoder>().setContext(newVal);
1269  }
1270  break;
1271  case MISCREG_FPSR:
1272  {
1273  const uint32_t ones = (uint32_t)(-1);
1274  FPSCR fpscrMask = 0;
1275  fpscrMask.ioc = ones;
1276  fpscrMask.dzc = ones;
1277  fpscrMask.ofc = ones;
1278  fpscrMask.ufc = ones;
1279  fpscrMask.ixc = ones;
1280  fpscrMask.idc = ones;
1281  fpscrMask.qc = ones;
1282  fpscrMask.v = ones;
1283  fpscrMask.c = ones;
1284  fpscrMask.z = ones;
1285  fpscrMask.n = ones;
1286  newVal = (newVal & (uint32_t)fpscrMask) |
1288  ~(uint32_t)fpscrMask);
1289  idx = MISCREG_FPSCR;
1290  }
1291  break;
1292  case MISCREG_FPCR:
1293  {
1294  const uint32_t ones = (uint32_t)(-1);
1295  FPSCR fpscrMask = 0;
1296  fpscrMask.len = ones;
1297  fpscrMask.fz16 = ones;
1298  fpscrMask.stride = ones;
1299  fpscrMask.rMode = ones;
1300  fpscrMask.fz = ones;
1301  fpscrMask.dn = ones;
1302  fpscrMask.ahp = ones;
1303  newVal = (newVal & (uint32_t)fpscrMask) |
1305  ~(uint32_t)fpscrMask);
1306  idx = MISCREG_FPSCR;
1307  }
1308  break;
1309  case MISCREG_CPSR_Q:
1310  {
1311  assert(!(newVal & ~CpsrMaskQ));
1312  newVal = readMiscRegNoEffect(MISCREG_CPSR) | newVal;
1313  idx = MISCREG_CPSR;
1314  }
1315  break;
1316  case MISCREG_FPSCR_QC:
1317  {
1319  (newVal & FpscrQcMask);
1320  idx = MISCREG_FPSCR;
1321  }
1322  break;
1323  case MISCREG_FPSCR_EXC:
1324  {
1326  (newVal & FpscrExcMask);
1327  idx = MISCREG_FPSCR;
1328  }
1329  break;
1330  case MISCREG_FPEXC:
1331  {
1332  // vfpv3 architecture, section B.6.1 of DDI04068
1333  // bit 29 - valid only if fpexc[31] is 0
1334  const uint32_t fpexcMask = 0x60000000;
1335  newVal = (newVal & fpexcMask) |
1336  (readMiscRegNoEffect(MISCREG_FPEXC) & ~fpexcMask);
1337  }
1338  break;
1339  case MISCREG_HCR2:
1340  if (!release->has(ArmExtension::VIRTUALIZATION))
1341  return;
1342  break;
1343  case MISCREG_HCR:
1344  {
1345  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1346  selfDebug->setenableTDETGE((HCR)val, mdcr);
1347  if (!release->has(ArmExtension::VIRTUALIZATION))
1348  return;
1349  }
1350  break;
1351 
1352  case MISCREG_HDCR:
1353  {
1354  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1355  selfDebug->setenableTDETGE(hcr, (HDCR)val);
1356  }
1357  break;
1358  case MISCREG_DBGOSLAR:
1359  {
1360  OSL r = tc->readMiscReg(MISCREG_DBGOSLSR);
1361  const uint32_t temp = (val == 0xC5ACCE55)? 0x1 : 0x0;
1362  selfDebug->updateOSLock((RegVal) temp);
1363  r.oslk = bits(temp,0);
1365  }
1366  break;
1367  case MISCREG_DBGBCR0:
1368  selfDebug->updateDBGBCR(0, val);
1369  break;
1370  case MISCREG_DBGBCR1:
1371  selfDebug->updateDBGBCR(1, val);
1372  break;
1373  case MISCREG_DBGBCR2:
1374  selfDebug->updateDBGBCR(2, val);
1375  break;
1376  case MISCREG_DBGBCR3:
1377  selfDebug->updateDBGBCR(3, val);
1378  break;
1379  case MISCREG_DBGBCR4:
1380  selfDebug->updateDBGBCR(4, val);
1381  break;
1382  case MISCREG_DBGBCR5:
1383  selfDebug->updateDBGBCR(5, val);
1384  break;
1385  case MISCREG_DBGBCR6:
1386  selfDebug->updateDBGBCR(6, val);
1387  break;
1388  case MISCREG_DBGBCR7:
1389  selfDebug->updateDBGBCR(7, val);
1390  break;
1391  case MISCREG_DBGBCR8:
1392  selfDebug->updateDBGBCR(8, val);
1393  break;
1394  case MISCREG_DBGBCR9:
1395  selfDebug->updateDBGBCR(9, val);
1396  break;
1397  case MISCREG_DBGBCR10:
1398  selfDebug->updateDBGBCR(10, val);
1399  break;
1400  case MISCREG_DBGBCR11:
1401  selfDebug->updateDBGBCR(11, val);
1402  break;
1403  case MISCREG_DBGBCR12:
1404  selfDebug->updateDBGBCR(12, val);
1405  break;
1406  case MISCREG_DBGBCR13:
1407  selfDebug->updateDBGBCR(13, val);
1408  break;
1409  case MISCREG_DBGBCR14:
1410  selfDebug->updateDBGBCR(14, val);
1411  break;
1412  case MISCREG_DBGBCR15:
1413  selfDebug->updateDBGBCR(15, val);
1414  break;
1415  case MISCREG_DBGWCR0:
1416  selfDebug->updateDBGWCR(0, val);
1417  break;
1418  case MISCREG_DBGWCR1:
1419  selfDebug->updateDBGWCR(1, val);
1420  break;
1421  case MISCREG_DBGWCR2:
1422  selfDebug->updateDBGWCR(2, val);
1423  break;
1424  case MISCREG_DBGWCR3:
1425  selfDebug->updateDBGWCR(3, val);
1426  break;
1427  case MISCREG_DBGWCR4:
1428  selfDebug->updateDBGWCR(4, val);
1429  break;
1430  case MISCREG_DBGWCR5:
1431  selfDebug->updateDBGWCR(5, val);
1432  break;
1433  case MISCREG_DBGWCR6:
1434  selfDebug->updateDBGWCR(6, val);
1435  break;
1436  case MISCREG_DBGWCR7:
1437  selfDebug->updateDBGWCR(7, val);
1438  break;
1439  case MISCREG_DBGWCR8:
1440  selfDebug->updateDBGWCR(8, val);
1441  break;
1442  case MISCREG_DBGWCR9:
1443  selfDebug->updateDBGWCR(9, val);
1444  break;
1445  case MISCREG_DBGWCR10:
1446  selfDebug->updateDBGWCR(10, val);
1447  break;
1448  case MISCREG_DBGWCR11:
1449  selfDebug->updateDBGWCR(11, val);
1450  break;
1451  case MISCREG_DBGWCR12:
1452  selfDebug->updateDBGWCR(12, val);
1453  break;
1454  case MISCREG_DBGWCR13:
1455  selfDebug->updateDBGWCR(13, val);
1456  break;
1457  case MISCREG_DBGWCR14:
1458  selfDebug->updateDBGWCR(14, val);
1459  break;
1460  case MISCREG_DBGWCR15:
1461  selfDebug->updateDBGWCR(15, val);
1462  break;
1463 
1464  case MISCREG_MDCR_EL2:
1465  {
1466  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1467  selfDebug->setenableTDETGE(hcr, (HDCR)val);
1468  }
1469  break;
1470  case MISCREG_SDCR:
1471  case MISCREG_MDCR_EL3:
1472  {
1473  selfDebug->setbSDD(val);
1474  }
1475  break;
1476  case MISCREG_DBGDSCRext:
1477  {
1479  DBGDS32 r = tc->readMiscReg(MISCREG_DBGDSCRint);
1480  DBGDS32 v = val;
1481  r.moe = v.moe;
1482  r.udccdis = v.udccdis;
1483  r.mdbgen = v.mdbgen;
1486  }
1487 
1488  break;
1489  case MISCREG_MDSCR_EL1:
1490  {
1492  }
1493  break;
1494 
1495  case MISCREG_OSLAR_EL1:
1496  {
1499  r.oslk = bits(val, 0);
1500  r.oslm_3 = 1;
1502  }
1503  break;
1504 
1505  case MISCREG_DBGBCR0_EL1:
1506  selfDebug->updateDBGBCR(0, val);
1507  break;
1508  case MISCREG_DBGBCR1_EL1:
1509  selfDebug->updateDBGBCR(1, val);
1510  break;
1511  case MISCREG_DBGBCR2_EL1:
1512  selfDebug->updateDBGBCR(2, val);
1513  break;
1514  case MISCREG_DBGBCR3_EL1:
1515  selfDebug->updateDBGBCR(3, val);
1516  break;
1517  case MISCREG_DBGBCR4_EL1:
1518  selfDebug->updateDBGBCR(4, val);
1519  break;
1520  case MISCREG_DBGBCR5_EL1:
1521  selfDebug->updateDBGBCR(5, val);
1522  break;
1523  case MISCREG_DBGBCR6_EL1:
1524  selfDebug->updateDBGBCR(6, val);
1525  break;
1526  case MISCREG_DBGBCR7_EL1:
1527  selfDebug->updateDBGBCR(7, val);
1528  break;
1529  case MISCREG_DBGBCR8_EL1:
1530  selfDebug->updateDBGBCR(8, val);
1531  break;
1532  case MISCREG_DBGBCR9_EL1:
1533  selfDebug->updateDBGBCR(9, val);
1534  break;
1535  case MISCREG_DBGBCR10_EL1:
1536  selfDebug->updateDBGBCR(10, val);
1537  break;
1538  case MISCREG_DBGBCR11_EL1:
1539  selfDebug->updateDBGBCR(11, val);
1540  break;
1541  case MISCREG_DBGBCR12_EL1:
1542  selfDebug->updateDBGBCR(12, val);
1543  break;
1544  case MISCREG_DBGBCR13_EL1:
1545  selfDebug->updateDBGBCR(13, val);
1546  break;
1547  case MISCREG_DBGBCR14_EL1:
1548  selfDebug->updateDBGBCR(14, val);
1549  break;
1550  case MISCREG_DBGBCR15_EL1:
1551  selfDebug->updateDBGBCR(15, val);
1552  break;
1553  case MISCREG_DBGWCR0_EL1:
1554  selfDebug->updateDBGWCR(0, val);
1555  break;
1556  case MISCREG_DBGWCR1_EL1:
1557  selfDebug->updateDBGWCR(1, val);
1558  break;
1559  case MISCREG_DBGWCR2_EL1:
1560  selfDebug->updateDBGWCR(2, val);
1561  break;
1562  case MISCREG_DBGWCR3_EL1:
1563  selfDebug->updateDBGWCR(3, val);
1564  break;
1565  case MISCREG_DBGWCR4_EL1:
1566  selfDebug->updateDBGWCR(4, val);
1567  break;
1568  case MISCREG_DBGWCR5_EL1:
1569  selfDebug->updateDBGWCR(5, val);
1570  break;
1571  case MISCREG_DBGWCR6_EL1:
1572  selfDebug->updateDBGWCR(6, val);
1573  break;
1574  case MISCREG_DBGWCR7_EL1:
1575  selfDebug->updateDBGWCR(7, val);
1576  break;
1577  case MISCREG_DBGWCR8_EL1:
1578  selfDebug->updateDBGWCR(8, val);
1579  break;
1580  case MISCREG_DBGWCR9_EL1:
1581  selfDebug->updateDBGWCR(9, val);
1582  break;
1583  case MISCREG_DBGWCR10_EL1:
1584  selfDebug->updateDBGWCR(10, val);
1585  break;
1586  case MISCREG_DBGWCR11_EL1:
1587  selfDebug->updateDBGWCR(11, val);
1588  break;
1589  case MISCREG_DBGWCR12_EL1:
1590  selfDebug->updateDBGWCR(12, val);
1591  break;
1592  case MISCREG_DBGWCR13_EL1:
1593  selfDebug->updateDBGWCR(13, val);
1594  break;
1595  case MISCREG_DBGWCR14_EL1:
1596  selfDebug->updateDBGWCR(14, val);
1597  break;
1598  case MISCREG_DBGWCR15_EL1:
1599  selfDebug->updateDBGWCR(15, val);
1600  break;
1601  case MISCREG_IFSR:
1602  {
1603  // ARM ARM (ARM DDI 0406C.b) B4.1.96
1604  const uint32_t ifsrMask =
1605  mask(31, 13) | mask(11, 11) | mask(8, 6);
1606  newVal = newVal & ~ifsrMask;
1607  }
1608  break;
1609  case MISCREG_DFSR:
1610  {
1611  // ARM ARM (ARM DDI 0406C.b) B4.1.52
1612  const uint32_t dfsrMask = mask(31, 14) | mask(8, 8);
1613  newVal = newVal & ~dfsrMask;
1614  }
1615  break;
1616  case MISCREG_AMAIR0:
1617  case MISCREG_AMAIR1:
1618  {
1619  // ARM ARM (ARM DDI 0406C.b) B4.1.5
1620  // Valid only with LPAE
1621  if (!release->has(ArmExtension::LPAE))
1622  return;
1623  DPRINTF(MiscRegs, "Writing AMAIR: %#x\n", newVal);
1624  }
1625  break;
1626  case MISCREG_SCR:
1628  break;
1629  case MISCREG_SCTLR:
1630  {
1631  DPRINTF(MiscRegs, "Writing SCTLR: %#x\n", newVal);
1633 
1634  MiscRegIndex sctlr_idx;
1635  if (release->has(ArmExtension::SECURITY) &&
1636  !highestELIs64 && !scr.ns) {
1637  sctlr_idx = MISCREG_SCTLR_S;
1638  } else {
1639  sctlr_idx = MISCREG_SCTLR_NS;
1640  }
1641 
1642  SCTLR sctlr = miscRegs[sctlr_idx];
1643  SCTLR new_sctlr = newVal;
1644  new_sctlr.nmfi = ((bool)sctlr.nmfi) &&
1645  !release->has(ArmExtension::VIRTUALIZATION);
1646  miscRegs[sctlr_idx] = (RegVal)new_sctlr;
1648  }
1649  case MISCREG_MIDR:
1650  case MISCREG_ID_PFR0:
1651  case MISCREG_ID_PFR1:
1652  case MISCREG_ID_DFR0:
1653  case MISCREG_ID_MMFR0:
1654  case MISCREG_ID_MMFR1:
1655  case MISCREG_ID_MMFR2:
1656  case MISCREG_ID_MMFR3:
1657  case MISCREG_ID_MMFR4:
1658  case MISCREG_ID_ISAR0:
1659  case MISCREG_ID_ISAR1:
1660  case MISCREG_ID_ISAR2:
1661  case MISCREG_ID_ISAR3:
1662  case MISCREG_ID_ISAR4:
1663  case MISCREG_ID_ISAR5:
1664 
1665  case MISCREG_MPIDR:
1666  case MISCREG_FPSID:
1667  case MISCREG_TLBTR:
1668  case MISCREG_MVFR0:
1669  case MISCREG_MVFR1:
1670 
1682  // ID registers are constants.
1683  return;
1684 
1685  // TLB Invalidate All
1686  case MISCREG_ACTLR:
1687  warn("Not doing anything for write of miscreg ACTLR\n");
1688  break;
1689 
1693  case MISCREG_PMCR ... MISCREG_PMOVSSET:
1694  pmu->setMiscReg(idx, newVal);
1695  break;
1696 
1697 
1698  case MISCREG_HSTR: // TJDBX, now redifined to be RES0
1699  {
1700  HSTR hstrMask = 0;
1701  hstrMask.tjdbx = 1;
1702  newVal &= ~((uint32_t) hstrMask);
1703  break;
1704  }
1705  case MISCREG_HCPTR:
1706  {
1707  // If a CP bit in NSACR is 0 then the corresponding bit in
1708  // HCPTR is RAO/WI. Same applies to NSASEDIS
1709  secure_lookup = release->has(ArmExtension::SECURITY) &&
1710  isSecure(tc);
1711  if (!secure_lookup) {
1713  RegVal mask =
1714  (readMiscRegNoEffect(MISCREG_NSACR) ^ 0x7FFF) & 0xBFFF;
1715  newVal = (newVal & ~mask) | (oldValue & mask);
1716  }
1717  break;
1718  }
1719  case MISCREG_HDFAR: // alias for secure DFAR
1720  idx = MISCREG_DFAR_S;
1721  break;
1722  case MISCREG_HIFAR: // alias for secure IFAR
1723  idx = MISCREG_IFAR_S;
1724  break;
1725  case MISCREG_ATS1CPR:
1727  return;
1728  case MISCREG_ATS1CPW:
1730  return;
1731  case MISCREG_ATS1CUR:
1733  MMU::UserMode, val);
1734  return;
1735  case MISCREG_ATS1CUW:
1737  MMU::UserMode, val);
1738  return;
1739  case MISCREG_ATS12NSOPR:
1740  if (!release->has(ArmExtension::SECURITY))
1741  panic("Security Extensions required for ATS12NSOPR");
1743  return;
1744  case MISCREG_ATS12NSOPW:
1745  if (!release->has(ArmExtension::SECURITY))
1746  panic("Security Extensions required for ATS12NSOPW");
1748  return;
1749  case MISCREG_ATS12NSOUR:
1750  if (!release->has(ArmExtension::SECURITY))
1751  panic("Security Extensions required for ATS12NSOUR");
1753  MMU::UserMode, val);
1754  return;
1755  case MISCREG_ATS12NSOUW:
1756  if (!release->has(ArmExtension::SECURITY))
1757  panic("Security Extensions required for ATS12NSOUW");
1759  MMU::UserMode, val);
1760  return;
1761  case MISCREG_ATS1HR:
1763  return;
1764  case MISCREG_ATS1HW:
1766  return;
1767  case MISCREG_TTBCR:
1768  {
1769  TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR);
1770  const uint32_t ones = (uint32_t)(-1);
1771  TTBCR ttbcrMask = 0;
1772  TTBCR ttbcrNew = newVal;
1773 
1774  // ARM DDI 0406C.b, ARMv7-32
1775  ttbcrMask.n = ones; // T0SZ
1776  if (release->has(ArmExtension::SECURITY)) {
1777  ttbcrMask.pd0 = ones;
1778  ttbcrMask.pd1 = ones;
1779  }
1780  ttbcrMask.epd0 = ones;
1781  ttbcrMask.irgn0 = ones;
1782  ttbcrMask.orgn0 = ones;
1783  ttbcrMask.sh0 = ones;
1784  ttbcrMask.ps = ones; // T1SZ
1785  ttbcrMask.a1 = ones;
1786  ttbcrMask.epd1 = ones;
1787  ttbcrMask.irgn1 = ones;
1788  ttbcrMask.orgn1 = ones;
1789  ttbcrMask.sh1 = ones;
1790  if (release->has(ArmExtension::LPAE))
1791  ttbcrMask.eae = ones;
1792 
1793  if (release->has(ArmExtension::LPAE) && ttbcrNew.eae) {
1794  newVal = newVal & ttbcrMask;
1795  } else {
1796  newVal = (newVal & ttbcrMask) | (ttbcr & (~ttbcrMask));
1797  }
1798  // Invalidate TLB MiscReg
1800  break;
1801  }
1802  case MISCREG_TTBR0:
1803  case MISCREG_TTBR1:
1804  {
1805  TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR);
1806  if (release->has(ArmExtension::LPAE)) {
1807  if (ttbcr.eae) {
1808  // ARMv7 bit 63-56, 47-40 reserved, UNK/SBZP
1809  // ARMv8 AArch32 bit 63-56 only
1810  uint64_t ttbrMask = mask(63,56) | mask(47,40);
1811  newVal = (newVal & (~ttbrMask));
1812  }
1813  }
1814  // Invalidate TLB MiscReg
1816  break;
1817  }
1818  case MISCREG_SCTLR_EL1:
1819  case MISCREG_CONTEXTIDR:
1820  case MISCREG_PRRR:
1821  case MISCREG_NMRR:
1822  case MISCREG_MAIR0:
1823  case MISCREG_MAIR1:
1824  case MISCREG_DACR:
1825  case MISCREG_VTTBR:
1826  case MISCREG_SCR_EL3:
1827  case MISCREG_TCR_EL1:
1828  case MISCREG_TCR_EL2:
1829  case MISCREG_TCR_EL3:
1830  case MISCREG_VTCR_EL2:
1831  case MISCREG_SCTLR_EL2:
1832  case MISCREG_SCTLR_EL3:
1833  case MISCREG_HSCTLR:
1834  case MISCREG_TTBR0_EL1:
1835  case MISCREG_TTBR1_EL1:
1836  case MISCREG_TTBR0_EL2:
1837  case MISCREG_TTBR1_EL2:
1838  case MISCREG_TTBR0_EL3:
1840  break;
1841  case MISCREG_HCR_EL2:
1842  {
1843  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
1844  selfDebug->setenableTDETGE((HCR)val, mdcr);
1846  }
1847  break;
1848  case MISCREG_NZCV:
1849  {
1850  CPSR cpsr = val;
1851 
1852  tc->setReg(cc_reg::Nz, cpsr.nz);
1853  tc->setReg(cc_reg::C, cpsr.c);
1854  tc->setReg(cc_reg::V, cpsr.v);
1855  }
1856  break;
1857  case MISCREG_DAIF:
1858  {
1859  CPSR cpsr = miscRegs[MISCREG_CPSR];
1860  cpsr.daif = (uint8_t) ((CPSR) newVal).daif;
1861  newVal = cpsr;
1862  idx = MISCREG_CPSR;
1863  }
1864  break;
1865  case MISCREG_SP_EL0:
1866  tc->setReg(int_reg::Sp0, newVal);
1867  break;
1868  case MISCREG_SP_EL1:
1869  tc->setReg(int_reg::Sp1, newVal);
1870  break;
1871  case MISCREG_SP_EL2:
1872  tc->setReg(int_reg::Sp2, newVal);
1873  break;
1874  case MISCREG_SPSEL:
1875  {
1876  CPSR cpsr = miscRegs[MISCREG_CPSR];
1877  cpsr.sp = (uint8_t) ((CPSR) newVal).sp;
1878  newVal = cpsr;
1879  idx = MISCREG_CPSR;
1880  }
1881  break;
1882  case MISCREG_CURRENTEL:
1883  {
1884  CPSR cpsr = miscRegs[MISCREG_CPSR];
1885  cpsr.el = (uint8_t) ((CPSR) newVal).el;
1886  newVal = cpsr;
1887  idx = MISCREG_CPSR;
1888  }
1889  break;
1890  case MISCREG_PAN:
1891  {
1892  // PAN is affecting data accesses
1894 
1895  CPSR cpsr = miscRegs[MISCREG_CPSR];
1896  cpsr.pan = (uint8_t) ((CPSR) newVal).pan;
1897  newVal = cpsr;
1898  idx = MISCREG_CPSR;
1899  }
1900  break;
1901  case MISCREG_UAO:
1902  {
1903  // UAO is affecting data accesses
1905 
1906  CPSR cpsr = miscRegs[MISCREG_CPSR];
1907  cpsr.uao = (uint8_t) ((CPSR) newVal).uao;
1908  newVal = cpsr;
1909  idx = MISCREG_CPSR;
1910  }
1911  break;
1912  case MISCREG_AT_S1E1R_Xt:
1914  return;
1915  case MISCREG_AT_S1E1W_Xt:
1917  return;
1918  case MISCREG_AT_S1E0R_Xt:
1920  MMU::UserMode, val);
1921  return;
1922  case MISCREG_AT_S1E0W_Xt:
1924  MMU::UserMode, val);
1925  return;
1926  case MISCREG_AT_S1E2R_Xt:
1928  return;
1929  case MISCREG_AT_S1E2W_Xt:
1931  return;
1932  case MISCREG_AT_S12E1R_Xt:
1934  return;
1935  case MISCREG_AT_S12E1W_Xt:
1937  return;
1938  case MISCREG_AT_S12E0R_Xt:
1940  MMU::UserMode, val);
1941  return;
1942  case MISCREG_AT_S12E0W_Xt:
1944  MMU::UserMode, val);
1945  return;
1946  case MISCREG_AT_S1E3R_Xt:
1948  return;
1949  case MISCREG_AT_S1E3W_Xt:
1951  return;
1952  case MISCREG_L2CTLR:
1953  warn("miscreg L2CTLR (%s) written with %#x. ignored...\n",
1954  miscRegName[idx], uint32_t(val));
1955  break;
1956 
1957  // Generic Timer registers
1960  getGenericTimer().setMiscReg(idx, newVal);
1961  break;
1965  getGICv3CPUInterface().setMiscReg(idx, newVal);
1966  return;
1967  case MISCREG_ZCR_EL3:
1968  case MISCREG_ZCR_EL2:
1969  case MISCREG_ZCR_EL1:
1970  // Set the value here as we need to update the regs before
1971  // reading them back in getCurSveVecLenInBits to avoid
1972  // setting stale vector lengths in the decoder.
1973  setMiscRegNoEffect(idx, newVal);
1974  tc->getDecoderPtr()->as<Decoder>().setSveLen(
1975  (getCurSveVecLenInBits() >> 7) - 1);
1976  return;
1977  }
1978  setMiscRegNoEffect(idx, newVal);
1979  }
1980 }
1981 
1982 BaseISADevice &
1984 {
1985  // We only need to create an ISA interface the first time we try
1986  // to access the timer.
1987  if (timer)
1988  return *timer.get();
1989 
1990  assert(system);
1991  GenericTimer *generic_timer(system->getGenericTimer());
1992  if (!generic_timer) {
1993  panic("Trying to get a generic timer from a system that hasn't "
1994  "been configured to use a generic timer.\n");
1995  }
1996 
1997  timer.reset(new GenericTimerISA(*generic_timer, tc->contextId()));
1998  timer->setThreadContext(tc);
1999 
2000  return *timer.get();
2001 }
2002 
2003 BaseISADevice &
2005 {
2006  if (gicv3CpuInterface)
2007  return *gicv3CpuInterface.get();
2008 
2009  auto gicv3_ifc = getGICv3CPUInterface(tc);
2010  panic_if(!gicv3_ifc, "The system does not have a GICv3 irq controller\n");
2011  gicv3CpuInterface.reset(gicv3_ifc);
2012 
2013  return *gicv3CpuInterface.get();
2014 }
2015 
2018 {
2019  assert(system);
2020  Gicv3 *gicv3 = dynamic_cast<Gicv3 *>(system->getGIC());
2021  if (gicv3) {
2022  return gicv3->getCPUInterface(tc->contextId());
2023  } else {
2024  return nullptr;
2025  }
2026 }
2027 
2028 bool
2030 {
2031  if (!release->has(ArmExtension::SECURITY)) {
2032  return false;
2033  }
2034 
2035  SCR scr = miscRegs[MISCREG_SCR];
2036  CPSR cpsr = miscRegs[MISCREG_CPSR];
2037 
2038  switch ((OperatingMode) (uint8_t) cpsr.mode) {
2039  case MODE_MON:
2040  case MODE_EL3T:
2041  case MODE_EL3H:
2042  return true;
2043  case MODE_HYP:
2044  case MODE_EL2T:
2045  case MODE_EL2H:
2046  return false;
2047  default:
2048  return !scr.ns;
2049  }
2050 }
2051 
2054 {
2055  CPSR cpsr = readMiscRegNoEffect(MISCREG_CPSR);
2056 
2057  return opModeToEL((OperatingMode)(uint8_t)cpsr.mode);
2058 }
2059 
2060 unsigned
2062 {
2063  if (!FullSystem) {
2064  return sveVL * 128;
2065  }
2066 
2067  panic_if(!tc,
2068  "A ThreadContext is needed to determine the SVE vector length "
2069  "in full-system mode");
2070 
2071  CPSR cpsr = miscRegs[MISCREG_CPSR];
2072  ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsr.el;
2073 
2074  unsigned len = 0;
2075 
2076  if (el == EL1 || (el == EL0 && !ELIsInHost(tc, el))) {
2077  len = static_cast<ZCR>(miscRegs[MISCREG_ZCR_EL1]).len;
2078  }
2079 
2080  if (el == EL2 || (el == EL0 && ELIsInHost(tc, el))) {
2081  len = static_cast<ZCR>(miscRegs[MISCREG_ZCR_EL2]).len;
2082  } else if (release->has(ArmExtension::VIRTUALIZATION) && !isSecure(tc) &&
2083  (el == EL0 || el == EL1)) {
2084  len = std::min(
2085  len,
2086  static_cast<unsigned>(
2087  static_cast<ZCR>(miscRegs[MISCREG_ZCR_EL2]).len));
2088  }
2089 
2090  if (el == EL3) {
2091  len = static_cast<ZCR>(miscRegs[MISCREG_ZCR_EL3]).len;
2092  } else if (release->has(ArmExtension::SECURITY)) {
2093  len = std::min(
2094  len,
2095  static_cast<unsigned>(
2096  static_cast<ZCR>(miscRegs[MISCREG_ZCR_EL3]).len));
2097  }
2098 
2099  len = std::min(len, sveVL - 1);
2100 
2101  return (len + 1) * 128;
2102 }
2103 
2104 void
2106 {
2107  DPRINTF(Checkpoint, "Serializing Arm Misc Registers\n");
2109 }
2110 
2111 void
2113 {
2114  DPRINTF(Checkpoint, "Unserializing Arm Misc Registers\n");
2116  CPSR tmp_cpsr = miscRegs[MISCREG_CPSR];
2117  updateRegMap(tmp_cpsr);
2118 }
2119 
2120 void
2123 {
2124  // If we're in timing mode then doing the translation in
2125  // functional mode then we're slightly distorting performance
2126  // results obtained from simulations. The translation should be
2127  // done in the same mode the core is running in. NOTE: This
2128  // can't be an atomic translation because that causes problems
2129  // with unexpected atomic snoop requests.
2130  warn_once("Doing AT (address translation) in functional mode! Fix Me!\n");
2131 
2132  auto req = std::make_shared<Request>(
2134  tc->pcState().instAddr(), tc->contextId());
2135 
2137  req, tc, mode, tran_type);
2138 
2139  PAR par = 0;
2140  if (fault == NoFault) {
2141  Addr paddr = req->getPaddr();
2142  uint64_t attr = getMMUPtr(tc)->getAttr();
2143  uint64_t attr1 = attr >> 56;
2144  if (!attr1 || attr1 ==0x44) {
2145  attr |= 0x100;
2146  attr &= ~ uint64_t(0x80);
2147  }
2148  par = (paddr & mask(47, 12)) | attr;
2149  DPRINTF(MiscRegs,
2150  "MISCREG: Translated addr %#x: PAR_EL1: %#xx\n",
2151  val, par);
2152  } else {
2153  ArmFault *arm_fault = static_cast<ArmFault *>(fault.get());
2154  arm_fault->update(tc);
2155  // Set fault bit and FSR
2156  FSR fsr = arm_fault->getFsr(tc);
2157 
2158  par.f = 1; // F bit
2159  par.fst = fsr.status; // FST
2160  par.ptw = (arm_fault->iss() >> 7) & 0x1; // S1PTW
2161  par.s = arm_fault->isStage2() ? 1 : 0; // S
2162 
2163  DPRINTF(MiscRegs,
2164  "MISCREG: Translated addr %#x fault fsr %#x: PAR: %#x\n",
2165  val, fsr, par);
2166  }
2168  return;
2169 }
2170 
2171 void
2174 {
2175  // If we're in timing mode then doing the translation in
2176  // functional mode then we're slightly distorting performance
2177  // results obtained from simulations. The translation should be
2178  // done in the same mode the core is running in. NOTE: This
2179  // can't be an atomic translation because that causes problems
2180  // with unexpected atomic snoop requests.
2181  warn_once("Doing AT (address translation) in functional mode! Fix Me!\n");
2182 
2183  auto req = std::make_shared<Request>(
2185  tc->pcState().instAddr(), tc->contextId());
2186 
2188  req, tc, mode, tran_type);
2189 
2190  PAR par = 0;
2191  if (fault == NoFault) {
2192  Addr paddr = req->getPaddr();
2193  TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR);
2195 
2196  uint8_t max_paddr_bit = 0;
2197  if (release->has(ArmExtension::LPAE) &&
2198  (ttbcr.eae || tran_type & MMU::HypMode ||
2199  ((tran_type & MMU::S1S2NsTran) && hcr.vm) )) {
2200 
2201  max_paddr_bit = 39;
2202  } else {
2203  max_paddr_bit = 31;
2204  }
2205 
2206  par = (paddr & mask(max_paddr_bit, 12)) |
2207  (getMMUPtr(tc)->getAttr());
2208 
2209  DPRINTF(MiscRegs,
2210  "MISCREG: Translated addr 0x%08x: PAR: 0x%08x\n",
2211  val, par);
2212  } else {
2213  ArmFault *arm_fault = static_cast<ArmFault *>(fault.get());
2214  arm_fault->update(tc);
2215  // Set fault bit and FSR
2216  FSR fsr = arm_fault->getFsr(tc);
2217 
2218  par.f = 0x1; // F bit
2219  par.lpae = fsr.lpae;
2220  par.ptw = (arm_fault->iss() >> 7) & 0x1;
2221  par.s = arm_fault->isStage2() ? 1 : 0;
2222 
2223  if (par.lpae) {
2224  // LPAE - rearange fault status
2225  par.fst = fsr.status;
2226  } else {
2227  // VMSA - rearange fault status
2228  par.fs4_0 = fsr.fsLow | (fsr.fsHigh << 5);
2229  par.fs5 = fsr.ext;
2230  }
2231  DPRINTF(MiscRegs,
2232  "MISCREG: Translated addr 0x%08x fault fsr %#x: PAR: 0x%08x\n",
2233  val, fsr, par);
2234  }
2236  return;
2237 }
2238 
2239 template <class XC>
2240 static inline void
2242  Addr cacheBlockMask)
2243 {
2244  // Should only every see invalidations / direct writes
2245  assert(pkt->isInvalidate() || pkt->isWrite());
2246 
2247  DPRINTF(LLSC, "%s: handling snoop for address: %#x locked: %d\n",
2248  tc->getCpuPtr()->name(), pkt->getAddr(),
2249  xc->readMiscReg(MISCREG_LOCKFLAG));
2250  if (!xc->readMiscReg(MISCREG_LOCKFLAG))
2251  return;
2252 
2253  Addr locked_addr = xc->readMiscReg(MISCREG_LOCKADDR) & cacheBlockMask;
2254  // If no caches are attached, the snoop address always needs to be masked
2255  Addr snoop_addr = pkt->getAddr() & cacheBlockMask;
2256 
2257  DPRINTF(LLSC, "%s: handling snoop for address: %#x locked addr: %#x\n",
2258  tc->getCpuPtr()->name(), snoop_addr, locked_addr);
2259  if (locked_addr == snoop_addr) {
2260  DPRINTF(LLSC, "%s: address match, clearing lock and signaling sev\n",
2261  tc->getCpuPtr()->name());
2262  xc->setMiscReg(MISCREG_LOCKFLAG, false);
2263  // Implement ARMv8 WFE/SEV semantics
2264  sendEvent(tc);
2265  xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
2266  }
2267 }
2268 
2269 void
2271 {
2272  lockedSnoopHandler(tc, tc, pkt, cacheBlockMask);
2273 }
2274 
2275 void
2277 {
2278  lockedSnoopHandler(xc->tcBase(), xc, pkt, cacheBlockMask);
2279 }
2280 
2281 void
2283 {
2284  tc->setMiscReg(MISCREG_LOCKADDR, req->getPaddr());
2285  tc->setMiscReg(MISCREG_LOCKFLAG, true);
2286  DPRINTF(LLSC, "%s: Placing address %#x in monitor\n",
2287  tc->getCpuPtr()->name(), req->getPaddr());
2288 }
2289 
2290 void
2292 {
2293  xc->setMiscReg(MISCREG_LOCKADDR, req->getPaddr());
2294  xc->setMiscReg(MISCREG_LOCKFLAG, true);
2295  DPRINTF(LLSC, "%s: Placing address %#x in monitor\n",
2296  xc->tcBase()->getCpuPtr()->name(), req->getPaddr());
2297 }
2298 
2299 void
2301 {
2302  DPRINTF(LLSC, "%s: handling snoop lock hit address: %#x\n",
2304  tc->setMiscReg(MISCREG_LOCKFLAG, false);
2306 }
2307 
2308 void
2310 {
2311  DPRINTF(LLSC, "%s: handling snoop lock hit address: %#x\n",
2312  xc->tcBase()->getCpuPtr()->name(),
2314  xc->setMiscReg(MISCREG_LOCKFLAG, false);
2315  xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
2316 }
2317 
2318 template <class XC>
2319 static inline bool
2321  Addr cacheBlockMask)
2322 {
2323  if (req->isSwap())
2324  return true;
2325 
2326  DPRINTF(LLSC, "Handling locked write for address %#x in monitor.\n",
2327  req->getPaddr());
2328  // Verify that the lock flag is still set and the address
2329  // is correct
2330  bool lock_flag = xc->readMiscReg(MISCREG_LOCKFLAG);
2331  Addr lock_addr = xc->readMiscReg(MISCREG_LOCKADDR) & cacheBlockMask;
2332  if (!lock_flag || (req->getPaddr() & cacheBlockMask) != lock_addr) {
2333  // Lock flag not set or addr mismatch in CPU;
2334  // don't even bother sending to memory system
2335  req->setExtraData(0);
2336  xc->setMiscReg(MISCREG_LOCKFLAG, false);
2337  DPRINTF(LLSC, "clearing lock flag in handle locked write\n",
2338  tc->getCpuPtr()->name());
2339  // the rest of this code is not architectural;
2340  // it's just a debugging aid to help detect
2341  // livelock by warning on long sequences of failed
2342  // store conditionals
2343  int stCondFailures = xc->readStCondFailures();
2344  stCondFailures++;
2345  xc->setStCondFailures(stCondFailures);
2346  if (stCondFailures % 100000 == 0) {
2347  warn("context %d: %d consecutive "
2348  "store conditional failures\n",
2349  tc->contextId(), stCondFailures);
2350  }
2351 
2352  // store conditional failed already, so don't issue it to mem
2353  return false;
2354  }
2355  return true;
2356 }
2357 
2358 bool
2359 ISA::handleLockedWrite(const RequestPtr &req, Addr cacheBlockMask)
2360 {
2361  return lockedWriteHandler(tc, tc, req, cacheBlockMask);
2362 }
2363 
2364 bool
2366  Addr cacheBlockMask)
2367 {
2368  return lockedWriteHandler(xc->tcBase(), xc, req, cacheBlockMask);
2369 }
2370 
2371 void
2373 {
2374  // A spinlock would typically include a Wait For Event (WFE) to
2375  // conserve energy. The ARMv8 architecture specifies that an event
2376  // is automatically generated when clearing the exclusive monitor
2377  // to wake up the processor in WFE.
2378  DPRINTF(LLSC, "Clearing lock and signaling sev\n");
2379  tc->setMiscReg(MISCREG_LOCKFLAG, false);
2380  // Implement ARMv8 WFE/SEV semantics
2381  sendEvent(tc);
2383 }
2384 
2385 void
2387 {
2388  // A spinlock would typically include a Wait For Event (WFE) to
2389  // conserve energy. The ARMv8 architecture specifies that an event
2390  // is automatically generated when clearing the exclusive monitor
2391  // to wake up the processor in WFE.
2392  DPRINTF(LLSC, "Clearing lock and signaling sev\n");
2393  xc->setMiscReg(MISCREG_LOCKFLAG, false);
2394  // Implement ARMv8 WFE/SEV semantics
2395  sendEvent(xc->tcBase());
2396  xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
2397 }
2398 
2399 } // namespace ArmISA
2400 } // namespace gem5
ISA-specific types for hardware transactional memory.
#define DPRINTF(x,...)
Definition: trace.hh:186
virtual FSR getFsr(ThreadContext *tc) const
Definition: faults.hh:256
virtual uint32_t iss() const =0
void update(ThreadContext *tc)
Definition: faults.cc:428
virtual bool isStage2() const
Definition: faults.hh:255
Base class for devices that use the MiscReg interfaces.
Definition: isa_device.hh:62
virtual void setMiscReg(int misc_reg, RegVal val)=0
Write to a system register belonging to this device.
virtual void setISA(ISA *isa)
Definition: isa_device.cc:55
virtual void setThreadContext(ThreadContext *tc)
Definition: isa_device.hh:68
virtual RegVal readMiscReg(int misc_reg)=0
Read a system register belonging to this device.
bool inSecureState() const
Return true if the PE is in Secure state.
Definition: isa.cc:2029
void clear32(const ArmISAParams &p, const SCTLR &sctlr_rst)
Definition: isa.cc:222
unsigned getCurSveVecLenInBits() const
Definition: isa.cc:2061
std::pair< int, int > getMiscIndices(int misc_reg) const
Definition: isa.hh:334
ExceptionLevel currEL() const
Returns the current Exception Level (EL) of the ISA object.
Definition: isa.cc:2053
void takeOverFrom(ThreadContext *new_tc, ThreadContext *old_tc) override
Definition: isa.cc:534
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: isa.cc:2105
void copyRegsFrom(ThreadContext *src) override
Definition: isa.cc:541
void initID64(const ArmISAParams &p)
Definition: isa.cc:376
DummyISADevice dummyDevice
Dummy device for to handle non-existing ISA devices.
Definition: isa.hh:79
void setupThreadContext()
Definition: isa.cc:518
void setMiscRegNoEffect(RegIndex idx, RegVal val) override
Definition: isa.cc:1052
uint8_t physAddrRange
Definition: isa.hh:93
void addressTranslation64(MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val)
Definition: isa.cc:2121
bool haveLargeAsid64
Definition: isa.hh:92
void handleLockedSnoop(PacketPtr pkt, Addr cacheBlockMask) override
Definition: isa.cc:2270
void initID32(const ArmISAParams &p)
Definition: isa.cc:323
void clear() override
Definition: isa.cc:130
RegVal miscRegs[NUM_MISCREGS]
Definition: isa.hh:121
void clear64(const ArmISAParams &p)
Definition: isa.cc:274
BaseISADevice * pmu
Definition: isa.hh:82
std::unique_ptr< BaseISADevice > timer
Definition: isa.hh:85
bool handleLockedWrite(const RequestPtr &req, Addr cacheBlockMask) override
Definition: isa.cc:2359
SelfDebug * selfDebug
Definition: isa.hh:107
void globalClearExclusive() override
Definition: isa.cc:2372
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: isa.cc:2112
void updateRegMap(CPSR cpsr)
Definition: isa.hh:125
void startup() override
startup() is the final initialization call before simulation.
Definition: isa.cc:503
int redirectRegVHE(int misc_reg)
Returns the enconcing equivalent when VHE is implemented and HCR_EL2.E2H is enabled and executing at ...
Definition: isa.cc:577
BaseISADevice & getGICv3CPUInterface()
Definition: isa.cc:2004
ArmSystem * system
Definition: isa.hh:73
BaseISADevice & getGenericTimer()
Definition: isa.cc:1983
RegVal readMiscRegNoEffect(RegIndex idx) const override
Definition: isa.cc:723
void setMiscReg(RegIndex, RegVal val) override
Definition: isa.cc:1074
unsigned sveVL
SVE vector length in quadwords.
Definition: isa.hh:96
void handleLockedRead(const RequestPtr &req) override
Definition: isa.cc:2282
void addressTranslation(MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val)
Definition: isa.cc:2172
void initializeMiscRegMetadata()
Definition: misc.cc:2070
const ArmRelease * release
This could be either a FS or a SE release.
Definition: isa.hh:99
bool highestELIs64
Definition: isa.hh:91
RegVal readMiscReg(RegIndex idx) override
Definition: isa.cc:747
void handleLockedSnoopHit() override
Definition: isa.cc:2300
ISA(const Params &p)
Definition: isa.cc:81
std::unique_ptr< BaseISADevice > gicv3CpuInterface
Definition: isa.hh:88
void invalidateMiscReg()
Definition: mmu.cc:197
uint64_t getAttr() const
Definition: mmu.hh:369
TranslationGenPtr translateFunctional(Addr start, Addr size, ThreadContext *tc, Mode mode, Request::Flags flags) override
Returns a translation generator for a region of virtual addresses, instead of directly translating a ...
Definition: mmu.hh:91
void setenableTDETGE(HCR hcr, HDCR mdcr)
Definition: self_debug.hh:396
void init(ThreadContext *tc)
Definition: self_debug.cc:327
void updateOSLock(RegVal val)
Definition: self_debug.hh:402
void setMDSCRvals(RegVal val)
Definition: self_debug.hh:382
void updateDBGBCR(int index, DBGBCR val)
Definition: self_debug.hh:408
void setbSDD(RegVal val)
Definition: self_debug.hh:376
void updateDBGWCR(int index, DBGWCR val)
Definition: self_debug.hh:414
void setMDBGen(RegVal val)
Definition: self_debug.hh:390
void setDebugMask(bool mask)
Definition: self_debug.hh:420
bool has(ArmExtension ext) const
Definition: system.hh:76
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
Definition: system.hh:184
BaseGic * getGIC() const
Get a pointer to the system's GIC.
Definition: system.hh:177
ArmISA::ExceptionLevel highestEL() const
Returns the highest implemented exception level.
Definition: system.hh:188
uint8_t physAddrRange() const
Returns the supported physical address range in bits.
Definition: system.hh:214
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
Definition: system.hh:203
Addr resetAddr() const
Returns the reset address if the highest implemented exception level is 64 bits (ARMv8)
Definition: system.hh:199
GenericTimer * getGenericTimer() const
Get a pointer to the system's generic timer model.
Definition: system.hh:174
unsigned sveVL() const
Returns the SVE vector length at reset, in quadwords.
Definition: system.hh:206
const ArmRelease * releaseFS() const
Definition: system.hh:153
BaseInterrupts * getInterruptController(ThreadID tid)
Definition: base.hh:224
ThreadContext * tc
Definition: isa.hh:65
RegClasses _regClasses
Definition: isa.hh:67
CheckerCPU class.
Definition: cpu.hh:85
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:72
virtual RegVal readMiscReg(int misc_reg)=0
Reads a miscellaneous register, handling any architectural side effects due to reading that register.
virtual void setMiscReg(int misc_reg, RegVal val)=0
Sets a miscellaneous register, handling any architectural side effects due to writing that register.
virtual ThreadContext * tcBase() const =0
Returns a pointer to the ThreadContext.
Gicv3CPUInterface * getCPUInterface(int cpu_id) const
Definition: gic_v3.hh:178
Type & as()
Definition: decoder.hh:71
virtual std::string name() const
Definition: named.hh:47
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
Definition: pcstate.hh:107
Target & as()
Definition: pcstate.hh:72
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
Addr getAddr() const
Definition: packet.hh:805
bool isWrite() const
Definition: packet.hh:593
bool isInvalidate() const
Definition: packet.hh:608
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
Definition: request.hh:279
SimObjectParams Params
Definition: sim_object.hh:170
int size() const
Definition: system.hh:213
unsigned int cacheLineSize() const
Get the cache line size of the system.
Definition: system.hh:311
Threads threads
Definition: system.hh:313
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual void setHtmCheckpointPtr(BaseHTMCheckpointPtr cpt)=0
virtual void pcStateNoRecord(const PCStateBase &val)=0
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual RegVal getReg(const RegId &reg) const
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
virtual const PCStateBase & pcState() const =0
virtual System * getSystemPtr()=0
virtual CheckerCPU * getCheckerCpuPtr()=0
virtual void setReg(const RegId &reg, RegVal val)
virtual InstDecoder * getDecoderPtr()=0
virtual BaseCPU * getCpuPtr()=0
virtual int threadId() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
virtual ContextID contextId() const =0
virtual BaseMMU * getMMUPtr()=0
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition: vec_reg.hh:124
This module implements the global system counter and the local per-CPU architected timers as specifie...
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:76
constexpr T insertBits(T val, unsigned first, unsigned last, B bit_val)
Returns val with bits first to last set to the LSBs of bit_val.
Definition: bitfield.hh:166
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:204
virtual void startup()
startup() is the final initialization call before simulation.
Definition: sim_object.cc:99
const Params & params() const
Definition: sim_object.hh:176
uint8_t flags
Definition: helpers.cc:66
#define warn(...)
Definition: logging.hh:246
#define warn_once(...)
Definition: logging.hh:250
constexpr RegId V
Definition: cc.hh:75
constexpr RegId C
Definition: cc.hh:74
constexpr RegId Nz
Definition: cc.hh:73
constexpr RegId Sp2
Definition: int.hh:235
constexpr RegId Sp0
Definition: int.hh:233
constexpr RegId Sp1
Definition: int.hh:234
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:275
Bitfield< 28 > v
Definition: misc_types.hh:54
constexpr RegClass flatIntRegClass
Definition: int.hh:178
MMU * getMMUPtr(T *tc)
Definition: mmu.hh:516
static const uint32_t FpscrQcMask
Definition: misc.hh:2751
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
Definition: utility.cc:1304
bool ELIsInHost(ThreadContext *tc, ExceptionLevel el)
Returns true if the current exception level el is executing a Host OS or an application of a Host OS ...
Definition: utility.cc:283
Bitfield< 3, 0 > mask
Definition: pcstate.hh:63
constexpr RegClass ccRegClass(CCRegClass, CCRegClassName, cc_reg::NumRegs, debug::CCRegs)
Bitfield< 4, 0 > mode
Definition: misc_types.hh:74
bool isSecure(ThreadContext *tc)
Definition: utility.cc:74
Bitfield< 22 > pan
Definition: misc_types.hh:59
static const uint32_t FpscrExcMask
Definition: misc.hh:2755
Bitfield< 7 > i
Definition: misc_types.hh:67
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
Definition: utility.cc:65
constexpr RegClass vecElemClass
Definition: vec.hh:105
static const uint32_t CpsrMaskQ
Definition: misc.hh:2734
void preUnflattenMiscReg()
Definition: misc.cc:706
constexpr RegClass vecPredRegClass
Definition: vec.hh:109
MiscRegIndex
Definition: misc.hh:64
@ MISCREG_NSACR
Definition: misc.hh:250
@ MISCREG_ID_AA64PFR0_EL1
Definition: misc.hh:566
@ MISCREG_DBGWCR5
Definition: misc.hh:164
@ MISCREG_DBGBCR15
Definition: misc.hh:142
@ MISCREG_DBGOSLSR
Definition: misc.hh:193
@ MISCREG_TTBR1_EL12
Definition: misc.hh:605
@ MISCREG_CNTV_CTL_EL0
Definition: misc.hh:764
@ MISCREG_DBGWCR8
Definition: misc.hh:167
@ MISCREG_HCR
Definition: misc.hh:253
@ MISCREG_NMRR_NS
Definition: misc.hh:381
@ MISCREG_HDFAR
Definition: misc.hh:294
@ MISCREG_MPIDR_EL1
Definition: misc.hh:545
@ MISCREG_ATS1HR
Definition: misc.hh:324
@ MISCREG_SCTLR_EL2
Definition: misc.hh:589
@ MISCREG_ID_DFR0_EL1
Definition: misc.hh:549
@ MISCREG_CNTV_CVAL_EL02
Definition: misc.hh:771
@ MISCREG_CNTP_CTL_EL0
Definition: misc.hh:761
@ MISCREG_PMOVSSET
Definition: misc.hh:371
@ MISCREG_FPEXC
Definition: misc.hh:79
@ MISCREG_DBGWCR1
Definition: misc.hh:160
@ MISCREG_CNTP_CTL_EL02
Definition: misc.hh:767
@ MISCREG_SPSEL
Definition: misc.hh:622
@ MISCREG_TCR_EL2
Definition: misc.hh:609
@ MISCREG_AT_S1E1W_Xt
Definition: misc.hh:665
@ MISCREG_DBGWCR5_EL1
Definition: misc.hh:516
@ MISCREG_DBGDSCRint
Definition: misc.hh:101
@ MISCREG_MVFR1
Definition: misc.hh:77
@ MISCREG_MIDR_EL1
Definition: misc.hh:544
@ MISCREG_DBGWCR12_EL1
Definition: misc.hh:523
@ MISCREG_ZCR_EL2
Definition: misc.hh:1061
@ MISCREG_ICC_IGRPEN1_EL3
Definition: misc.hh:887
@ MISCREG_ID_AA64ZFR0_EL1
Definition: misc.hh:1059
@ MISCREG_CNTFRQ
Definition: misc.hh:418
@ MISCREG_AFSR1_EL12
Definition: misc.hh:643
@ MISCREG_CPSR_Q
Definition: misc.hh:83
@ MISCREG_MAIR_EL1
Definition: misc.hh:731
@ MISCREG_DBGBCR2_EL1
Definition: misc.hh:481
@ MISCREG_ICC_PMR_EL1
Definition: misc.hh:842
@ MISCREG_CONTEXTIDR_EL1
Definition: misc.hh:750
@ MISCREG_CNTV_TVAL
Definition: misc.hh:432
@ MISCREG_DBGWCR10
Definition: misc.hh:169
@ MISCREG_HCPTR
Definition: misc.hh:256
@ MISCREG_SPSR_EL2
Definition: misc.hh:630
@ NUM_MISCREGS
Definition: misc.hh:1100
@ MISCREG_ID_MMFR1
Definition: misc.hh:221
@ MISCREG_AT_S1E2W_Xt
Definition: misc.hh:676
@ MISCREG_LOCKFLAG
Definition: misc.hh:87
@ MISCREG_ICH_LR15_EL2
Definition: misc.hh:919
@ MISCREG_FPSID
Definition: misc.hh:75
@ MISCREG_DBGWCR6_EL1
Definition: misc.hh:517
@ MISCREG_MAIR_EL12
Definition: misc.hh:732
@ MISCREG_SCTLR
Definition: misc.hh:240
@ MISCREG_PAR_EL1
Definition: misc.hh:660
@ MISCREG_TTBCR
Definition: misc.hh:265
@ MISCREG_AT_S12E1W_Xt
Definition: misc.hh:678
@ MISCREG_SCTLR_RST
Definition: misc.hh:95
@ MISCREG_ATS12NSOUW
Definition: misc.hh:316
@ MISCREG_MAIR_EL2
Definition: misc.hh:735
@ MISCREG_CNTV_CVAL
Definition: misc.hh:431
@ MISCREG_CSSELR
Definition: misc.hh:235
@ MISCREG_CPACR
Definition: misc.hh:246
@ MISCREG_SCR_EL3
Definition: misc.hh:598
@ MISCREG_CNTKCTL_EL12
Definition: misc.hh:774
@ MISCREG_ID_AA64DFR0_EL1
Definition: misc.hh:568
@ MISCREG_ID_ISAR6
Definition: misc.hh:231
@ MISCREG_DBGOSLAR
Definition: misc.hh:192
@ MISCREG_DBGBCR10
Definition: misc.hh:137
@ MISCREG_DBGDSCRext
Definition: misc.hh:108
@ MISCREG_TCR_EL3
Definition: misc.hh:615
@ MISCREG_FPSR
Definition: misc.hh:627
@ MISCREG_UAO
Definition: misc.hh:1097
@ MISCREG_DBGDIDR
Definition: misc.hh:100
@ MISCREG_CPACR_EL12
Definition: misc.hh:588
@ MISCREG_HDCR
Definition: misc.hh:255
@ MISCREG_ESR_EL1
Definition: misc.hh:644
@ MISCREG_CNTP_TVAL
Definition: misc.hh:427
@ MISCREG_AT_S12E0W_Xt
Definition: misc.hh:680
@ MISCREG_TCR_EL1
Definition: misc.hh:606
@ MISCREG_TTBCR_NS
Definition: misc.hh:266
@ MISCREG_DBGBCR13_EL1
Definition: misc.hh:492
@ MISCREG_VMPIDR
Definition: misc.hh:239
@ MISCREG_CNTVCT
Definition: misc.hh:420
@ MISCREG_ESR_EL12
Definition: misc.hh:645
@ MISCREG_DBGWCR8_EL1
Definition: misc.hh:519
@ MISCREG_AFSR0_EL1
Definition: misc.hh:640
@ MISCREG_TCMTR
Definition: misc.hh:212
@ MISCREG_DBGWCR13_EL1
Definition: misc.hh:524
@ MISCREG_DBGWCR11_EL1
Definition: misc.hh:522
@ MISCREG_ID_ISAR5
Definition: misc.hh:230
@ MISCREG_ATS1CUR
Definition: misc.hh:311
@ MISCREG_DBGWCR2
Definition: misc.hh:161
@ MISCREG_OSLAR_EL1
Definition: misc.hh:533
@ MISCREG_CNTPCT_EL0
Definition: misc.hh:759
@ MISCREG_DBGWCR4_EL1
Definition: misc.hh:515
@ MISCREG_DBGBCR14_EL1
Definition: misc.hh:493
@ MISCREG_AFSR1_EL2
Definition: misc.hh:648
@ MISCREG_CNTV_CTL_EL02
Definition: misc.hh:770
@ MISCREG_DBGBCR0_EL1
Definition: misc.hh:479
@ MISCREG_DBGBCR6_EL1
Definition: misc.hh:485
@ MISCREG_ID_ISAR4
Definition: misc.hh:229
@ MISCREG_DBGBCR3_EL1
Definition: misc.hh:482
@ MISCREG_SCTLR_EL1
Definition: misc.hh:584
@ MISCREG_CNTP_TVAL_EL02
Definition: misc.hh:769
@ MISCREG_PRRR
Definition: misc.hh:374
@ MISCREG_CPTR_EL2
Definition: misc.hh:593
@ MISCREG_DBGBCR8_EL1
Definition: misc.hh:487
@ MISCREG_CCSIDR
Definition: misc.hh:232
@ MISCREG_FAR_EL1
Definition: misc.hh:654
@ MISCREG_DBGWCR0
Definition: misc.hh:159
@ MISCREG_AT_S1E2R_Xt
Definition: misc.hh:675
@ MISCREG_PMCR
Definition: misc.hh:356
@ MISCREG_CNTHV_CTL_EL2
Definition: misc.hh:786
@ MISCREG_CNTV_CTL
Definition: misc.hh:430
@ MISCREG_ID_AA64DFR1_EL1
Definition: misc.hh:569
@ MISCREG_JMCR
Definition: misc.hh:207
@ MISCREG_ID_AA64ISAR1_EL1
Definition: misc.hh:573
@ MISCREG_ELR_EL12
Definition: misc.hh:620
@ MISCREG_PMEVCNTR0_EL0
Definition: misc.hh:795
@ MISCREG_VBAR_EL12
Definition: misc.hh:742
@ MISCREG_ID_AA64MMFR1_EL1
Definition: misc.hh:575
@ MISCREG_TTBR0_EL12
Definition: misc.hh:603
@ MISCREG_ATS12NSOUR
Definition: misc.hh:315
@ MISCREG_DBGWCR10_EL1
Definition: misc.hh:521
@ MISCREG_CNTVCT_EL0
Definition: misc.hh:760
@ MISCREG_RVBAR_EL2
Definition: misc.hh:746
@ MISCREG_SP_EL0
Definition: misc.hh:621
@ MISCREG_DFAR_S
Definition: misc.hh:290
@ MISCREG_DBGBCR4_EL1
Definition: misc.hh:483
@ MISCREG_CPSR
Definition: misc.hh:65
@ MISCREG_FPCR
Definition: misc.hh:626
@ MISCREG_SDCR
Definition: misc.hh:247
@ MISCREG_DBGWCR4
Definition: misc.hh:163
@ MISCREG_CPACR_EL1
Definition: misc.hh:587
@ MISCREG_ID_MMFR0
Definition: misc.hh:220
@ MISCREG_PMEVTYPER5_EL0
Definition: misc.hh:806
@ MISCREG_CNTP_CVAL
Definition: misc.hh:424
@ MISCREG_ID_ISAR0
Definition: misc.hh:225
@ MISCREG_CNTKCTL_EL1
Definition: misc.hh:773
@ MISCREG_SP_EL2
Definition: misc.hh:639
@ MISCREG_NMRR
Definition: misc.hh:380
@ MISCREG_SCTLR_EL12
Definition: misc.hh:585
@ MISCREG_TTBR1_EL1
Definition: misc.hh:604
@ MISCREG_MAIR1
Definition: misc.hh:383
@ MISCREG_DAIF
Definition: misc.hh:625
@ MISCREG_SEV_MAILBOX
Definition: misc.hh:96
@ MISCREG_SPSR_EL12
Definition: misc.hh:618
@ MISCREG_CNTP_CVAL_EL02
Definition: misc.hh:768
@ MISCREG_PMINTENSET_EL1
Definition: misc.hh:715
@ MISCREG_CNTHPS_CVAL_EL2
Definition: misc.hh:783
@ MISCREG_REVIDR
Definition: misc.hh:215
@ MISCREG_DBGBCR9
Definition: misc.hh:136
@ MISCREG_DBGBCR11_EL1
Definition: misc.hh:490
@ MISCREG_DBGBCR1_EL1
Definition: misc.hh:480
@ MISCREG_DBGBCR14
Definition: misc.hh:141
@ MISCREG_DBGBCR11
Definition: misc.hh:138
@ MISCREG_ID_MMFR3
Definition: misc.hh:223
@ MISCREG_DBGBCR12
Definition: misc.hh:139
@ MISCREG_ICH_LRC15
Definition: misc.hh:1056
@ MISCREG_RVBAR_EL1
Definition: misc.hh:743
@ MISCREG_ISR
Definition: misc.hh:401
@ MISCREG_DBGWCR7_EL1
Definition: misc.hh:518
@ MISCREG_CONTEXTIDR
Definition: misc.hh:404
@ MISCREG_CNTHPS_TVAL_EL2
Definition: misc.hh:784
@ MISCREG_SCR
Definition: misc.hh:248
@ MISCREG_ELR_EL2
Definition: misc.hh:631
@ MISCREG_CONTEXTIDR_EL2
Definition: misc.hh:822
@ MISCREG_TCR_EL12
Definition: misc.hh:607
@ MISCREG_CNTHCTL_EL2
Definition: misc.hh:778
@ MISCREG_MDSCR_EL1
Definition: misc.hh:460
@ MISCREG_DBGWCR2_EL1
Definition: misc.hh:513
@ MISCREG_DBGBCR12_EL1
Definition: misc.hh:491
@ MISCREG_ID_DFR0
Definition: misc.hh:218
@ MISCREG_TTBR1_EL2
Definition: misc.hh:825
@ MISCREG_ID_AA64MMFR0_EL1
Definition: misc.hh:574
@ MISCREG_PAN
Definition: misc.hh:1096
@ MISCREG_DBGWCR9
Definition: misc.hh:168
@ MISCREG_AT_S1E1R_Xt
Definition: misc.hh:664
@ MISCREG_AMAIR_EL1
Definition: misc.hh:733
@ MISCREG_ATS1HW
Definition: misc.hh:325
@ MISCREG_VBAR_S
Definition: misc.hh:398
@ MISCREG_AT_S1E3R_Xt
Definition: misc.hh:681
@ MISCREG_DC_ZVA_Xt
Definition: misc.hh:670
@ MISCREG_CNTHVS_TVAL_EL2
Definition: misc.hh:791
@ MISCREG_ATS1CPR
Definition: misc.hh:309
@ MISCREG_NZCV
Definition: misc.hh:624
@ MISCREG_SPSR_EL1
Definition: misc.hh:617
@ MISCREG_FAR_EL12
Definition: misc.hh:655
@ MISCREG_CNTP_CVAL_EL0
Definition: misc.hh:762
@ MISCREG_HCR_EL2
Definition: misc.hh:591
@ MISCREG_CNTHVS_CVAL_EL2
Definition: misc.hh:790
@ MISCREG_ATS1CPW
Definition: misc.hh:310
@ MISCREG_TTBR1
Definition: misc.hh:262
@ MISCREG_AT_S12E0R_Xt
Definition: misc.hh:679
@ MISCREG_MPIDR
Definition: misc.hh:214
@ MISCREG_PRRR_NS
Definition: misc.hh:375
@ MISCREG_ZCR_EL1
Definition: misc.hh:1063
@ MISCREG_ID_AA64MMFR2_EL1
Definition: misc.hh:827
@ MISCREG_VTCR_EL2
Definition: misc.hh:611
@ MISCREG_DBGWCR3
Definition: misc.hh:162
@ MISCREG_DBGWCR11
Definition: misc.hh:170
@ MISCREG_VTTBR
Definition: misc.hh:453
@ MISCREG_CNTVOFF_EL2
Definition: misc.hh:793
@ MISCREG_DBGWCR6
Definition: misc.hh:165
@ MISCREG_VPIDR
Definition: misc.hh:238
@ MISCREG_DBGWCR15
Definition: misc.hh:174
@ MISCREG_CNTHPS_CTL_EL2
Definition: misc.hh:782
@ MISCREG_DBGWCR9_EL1
Definition: misc.hh:520
@ MISCREG_VBAR_EL2
Definition: misc.hh:745
@ MISCREG_DBGBCR7_EL1
Definition: misc.hh:486
@ MISCREG_DBGWCR14
Definition: misc.hh:173
@ MISCREG_DBGBCR5_EL1
Definition: misc.hh:484
@ MISCREG_CTR
Definition: misc.hh:211
@ MISCREG_CLIDR
Definition: misc.hh:233
@ MISCREG_SCTLR_S
Definition: misc.hh:242
@ MISCREG_MDCR_EL2
Definition: misc.hh:592
@ MISCREG_IFSR
Definition: misc.hh:276
@ MISCREG_AMAIR1
Definition: misc.hh:389
@ MISCREG_CNTHV_TVAL_EL2
Definition: misc.hh:788
@ MISCREG_VBAR_EL1
Definition: misc.hh:741
@ MISCREG_MIDR
Definition: misc.hh:210
@ MISCREG_AMAIR_EL2
Definition: misc.hh:736
@ MISCREG_JIDR
Definition: misc.hh:204
@ MISCREG_L2CTLR
Definition: misc.hh:372
@ MISCREG_CNTP_CTL
Definition: misc.hh:421
@ MISCREG_TTBR0_EL3
Definition: misc.hh:614
@ MISCREG_DBGWCR0_EL1
Definition: misc.hh:511
@ MISCREG_DCZID_EL0
Definition: misc.hh:581
@ MISCREG_ATS12NSOPW
Definition: misc.hh:314
@ MISCREG_ISR_EL1
Definition: misc.hh:744
@ MISCREG_DBGBCR4
Definition: misc.hh:131
@ MISCREG_CNTVOFF
Definition: misc.hh:438
@ MISCREG_AT_S1E0W_Xt
Definition: misc.hh:667
@ MISCREG_AT_S12E1R_Xt
Definition: misc.hh:677
@ MISCREG_TLBTR
Definition: misc.hh:213
@ MISCREG_ID_AA64AFR1_EL1
Definition: misc.hh:571
@ MISCREG_DBGWCR12
Definition: misc.hh:171
@ MISCREG_AFSR0_EL12
Definition: misc.hh:641
@ MISCREG_ELR_EL1
Definition: misc.hh:619
@ MISCREG_AMAIR_EL12
Definition: misc.hh:734
@ NUM_PHYS_MISCREGS
Definition: misc.hh:1070
@ MISCREG_DBGWCR15_EL1
Definition: misc.hh:526
@ MISCREG_ID_PFR1
Definition: misc.hh:217
@ MISCREG_CNTHP_CVAL_EL2
Definition: misc.hh:780
@ MISCREG_CNTV_TVAL_EL0
Definition: misc.hh:766
@ MISCREG_ZCR_EL3
Definition: misc.hh:1060
@ MISCREG_DBGBCR2
Definition: misc.hh:129
@ MISCREG_DBGWCR14_EL1
Definition: misc.hh:525
@ MISCREG_FPSCR
Definition: misc.hh:76
@ MISCREG_TTBR0
Definition: misc.hh:259
@ MISCREG_DACR
Definition: misc.hh:270
@ MISCREG_TTBR0_EL2
Definition: misc.hh:608
@ MISCREG_HSCTLR
Definition: misc.hh:251
@ MISCREG_SCTLR_NS
Definition: misc.hh:241
@ MISCREG_ICC_AP0R0
Definition: misc.hh:964
@ MISCREG_TTBR0_EL1
Definition: misc.hh:602
@ MISCREG_JOSCR
Definition: misc.hh:206
@ MISCREG_SCTLR_EL3
Definition: misc.hh:596
@ MISCREG_CNTP_TVAL_EL0
Definition: misc.hh:763
@ MISCREG_FPSCR_QC
Definition: misc.hh:85
@ MISCREG_CURRENTEL
Definition: misc.hh:623
@ MISCREG_ICH_AP0R0_EL2
Definition: misc.hh:890
@ MISCREG_ID_ISAR1
Definition: misc.hh:226
@ MISCREG_DBGBCR0
Definition: misc.hh:127
@ MISCREG_ID_AA64AFR0_EL1
Definition: misc.hh:570
@ MISCREG_ATS12NSOPR
Definition: misc.hh:313
@ MISCREG_DBGBCR3
Definition: misc.hh:130
@ MISCREG_OSLSR_EL1
Definition: misc.hh:534
@ MISCREG_DBGBCR9_EL1
Definition: misc.hh:488
@ MISCREG_AIDR
Definition: misc.hh:234
@ MISCREG_DFSR
Definition: misc.hh:273
@ MISCREG_DBGBCR15_EL1
Definition: misc.hh:494
@ MISCREG_MVFR0
Definition: misc.hh:78
@ MISCREG_ID_AA64ISAR0_EL1
Definition: misc.hh:572
@ MISCREG_HIFAR
Definition: misc.hh:295
@ MISCREG_CNTHP_TVAL_EL2
Definition: misc.hh:781
@ MISCREG_AT_S1E3W_Xt
Definition: misc.hh:682
@ MISCREG_DBGWCR1_EL1
Definition: misc.hh:512
@ MISCREG_ID_MMFR2
Definition: misc.hh:222
@ MISCREG_VMPIDR_EL2
Definition: misc.hh:583
@ MISCREG_DBGBCR8
Definition: misc.hh:135
@ MISCREG_AMAIR0
Definition: misc.hh:386
@ MISCREG_DBGWCR3_EL1
Definition: misc.hh:514
@ MISCREG_DBGBCR5
Definition: misc.hh:132
@ MISCREG_HCR2
Definition: misc.hh:254
@ MISCREG_FAR_EL2
Definition: misc.hh:656
@ MISCREG_CNTHVS_CTL_EL2
Definition: misc.hh:789
@ MISCREG_DBGBCR7
Definition: misc.hh:134
@ MISCREG_FPSCR_EXC
Definition: misc.hh:84
@ MISCREG_CNTV_TVAL_EL02
Definition: misc.hh:772
@ MISCREG_RVBAR_EL3
Definition: misc.hh:748
@ MISCREG_DBGBCR10_EL1
Definition: misc.hh:489
@ MISCREG_AT_S1E0R_Xt
Definition: misc.hh:666
@ MISCREG_ID_ISAR3
Definition: misc.hh:228
@ MISCREG_CNTHP_CTL_EL2
Definition: misc.hh:779
@ MISCREG_MVBAR
Definition: misc.hh:399
@ MISCREG_DBGBCR6
Definition: misc.hh:133
@ MISCREG_PAR
Definition: misc.hh:299
@ MISCREG_CONTEXTIDR_EL12
Definition: misc.hh:751
@ MISCREG_CPTR_EL3
Definition: misc.hh:600
@ MISCREG_ESR_EL2
Definition: misc.hh:649
@ MISCREG_ID_PFR0
Definition: misc.hh:216
@ MISCREG_IFAR_S
Definition: misc.hh:293
@ MISCREG_ID_MMFR4
Definition: misc.hh:224
@ MISCREG_AFSR1_EL1
Definition: misc.hh:642
@ MISCREG_CNTHV_CVAL_EL2
Definition: misc.hh:787
@ MISCREG_LOCKADDR
Definition: misc.hh:86
@ MISCREG_CTR_EL0
Definition: misc.hh:580
@ MISCREG_CNTFRQ_EL0
Definition: misc.hh:758
@ MISCREG_ID_AFR0
Definition: misc.hh:219
@ MISCREG_DBGBCR1
Definition: misc.hh:128
@ MISCREG_DBGBCR13
Definition: misc.hh:140
@ MISCREG_ACTLR
Definition: misc.hh:243
@ MISCREG_DBGWCR7
Definition: misc.hh:166
@ MISCREG_PMXEVTYPER_PMCCFILTR
Definition: misc.hh:94
@ MISCREG_ID_AA64PFR1_EL1
Definition: misc.hh:567
@ MISCREG_HSTR
Definition: misc.hh:257
@ MISCREG_MDCR_EL3
Definition: misc.hh:601
@ MISCREG_AFSR0_EL2
Definition: misc.hh:647
@ MISCREG_ID_ISAR2
Definition: misc.hh:227
@ MISCREG_CNTV_CVAL_EL0
Definition: misc.hh:765
@ MISCREG_ZCR_EL12
Definition: misc.hh:1062
@ MISCREG_DBGWCR13
Definition: misc.hh:172
@ MISCREG_SP_EL1
Definition: misc.hh:632
@ MISCREG_ATS1CUW
Definition: misc.hh:312
@ MISCREG_MAIR0
Definition: misc.hh:377
@ MISCREG_PMOVSSET_EL0
Definition: misc.hh:730
Bitfield< 9, 6 > daif
Definition: misc_types.hh:70
Bitfield< 3, 2 > el
Definition: misc_types.hh:73
@ MISCREG_WARN_NOT_FAIL
Definition: misc.hh:1108
@ MISCREG_IMPLEMENTED
Definition: misc.hh:1105
Bitfield< 18, 16 > len
Definition: misc_types.hh:451
int unflattenMiscReg(int reg)
Definition: misc.cc:722
Bitfield< 0 > sp
Definition: misc_types.hh:75
static bool lockedWriteHandler(ThreadContext *tc, XC *xc, const RequestPtr &req, Addr cacheBlockMask)
Definition: isa.cc:2320
static ExceptionLevel opModeToEL(OperatingMode mode)
Definition: types.hh:390
constexpr RegClass miscRegClass
Definition: misc.hh:2726
const char *const miscRegName[]
Definition: misc.hh:1697
RegVal readMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
This helper function is either returing the value of MPIDR_EL1 (by calling getMPIDR),...
Definition: utility.cc:138
static void lockedSnoopHandler(ThreadContext *tc, XC *xc, PacketPtr pkt, Addr cacheBlockMask)
Definition: isa.cc:2241
std::vector< struct MiscRegLUTEntry > lookUpMiscReg(NUM_MISCREGS)
Definition: misc.hh:1576
Bitfield< 23 > uao
Definition: misc_types.hh:58
constexpr RegClass vecRegClass
Definition: vec.hh:101
Bitfield< 4 > pc
Bitfield< 5 > r
Definition: pagetable.hh:60
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 5, 3 > reg
Definition: types.hh:92
Bitfield< 15 > system
Definition: misc.hh:1004
Bitfield< 63 > val
Definition: misc.hh:776
constexpr RegClass floatRegClass
Definition: float.hh:143
bool ic(TxDesc *d)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
uint16_t RegIndex
Definition: types.hh:176
std::ostream CheckpointOut
Definition: serialize.hh:66
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:220
uint64_t RegVal
Definition: types.hh:173
constexpr decltype(nullptr) NoFault
Definition: types.hh:253
@ FloatRegClass
Floating-point register.
Definition: reg_class.hh:61
constexpr char FloatRegClassName[]
Definition: reg_class.hh:74
#define UNSERIALIZE_MAPPING(member, names, size)
Definition: serialize.hh:666
#define SERIALIZE_MAPPING(member, names, size)
Definition: serialize.hh:660

Generated on Wed Dec 21 2022 10:22:23 for gem5 by doxygen 1.9.1