gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
utility.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2014, 2016-2020, 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/utility.hh"
39 
40 #include <memory>
41 
42 #include "arch/arm/faults.hh"
43 #include "arch/arm/interrupts.hh"
44 #include "arch/arm/isa.hh"
45 #include "arch/arm/mmu.hh"
46 #include "arch/arm/page_size.hh"
47 #include "arch/arm/regs/cc.hh"
48 #include "arch/arm/regs/int.hh"
49 #include "arch/arm/regs/vec.hh"
50 #include "arch/arm/system.hh"
51 #include "base/compiler.hh"
52 #include "cpu/base.hh"
53 #include "cpu/checker/cpu.hh"
54 #include "cpu/thread_context.hh"
55 #include "mem/port_proxy.hh"
56 #include "sim/full_system.hh"
57 
58 namespace gem5
59 {
60 
61 namespace ArmISA
62 {
63 
64 void
66 {
67  if (tc->readMiscReg(MISCREG_SEV_MAILBOX) == 0) {
68  // Post Interrupt and wake cpu if needed
69  tc->getCpuPtr()->postInterrupt(tc->threadId(), INT_SEV, 0);
70  }
71 }
72 
73 bool
75 {
76  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
77  if (ArmSystem::haveEL(tc, EL3) && !cpsr.width && currEL(tc) == EL3)
78  return true;
79  if (ArmSystem::haveEL(tc, EL3) && cpsr.width && cpsr.mode == MODE_MON)
80  return true;
81  else
82  return isSecureBelowEL3(tc);
83 }
84 
85 bool
87 {
88  return ArmSystem::haveEL(tc, EL3) &&
89  static_cast<SCR>(tc->readMiscRegNoEffect(MISCREG_SCR_EL3)).ns == 0;
90 }
91 
93 debugTargetFrom(ThreadContext *tc, bool secure)
94 {
95  bool route_to_el2;
96  if (ArmSystem::haveEL(tc, EL2) &&
97  (!secure || HaveExt(tc, ArmExtension::FEAT_SEL2))) {
98  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
99  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
100  route_to_el2 = (mdcr.tde == 1 || hcr.tge == 1);
101  } else {
102  route_to_el2 = false;
103  }
104  ExceptionLevel target;
105  if (route_to_el2) {
106  target = EL2;
107  } else if (ArmSystem::haveEL(tc, EL3) && !ArmSystem::highestELIs64(tc)
108  && secure) {
109  target = EL3;
110  } else {
111  target = EL1;
112  }
113  return target;
114 }
115 
116 bool
118 {
119  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
120  return opModeIs64((OperatingMode) (uint8_t) cpsr.mode);
121 }
122 
125 {
126  CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
127  return opModeToEL((OperatingMode)(uint8_t)cpsr.mode);
128 }
129 
130 bool
132 {
133  TTBCR ttbcr = tc->readMiscReg(MISCREG_TTBCR);
134  return ArmSystem::has(ArmExtension::LPAE, tc) && ttbcr.eae;
135 }
136 
137 RegVal
139 {
140  const ExceptionLevel current_el = currEL(tc);
141 
142  switch (current_el) {
143  case EL0:
144  // Note: in MsrMrs instruction we read the register value before
145  // checking access permissions. This means that EL0 entry must
146  // be part of the table even if MPIDR is not accessible in user
147  // mode.
148  warn_once("Trying to read MPIDR at EL0\n");
149  [[fallthrough]];
150  case EL1:
151  if (EL2Enabled(tc))
152  return tc->readMiscReg(MISCREG_VMPIDR_EL2);
153  else
154  return getMPIDR(arm_sys, tc);
155  case EL2:
156  case EL3:
157  return getMPIDR(arm_sys, tc);
158  default:
159  panic("Invalid EL for reading MPIDR register\n");
160  }
161 }
162 
163 RegVal
165 {
166  // Multiprocessor Affinity Register MPIDR from Cortex(tm)-A15 Technical
167  // Reference Manual
168  //
169  // bit 31 - Multi-processor extensions available
170  // bit 30 - Uni-processor system
171  // bit 24 - Multi-threaded cores
172  // bit 11-8 - Cluster ID
173  // bit 1-0 - CPU ID
174  //
175  // We deliberately extend both the Cluster ID and CPU ID fields to allow
176  // for simulation of larger systems
177  assert((0 <= tc->cpuId()) && (tc->cpuId() < 256));
178  assert(tc->socketId() < 65536);
179 
180  RegVal mpidr = 0x80000000;
181 
182  if (!arm_sys->multiProc)
183  replaceBits(mpidr, 30, 1);
184 
185  if (arm_sys->multiThread)
186  replaceBits(mpidr, 24, 1);
187 
188  // Get Affinity numbers
189  mpidr |= getAffinity(arm_sys, tc);
190  return mpidr;
191 }
192 
193 static RegVal
195 {
196  return arm_sys->multiThread ? tc->socketId() : 0;
197 }
198 
199 static RegVal
201 {
202  return arm_sys->multiThread ? tc->cpuId() : tc->socketId();
203 }
204 
205 static RegVal
207 {
208  return arm_sys->multiThread ? tc->threadId() : tc->cpuId();
209 }
210 
211 Affinity
213 {
214  Affinity aff = 0;
215  aff.aff0 = getAff0(arm_sys, tc);
216  aff.aff1 = getAff1(arm_sys, tc);
217  aff.aff2 = getAff2(arm_sys, tc);
218  return aff;
219 }
220 
221 bool
222 HaveExt(ThreadContext* tc, ArmExtension ext)
223 {
224  auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
225  return isa->getRelease()->has(ext);
226 }
227 
230 {
231  if (el != EL0)
232  return el;
233  else if (ArmSystem::haveEL(tc, EL3) && ELIs32(tc, EL3) &&
234  static_cast<SCR>(
235  tc->readMiscRegNoEffect(MISCREG_SCR_EL3)).ns == 0)
236  return EL3;
237  else if (HaveExt(tc, ArmExtension::FEAT_VHE) && ELIsInHost(tc, el))
238  return EL2;
239  else
240  return EL1;
241 }
242 
243 bool
245 {
246  if (ArmSystem::haveEL(tc, EL2) && HaveExt(tc, ArmExtension::FEAT_SEL2) &&
247  !ELIs32(tc, EL2)) {
248  if (ArmSystem::haveEL(tc, EL3))
249  return !ELIs32(tc, EL3) && static_cast<SCR>(
251  else
252  return isSecure(tc);
253  }
254  return false;
255 }
256 
257 bool
259 {
260  return ArmSystem::haveEL(tc, EL2) &&
261  (!ArmSystem::haveEL(tc, EL3) || static_cast<SCR>(
263  IsSecureEL2Enabled(tc));
264 }
265 
266 bool
268 {
269  return !ELIs32(tc, el);
270 }
271 
272 bool
274 {
275  auto [known, aarch32] = ELUsingAArch32K(tc, el);
276  panic_if(!known, "EL state is UNKNOWN");
277  return aarch32;
278 }
279 
280 bool
282 {
283  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
284  return (ArmSystem::haveEL(tc, EL2) &&
285  (IsSecureEL2Enabled(tc) || !isSecureBelowEL3(tc)) &&
286  HaveExt(tc, ArmExtension::FEAT_VHE) &&
287  !ELIs32(tc, EL2) && hcr.e2h == 1 &&
288  (el == EL2 || (el == EL0 && hcr.tge == 1)));
289 }
290 
293 {
294  bool secure = isSecureBelowEL3(tc);
295  return ELStateUsingAArch32K(tc, el, secure);
296 }
297 
298 bool
300 {
301  if (!ArmSystem::haveEL(tc, el))
302  return false;
303  else if (!ArmSystem::highestELIs64(tc))
304  return true;
305  else if (ArmSystem::highestEL(tc) == el)
306  return false;
307  else if (el == EL0)
308  return true;
309  return true;
310 }
311 
314 {
315  // Return true if the specified EL is in aarch32 state.
316  const bool have_el3 = ArmSystem::haveEL(tc, EL3);
317  const bool have_el2 = ArmSystem::haveEL(tc, EL2);
318 
319  panic_if(el == EL2 && !have_el2, "Asking for EL2 when it doesn't exist");
320  panic_if(el == EL3 && !have_el3, "Asking for EL3 when it doesn't exist");
321 
322  bool known, aarch32;
323  known = aarch32 = false;
324  if (!haveAArch32EL(tc, el)) {
325  // Target EL is the highest one in a system where
326  // the highest is using AArch64.
327  known = true; aarch32 = false;
328  } else if (secure && el == EL2) {
329  known = true; aarch32 = false;
330  } else if (!ArmSystem::highestELIs64(tc)) {
331  // All ELs are using AArch32:
332  known = true; aarch32 = true;
333  } else if (ArmSystem::highestEL(tc) == el) {
334  known = true; aarch32 = false;
335  } else {
336  SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
337  bool aarch32_below_el3 = have_el3 && scr.rw == 0 &&
338  (!secure || !HaveExt(tc, ArmExtension::FEAT_SEL2) || !scr.eel2);
339 
340  HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
341  bool sec_el2 = HaveExt(tc, ArmExtension::FEAT_SEL2) && scr.eel2;
342  bool aarch32_at_el1 = (aarch32_below_el3 ||
343  (have_el2 && (sec_el2 || !secure) &&
344  hcr.rw == 0 &&
345  !(hcr.e2h && hcr.tge &&
346  HaveExt(tc, ArmExtension::FEAT_VHE))));
347 
348  // Only know if EL0 using AArch32 from PSTATE
349  if (el == EL0 && !aarch32_at_el1) {
350  // EL0 controlled by PSTATE
351  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
352  known = (currEL(tc) == EL0);
353  aarch32 = (cpsr.width == 1);
354  } else {
355  known = true;
356  aarch32 = (aarch32_below_el3 && el != EL3) ||
357  (aarch32_at_el1 && (el == EL0 || el == EL1) );
358  }
359  }
360 
361  return std::make_pair(known, aarch32);
362 }
363 
364 bool
366 {
367  auto [known, aarch32] = ELStateUsingAArch32K(tc, el, secure);
368  panic_if(!known, "EL state is UNKNOWN");
369  return aarch32;
370 }
371 
372 bool
374 {
375  switch (currEL(tc)) {
376  case EL3:
377  return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL3)).ee;
378  case EL2:
379  return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL2)).ee;
380  case EL1:
381  return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1)).ee;
382  case EL0:
383  return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1)).e0e;
384  default:
385  panic("Invalid exception level");
386  break;
387  }
388 }
389 
390 bool
392 {
394 }
395 
396 bool
398 {
400 }
401 
402 int
403 computeAddrTop(ThreadContext *tc, bool selbit, bool is_instr,
404  TCR tcr, ExceptionLevel el)
405 {
406  bool tbi = false;
407  bool tbid = false;
408  ExceptionLevel regime = s1TranslationRegime(tc, el);
409  if (ELIs32(tc, regime)) {
410  return 31;
411  } else {
412  switch (regime) {
413  case EL1:
414  {
415  //TCR tcr = tc->readMiscReg(MISCREG_TCR_EL1);
416  tbi = selbit? tcr.tbi1 : tcr.tbi0;
417  tbid = selbit? tcr.tbid1 : tcr.tbid0;
418  break;
419  }
420  case EL2:
421  {
422  TCR tcr = tc->readMiscReg(MISCREG_TCR_EL2);
423  if (HaveExt(tc, ArmExtension::FEAT_VHE) && ELIsInHost(tc, el)) {
424  tbi = selbit? tcr.tbi1 : tcr.tbi0;
425  tbid = selbit? tcr.tbid1 : tcr.tbid0;
426  } else {
427  tbi = tcr.tbi;
428  tbid = tcr.tbid;
429  }
430  break;
431  }
432  case EL3:
433  {
434  TCR tcr = tc->readMiscReg(MISCREG_TCR_EL3);
435  tbi = tcr.tbi;
436  tbid = tcr.tbid;
437  break;
438  }
439  default:
440  break;
441  }
442 
443  }
444  int res = (tbi && (!tbid || !is_instr))? 55: 63;
445  return res;
446 }
447 
448 Addr
450  int topbit)
451 {
452  if (topbit == 63) {
453  return addr;
454  } else if (bits(addr,55) && (el <= EL1 || ELIsInHost(tc, el))) {
455  uint64_t mask = ((uint64_t)0x1 << topbit) -1;
456  addr = addr | ~mask;
457  } else {
458  addr = bits(addr, topbit, 0);
459  }
460  return addr; // Nothing to do if this is not a tagged address
461 }
462 
463 Addr
465  TCR tcr, bool is_instr)
466 {
467  bool selbit = bits(addr, 55);
468  int topbit = computeAddrTop(tc, selbit, is_instr, tcr, el);
469 
470  return maskTaggedAddr(addr, tc, el, topbit);
471 }
472 
473 Addr
475  bool is_instr)
476 {
477 
478  TCR tcr = tc->readMiscReg(MISCREG_TCR_EL1);
479  return purifyTaggedAddr(addr, tc, el, tcr, is_instr);
480 }
481 
482 Addr
484 {
485  return addr & ~(PageBytes - 1);
486 }
487 
488 Addr
490 {
491  return (addr + PageBytes - 1) & ~(PageBytes - 1);
492 }
493 
494 Fault
495 mcrMrc15Trap(const MiscRegIndex misc_reg, ExtMachInst mach_inst,
496  ThreadContext *tc, uint32_t imm)
497 {
499  if (mcrMrc15TrapToHyp(misc_reg, tc, imm, &ec))
500  return std::make_shared<HypervisorTrap>(mach_inst, imm, ec);
501  return AArch64AArch32SystemAccessTrap(misc_reg, mach_inst, tc, imm, ec);
502 }
503 
504 bool
505 mcrMrc15TrapToHyp(const MiscRegIndex misc_reg, ThreadContext *tc, uint32_t iss,
507 {
508  bool is_read;
509  uint32_t crm;
510  RegIndex rt;
511  uint32_t crn;
512  uint32_t opc1;
513  uint32_t opc2;
514  bool trap_to_hyp = false;
515 
516  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
517  const HDCR hdcr = tc->readMiscReg(MISCREG_HDCR);
518  const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
519  const HCPTR hcptr = tc->readMiscReg(MISCREG_HCPTR);
520 
521  if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
522  mcrMrcIssExtract(iss, is_read, crm, rt, crn, opc1, opc2);
523  trap_to_hyp = ((uint32_t) hstr) & (1 << crn);
524  trap_to_hyp |= hdcr.tpm && (crn == 9) && (crm >= 12);
525  trap_to_hyp |= hcr.tidcp && (
526  ((crn == 9) && ((crm <= 2) || ((crm >= 5) && (crm <= 8)))) ||
527  ((crn == 10) && ((crm <= 1) || (crm == 4) || (crm == 8))) ||
528  ((crn == 11) && ((crm <= 8) || (crm == 15))));
529 
530  if (!trap_to_hyp) {
531  switch (unflattenMiscReg(misc_reg)) {
532  case MISCREG_CPACR:
533  trap_to_hyp = hcptr.tcpac;
534  break;
535  case MISCREG_REVIDR:
536  case MISCREG_TCMTR:
537  case MISCREG_TLBTR:
538  case MISCREG_AIDR:
539  trap_to_hyp = hcr.tid1;
540  break;
541  case MISCREG_CTR:
542  case MISCREG_CCSIDR:
543  case MISCREG_CLIDR:
544  case MISCREG_CSSELR:
545  trap_to_hyp = hcr.tid2;
546  break;
547  case MISCREG_ID_PFR0:
548  case MISCREG_ID_PFR1:
549  case MISCREG_ID_DFR0:
550  case MISCREG_ID_AFR0:
551  case MISCREG_ID_MMFR0:
552  case MISCREG_ID_MMFR1:
553  case MISCREG_ID_MMFR2:
554  case MISCREG_ID_MMFR3:
555  case MISCREG_ID_MMFR4:
556  case MISCREG_ID_ISAR0:
557  case MISCREG_ID_ISAR1:
558  case MISCREG_ID_ISAR2:
559  case MISCREG_ID_ISAR3:
560  case MISCREG_ID_ISAR4:
561  case MISCREG_ID_ISAR5:
562  case MISCREG_ID_ISAR6:
563  trap_to_hyp = hcr.tid3;
564  break;
565  case MISCREG_DCISW:
566  case MISCREG_DCCSW:
567  case MISCREG_DCCISW:
568  trap_to_hyp = hcr.tsw;
569  break;
570  case MISCREG_DCIMVAC:
571  case MISCREG_DCCIMVAC:
572  case MISCREG_DCCMVAC:
573  trap_to_hyp = hcr.tpc;
574  break;
575  case MISCREG_ICIMVAU:
576  case MISCREG_ICIALLU:
577  case MISCREG_ICIALLUIS:
578  case MISCREG_DCCMVAU:
579  trap_to_hyp = hcr.tpu;
580  break;
581  case MISCREG_TLBIALLIS:
582  case MISCREG_TLBIMVAIS:
583  case MISCREG_TLBIASIDIS:
584  case MISCREG_TLBIMVAAIS:
585  case MISCREG_TLBIMVALIS:
586  case MISCREG_TLBIMVAALIS:
587  case MISCREG_DTLBIALL:
588  case MISCREG_ITLBIALL:
589  case MISCREG_DTLBIMVA:
590  case MISCREG_ITLBIMVA:
591  case MISCREG_DTLBIASID:
592  case MISCREG_ITLBIASID:
593  case MISCREG_TLBIMVAA:
594  case MISCREG_TLBIALL:
595  case MISCREG_TLBIMVA:
596  case MISCREG_TLBIMVAL:
597  case MISCREG_TLBIMVAAL:
598  case MISCREG_TLBIASID:
599  trap_to_hyp = hcr.ttlb;
600  break;
601  case MISCREG_ACTLR:
602  trap_to_hyp = hcr.tac;
603  break;
604  case MISCREG_SCTLR:
605  case MISCREG_TTBR0:
606  case MISCREG_TTBR1:
607  case MISCREG_TTBCR:
608  case MISCREG_DACR:
609  case MISCREG_DFSR:
610  case MISCREG_IFSR:
611  case MISCREG_DFAR:
612  case MISCREG_IFAR:
613  case MISCREG_ADFSR:
614  case MISCREG_AIFSR:
615  case MISCREG_PRRR:
616  case MISCREG_NMRR:
617  case MISCREG_MAIR0:
618  case MISCREG_MAIR1:
619  case MISCREG_CONTEXTIDR:
620  trap_to_hyp = hcr.tvm & !is_read;
621  break;
622  case MISCREG_PMCR:
623  trap_to_hyp = hdcr.tpmcr;
624  break;
625  // GICv3 regs
626  case MISCREG_ICC_SGI0R:
627  trap_to_hyp = hcr.fmo;
628  break;
629  case MISCREG_ICC_SGI1R:
630  case MISCREG_ICC_ASGI1R:
631  trap_to_hyp = hcr.imo;
632  break;
634  // CNTFRQ may be trapped only on reads
635  // CNTPCT and CNTVCT are read-only
636  if (MISCREG_CNTFRQ <= misc_reg && misc_reg <= MISCREG_CNTVCT &&
637  !is_read)
638  break;
639  trap_to_hyp = isGenericTimerHypTrap(misc_reg, tc, ec);
640  break;
641  // No default action needed
642  default:
643  break;
644  }
645  }
646  }
647  return trap_to_hyp;
648 }
649 
650 
651 bool
652 mcrMrc14TrapToHyp(const MiscRegIndex misc_reg, ThreadContext *tc, uint32_t iss)
653 {
654  bool is_read;
655  uint32_t crm;
656  RegIndex rt;
657  uint32_t crn;
658  uint32_t opc1;
659  uint32_t opc2;
660 
661  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
662  const HDCR hdcr = tc->readMiscReg(MISCREG_HDCR);
663  const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
664  const HCPTR hcptr = tc->readMiscReg(MISCREG_HCPTR);
665 
666  bool trap_to_hyp = false;
667 
668  if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
669  mcrMrcIssExtract(iss, is_read, crm, rt, crn, opc1, opc2);
670  inform("trap check M:%x N:%x 1:%x 2:%x hdcr %x, hcptr %x, hstr %x\n",
671  crm, crn, opc1, opc2, hdcr, hcptr, hstr);
672  trap_to_hyp = hdcr.tda && (opc1 == 0);
673  trap_to_hyp |= hcptr.tta && (opc1 == 1);
674  if (!trap_to_hyp) {
675  switch (unflattenMiscReg(misc_reg)) {
676  case MISCREG_DBGOSLSR:
677  case MISCREG_DBGOSLAR:
678  case MISCREG_DBGOSDLR:
679  case MISCREG_DBGPRCR:
680  trap_to_hyp = hdcr.tdosa;
681  break;
682  case MISCREG_DBGDRAR:
683  case MISCREG_DBGDSAR:
684  trap_to_hyp = hdcr.tdra;
685  break;
686  case MISCREG_JIDR:
687  trap_to_hyp = hcr.tid0;
688  break;
689  case MISCREG_JOSCR:
690  case MISCREG_JMCR:
691  trap_to_hyp = hstr.tjdbx;
692  break;
693  case MISCREG_TEECR:
694  case MISCREG_TEEHBR:
695  trap_to_hyp = hstr.ttee;
696  break;
697  // No default action needed
698  default:
699  break;
700  }
701  }
702  }
703  return trap_to_hyp;
704 }
705 
706 Fault
707 mcrrMrrc15Trap(const MiscRegIndex misc_reg, ExtMachInst mach_inst,
708  ThreadContext *tc, uint32_t imm)
709 {
711  if (mcrrMrrc15TrapToHyp(misc_reg, tc, imm, &ec))
712  return std::make_shared<HypervisorTrap>(mach_inst, imm, ec);
713  return AArch64AArch32SystemAccessTrap(misc_reg, mach_inst, tc, imm, ec);
714 }
715 
716 bool
718  uint32_t iss, ExceptionClass *ec)
719 {
720  uint32_t crm;
721  RegIndex rt;
722  uint32_t crn;
723  uint32_t opc1;
724  uint32_t opc2;
725  bool is_read;
726  bool trap_to_hyp = false;
727 
728  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
729  const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
730 
731  if (EL2Enabled(tc) && (currEL(tc) < EL2)) {
732  // This is technically the wrong function, but we can re-use it for
733  // the moment because we only need one field, which overlaps with the
734  // mcrmrc layout
735  mcrMrcIssExtract(iss, is_read, crm, rt, crn, opc1, opc2);
736  trap_to_hyp = ((uint32_t)hstr) & (1 << crm);
737 
738  if (!trap_to_hyp) {
739  switch (unflattenMiscReg(misc_reg)) {
740  case MISCREG_SCTLR:
741  case MISCREG_TTBR0:
742  case MISCREG_TTBR1:
743  case MISCREG_TTBCR:
744  case MISCREG_DACR:
745  case MISCREG_DFSR:
746  case MISCREG_IFSR:
747  case MISCREG_DFAR:
748  case MISCREG_IFAR:
749  case MISCREG_ADFSR:
750  case MISCREG_AIFSR:
751  case MISCREG_PRRR:
752  case MISCREG_NMRR:
753  case MISCREG_MAIR0:
754  case MISCREG_MAIR1:
755  case MISCREG_CONTEXTIDR:
756  trap_to_hyp = hcr.tvm & !is_read;
757  break;
759  // CNTFRQ may be trapped only on reads
760  // CNTPCT and CNTVCT are read-only
761  if (MISCREG_CNTFRQ <= misc_reg && misc_reg <= MISCREG_CNTVCT &&
762  !is_read) {
763  break;
764  }
765  trap_to_hyp = isGenericTimerHypTrap(misc_reg, tc, ec);
766  break;
767  // No default action needed
768  default:
769  break;
770  }
771  }
772  }
773  return trap_to_hyp;
774 }
775 
776 Fault
778  ExtMachInst mach_inst, ThreadContext *tc,
779  uint32_t imm, ExceptionClass ec)
780 {
781  if (currEL(tc) <= EL1 && !ELIs32(tc, EL1) &&
783  return std::make_shared<SupervisorTrap>(mach_inst, imm, ec);
784  if (currEL(tc) <= EL2 && EL2Enabled(tc) && !ELIs32(tc, EL2) &&
786  return std::make_shared<HypervisorTrap>(mach_inst, imm, ec);
787  return NoFault;
788 }
789 
790 bool
792  ThreadContext *tc)
793 {
794  switch (misc_reg) {
796  return currEL(tc) == EL0 &&
797  isGenericTimerSystemAccessTrapEL1(misc_reg, tc);
798  default:
799  break;
800  }
801  return false;
802 }
803 
804 bool
807 {
808  if (currEL(tc) <= EL2 && EL2Enabled(tc) && ELIs32(tc, EL2)) {
809  switch (misc_reg) {
811  if (currEL(tc) == EL0 &&
812  isGenericTimerCommonEL0HypTrap(misc_reg, tc, ec))
813  return true;
814  switch (misc_reg) {
815  case MISCREG_CNTPCT:
817  return currEL(tc) <= EL1 &&
818  isGenericTimerPhysHypTrap(misc_reg, tc, ec);
819  default:
820  break;
821  }
822  break;
823  default:
824  break;
825  }
826  }
827  return false;
828 }
829 
830 bool
833 {
834  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
835  bool trap_cond = condGenericTimerSystemAccessTrapEL1(misc_reg, tc);
836  if (ELIs32(tc, EL1) && trap_cond && hcr.tge) {
837  // As per the architecture, this hyp trap should have uncategorized
838  // exception class
839  if (ec)
841  return true;
842  }
843  return false;
844 }
845 
846 bool
849 {
850  return condGenericTimerPhysHypTrap(misc_reg, tc);
851 }
852 
853 bool
855 {
856  const CNTHCTL cnthctl = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
857  switch (misc_reg) {
858  case MISCREG_CNTPCT:
859  return !cnthctl.el1pcten;
861  return !cnthctl.el1pcen;
862  default:
863  break;
864  }
865  return false;
866 }
867 
868 bool
870  ThreadContext *tc)
871 {
872  switch (misc_reg) {
875  {
876  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
877  bool trap_cond = condGenericTimerSystemAccessTrapEL1(misc_reg, tc);
878  return !(EL2Enabled(tc) && hcr.e2h && hcr.tge) && trap_cond &&
879  !(EL2Enabled(tc) && !ELIs32(tc, EL2) && hcr.tge);
880  }
881  default:
882  break;
883  }
884  return false;
885 }
886 
887 bool
889  ThreadContext *tc)
890 {
891  const CNTKCTL cntkctl = tc->readMiscReg(MISCREG_CNTKCTL_EL1);
892  switch (misc_reg) {
893  case MISCREG_CNTFRQ:
894  case MISCREG_CNTFRQ_EL0:
895  return !cntkctl.el0pcten && !cntkctl.el0vcten;
896  case MISCREG_CNTPCT:
897  case MISCREG_CNTPCT_EL0:
898  return !cntkctl.el0pcten;
899  case MISCREG_CNTVCT:
900  case MISCREG_CNTVCT_EL0:
901  return !cntkctl.el0vcten;
904  return !cntkctl.el0pten;
907  return !cntkctl.el0vten;
908  default:
909  break;
910  }
911  return false;
912 }
913 
914 bool
916  ThreadContext *tc)
917 {
918  switch (misc_reg) {
920  return currEL(tc) <= EL1 &&
921  isGenericTimerSystemAccessTrapEL2(misc_reg, tc);
922  default:
923  break;
924  }
925  return false;
926 }
927 
928 bool
930  ThreadContext *tc)
931 {
932  switch (misc_reg) {
935  if (currEL(tc) == EL0 &&
937  return true;
938  switch (misc_reg) {
939  case MISCREG_CNTPCT:
940  case MISCREG_CNTPCT_EL0:
943  return (currEL(tc) == EL0 &&
945  (currEL(tc) == EL1 &&
947  case MISCREG_CNTVCT:
948  case MISCREG_CNTVCT_EL0:
951  return isGenericTimerVirtSystemAccessTrapEL2(misc_reg, tc);
952  default:
953  break;
954  }
955  break;
956  default:
957  break;
958  }
959  return false;
960 }
961 
962 bool
964  ThreadContext *tc)
965 {
966  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
967  bool trap_cond_el1 = condGenericTimerSystemAccessTrapEL1(misc_reg, tc);
968  bool trap_cond_el2 = condGenericTimerCommonEL0SystemAccessTrapEL2(misc_reg,
969  tc);
970  return (!ELIs32(tc, EL1) && !hcr.e2h && trap_cond_el1 && hcr.tge) ||
971  (ELIs32(tc, EL1) && trap_cond_el1 && hcr.tge) ||
972  (hcr.e2h && hcr.tge && trap_cond_el2);
973 }
974 
975 bool
977  ThreadContext *tc)
978 {
979  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
981  misc_reg, tc);
983  misc_reg, tc);
984 
985  switch (misc_reg) {
986  case MISCREG_CNTPCT:
987  case MISCREG_CNTPCT_EL0:
988  return !hcr.e2h && trap_cond_1;
991  return (!hcr.e2h && trap_cond_0) ||
992  (hcr.e2h && !hcr.tge && trap_cond_1);
993  default:
994  break;
995  }
996 
997  return false;
998 }
999 
1000 bool
1002  ThreadContext *tc)
1003 {
1004  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1005  bool trap_cond_0 = condGenericTimerPhysEL1SystemAccessTrapEL2(
1006  misc_reg, tc);
1008  misc_reg, tc);
1009 
1010  switch (misc_reg) {
1011  case MISCREG_CNTPCT:
1012  case MISCREG_CNTPCT_EL0:
1013  return trap_cond_1;
1016  return (!hcr.e2h && trap_cond_0) ||
1017  (hcr.e2h && trap_cond_1);
1018  default:
1019  break;
1020  }
1021  return false;
1022 }
1023 
1024 bool
1026  ThreadContext *tc)
1027 {
1028  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1030  misc_reg, tc);
1031  return !ELIs32(tc, EL1) && !(hcr.e2h && hcr.tge) && trap_cond;
1032 }
1033 
1034 bool
1036  ThreadContext *tc)
1037 {
1038  const CNTHCTL_E2H cnthctl = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
1039  switch (misc_reg) {
1040  case MISCREG_CNTFRQ:
1041  case MISCREG_CNTFRQ_EL0:
1042  return !cnthctl.el0pcten && !cnthctl.el0vcten;
1043  case MISCREG_CNTPCT:
1044  case MISCREG_CNTPCT_EL0:
1045  return !cnthctl.el0pcten;
1046  case MISCREG_CNTVCT:
1047  case MISCREG_CNTVCT_EL0:
1048  return !cnthctl.el0vcten;
1051  return !cnthctl.el0pten;
1054  return !cnthctl.el0vten;
1055  default:
1056  break;
1057  }
1058  return false;
1059 }
1060 
1061 bool
1063  ThreadContext *tc)
1064 {
1065  const AA64MMFR0 mmfr0 = tc->readMiscRegNoEffect(MISCREG_ID_AA64MMFR0_EL1);
1066  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1067  const RegVal cnthctl_val = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
1068  const CNTHCTL cnthctl = cnthctl_val;
1069  const CNTHCTL_E2H cnthctl_e2h = cnthctl_val;
1070  switch (misc_reg) {
1071  case MISCREG_CNTPCT:
1072  case MISCREG_CNTPCT_EL0:
1073  return hcr.e2h ? !cnthctl_e2h.el1pcten : !cnthctl.el1pcten;
1074  case MISCREG_CNTVCT:
1075  case MISCREG_CNTVCT_EL0:
1076  if (!mmfr0.ecv)
1077  return false;
1078  else
1079  return hcr.e2h ? cnthctl_e2h.el1tvct : cnthctl.el1tvct;
1082  return hcr.e2h ? !cnthctl_e2h.el1pten : false;
1085  if (!mmfr0.ecv)
1086  return false;
1087  else
1088  return hcr.e2h ? cnthctl_e2h.el1tvt : cnthctl.el1tvt;
1089  default:
1090  break;
1091  }
1092  return false;
1093 }
1094 
1095 bool
1097  ThreadContext *tc)
1098 {
1099  const CNTHCTL cnthctl = tc->readMiscReg(MISCREG_CNTHCTL_EL2);
1100  return !cnthctl.el1pcen;
1101 }
1102 
1103 bool
1105  ThreadContext *tc)
1106 {
1107  switch (misc_reg) {
1109  {
1110  const SCR scr = tc->readMiscReg(MISCREG_SCR_EL3);
1111  return currEL(tc) == EL1 && !scr.ns && !scr.st;
1112  }
1113  default:
1114  break;
1115  }
1116  return false;
1117 }
1118 
1119 bool
1120 decodeMrsMsrBankedReg(uint8_t sysM, bool r, bool &isIntReg, int &regIdx,
1121  CPSR cpsr, SCR scr, NSACR nsacr, bool checkSecurity)
1122 {
1124  bool ok = true;
1125 
1126  // R mostly indicates if its a int register or a misc reg, we override
1127  // below if the few corner cases
1128  isIntReg = !r;
1129  // Loosely based on ARM ARM issue C section B9.3.10
1130  if (r) {
1131  switch (sysM) {
1132  case 0xE:
1133  regIdx = MISCREG_SPSR_FIQ;
1134  mode = MODE_FIQ;
1135  break;
1136  case 0x10:
1137  regIdx = MISCREG_SPSR_IRQ;
1138  mode = MODE_IRQ;
1139  break;
1140  case 0x12:
1141  regIdx = MISCREG_SPSR_SVC;
1142  mode = MODE_SVC;
1143  break;
1144  case 0x14:
1145  regIdx = MISCREG_SPSR_ABT;
1146  mode = MODE_ABORT;
1147  break;
1148  case 0x16:
1149  regIdx = MISCREG_SPSR_UND;
1150  mode = MODE_UNDEFINED;
1151  break;
1152  case 0x1C:
1153  regIdx = MISCREG_SPSR_MON;
1154  mode = MODE_MON;
1155  break;
1156  case 0x1E:
1157  regIdx = MISCREG_SPSR_HYP;
1158  mode = MODE_HYP;
1159  break;
1160  default:
1161  ok = false;
1162  break;
1163  }
1164  } else {
1165  int sysM4To3 = bits(sysM, 4, 3);
1166 
1167  if (sysM4To3 == 0) {
1168  mode = MODE_USER;
1169  regIdx = int_reg::regInMode(mode, bits(sysM, 2, 0) + 8);
1170  } else if (sysM4To3 == 1) {
1171  mode = MODE_FIQ;
1172  regIdx = int_reg::regInMode(mode, bits(sysM, 2, 0) + 8);
1173  } else if (sysM4To3 == 3) {
1174  if (bits(sysM, 1) == 0) {
1175  mode = MODE_MON;
1176  regIdx = int_reg::regInMode(mode, 14 - bits(sysM, 0));
1177  } else {
1178  mode = MODE_HYP;
1179  if (bits(sysM, 0) == 1) {
1180  regIdx = int_reg::regInMode(mode, 13); // R13 in HYP
1181  } else {
1182  isIntReg = false;
1183  regIdx = MISCREG_ELR_HYP;
1184  }
1185  }
1186  } else { // Other Banked registers
1187  int sysM2 = bits(sysM, 2);
1188  int sysM1 = bits(sysM, 1);
1189 
1190  mode = (OperatingMode)(((sysM2 || sysM1) << 0) |
1191  (1 << 1) |
1192  ((sysM2 && !sysM1) << 2) |
1193  ((sysM2 && sysM1) << 3) |
1194  (1 << 4));
1195  regIdx = int_reg::regInMode(mode, 14 - bits(sysM, 0));
1196  // Don't flatten the register here. This is going to go through
1197  // setReg() which will do the flattening
1198  ok &= mode != cpsr.mode;
1199  }
1200  }
1201 
1202  // Check that the requested register is accessable from the current mode
1203  if (ok && checkSecurity && mode != cpsr.mode) {
1204  switch (cpsr.mode) {
1205  case MODE_USER:
1206  ok = false;
1207  break;
1208  case MODE_FIQ:
1209  ok &= mode != MODE_HYP;
1210  ok &= (mode != MODE_MON) || !scr.ns;
1211  break;
1212  case MODE_HYP:
1213  ok &= mode != MODE_MON;
1214  ok &= (mode != MODE_FIQ) || !nsacr.rfr;
1215  break;
1216  case MODE_IRQ:
1217  case MODE_SVC:
1218  case MODE_ABORT:
1219  case MODE_UNDEFINED:
1220  case MODE_SYSTEM:
1221  ok &= mode != MODE_HYP;
1222  ok &= (mode != MODE_MON) || !scr.ns;
1223  ok &= (mode != MODE_FIQ) || !nsacr.rfr;
1224  break;
1225  // can access everything, no further checks required
1226  case MODE_MON:
1227  break;
1228  default:
1229  panic("unknown Mode 0x%x\n", cpsr.mode);
1230  break;
1231  }
1232  }
1233  return ok;
1234 }
1235 
1236 bool
1238 {
1239  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1240  const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
1241 
1242  // NV Extension not implemented yet
1243  bool have_nv_ext = false;
1244  bool unpriv_el1 = currEL(tc) == EL1 &&
1245  !(ArmSystem::haveEL(tc, EL2) &&
1246  have_nv_ext && hcr.nv == 1 && hcr.nv1 == 1);
1247  bool unpriv_el2 = ArmSystem::haveEL(tc, EL2) &&
1248  HaveExt(tc, ArmExtension::FEAT_VHE) &&
1249  currEL(tc) == EL2 && hcr.e2h == 1 && hcr.tge == 1;
1250 
1251  return (unpriv_el1 || unpriv_el2) && !cpsr.uao;
1252 }
1253 
1254 bool
1256 {
1257  ExceptionLevel regime = s1TranslationRegime(tc, currEL(tc));
1258 
1259  switch (currEL(tc)) {
1260  case EL3:
1261  return ((SCTLR)tc->readMiscReg(MISCREG_SCTLR_EL3)).sa;
1262  case EL2:
1263  return ((SCTLR)tc->readMiscReg(MISCREG_SCTLR_EL2)).sa;
1264  case EL1:
1265  return ((SCTLR)tc->readMiscReg(MISCREG_SCTLR_EL1)).sa;
1266  case EL0:
1267  {
1268  SCTLR sc = (regime == EL2) ? tc->readMiscReg(MISCREG_SCTLR_EL2):
1270  return sc.sa0;
1271  }
1272  default:
1273  panic("Invalid exception level");
1274  break;
1275  }
1276 }
1277 
1278 int
1279 decodePhysAddrRange64(uint8_t pa_enc)
1280 {
1281  switch (pa_enc) {
1282  case 0x0:
1283  return 32;
1284  case 0x1:
1285  return 36;
1286  case 0x2:
1287  return 40;
1288  case 0x3:
1289  return 42;
1290  case 0x4:
1291  return 44;
1292  case 0x5:
1293  return 48;
1294  case 0x6:
1295  return 52;
1296  default:
1297  panic("Invalid phys. address range encoding");
1298  }
1299 }
1300 
1301 uint8_t
1303 {
1304  switch (pa_size) {
1305  case 32:
1306  return 0x0;
1307  case 36:
1308  return 0x1;
1309  case 40:
1310  return 0x2;
1311  case 42:
1312  return 0x3;
1313  case 44:
1314  return 0x4;
1315  case 48:
1316  return 0x5;
1317  case 52:
1318  return 0x6;
1319  default:
1320  panic("Invalid phys. address range");
1321  }
1322 }
1323 
1324 void
1326 {
1327  int ei = 0;
1328  for (int ri = 0; ri < NumVecRegs; ri++) {
1330  tc->getReg(vecRegClass[ri], &reg);
1331  for (int j = 0; j < NumVecElemPerVecReg; j++, ei++)
1332  tc->setReg(vecElemClass[ei], reg.as<VecElem>()[j]);
1333  }
1334 }
1335 
1336 void
1338 {
1339  int ei = 0;
1340  for (int ri = 0; ri < NumVecRegs; ri++) {
1342  for (int j = 0; j < NumVecElemPerVecReg; j++, ei++) {
1343  RegId elem_id = vecElemClass[ei];
1344  reg.as<VecElem>()[j] = tc->getReg(elem_id);
1345  }
1346  tc->setReg(vecRegClass[ri], &reg);
1347  }
1348 }
1349 
1350 } // namespace ArmISA
1351 } // namespace gem5
gem5::ArmISA::MISCREG_DCCMVAU
@ MISCREG_DCCMVAU
Definition: misc.hh:321
gem5::ArmISA::MISCREG_DFAR
@ MISCREG_DFAR
Definition: misc.hh:288
gem5::ArmISA::NumVecElemPerVecReg
constexpr unsigned NumVecElemPerVecReg
Definition: vec.hh:61
gem5::ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: misc.hh:66
gem5::ArmISA::MISCREG_ID_MMFR4
@ MISCREG_ID_MMFR4
Definition: misc.hh:224
gem5::ArmISA::mcrMrcIssExtract
static void mcrMrcIssExtract(uint32_t iss, bool &isRead, uint32_t &crm, RegIndex &rt, uint32_t &crn, uint32_t &opc1, uint32_t &opc2)
Definition: utility.hh:246
gem5::ArmISA::MISCREG_TLBIMVALIS
@ MISCREG_TLBIMVALIS
Definition: misc.hh:330
gem5::ArmISA::MISCREG_PMCR
@ MISCREG_PMCR
Definition: misc.hh:356
gem5::ArmISA::MISCREG_CNTV_TVAL
@ MISCREG_CNTV_TVAL
Definition: misc.hh:432
gem5::ArmISA::MISCREG_CSSELR
@ MISCREG_CSSELR
Definition: misc.hh:235
gem5::ArmISA::MISCREG_DCCMVAC
@ MISCREG_DCCMVAC
Definition: misc.hh:317
gem5::ArmISA::maskTaggedAddr
Addr maskTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, int topbit)
Definition: utility.cc:449
gem5::ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
gem5::ArmISA::MODE_SVC
@ MODE_SVC
Definition: types.hh:291
gem5::NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:253
gem5::ArmISA::MODE_MON
@ MODE_MON
Definition: types.hh:292
gem5::ArmISA::MISCREG_TLBIALL
@ MISCREG_TLBIALL
Definition: misc.hh:338
gem5::ArmISA::MISCREG_HSTR
@ MISCREG_HSTR
Definition: misc.hh:257
gem5::ArmISA::ELIs64
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:267
gem5::ArmISA::MISCREG_ID_ISAR5
@ MISCREG_ID_ISAR5
Definition: misc.hh:230
gem5::ArmISA::getAffinity
Affinity getAffinity(ArmSystem *arm_sys, ThreadContext *tc)
Retrieves MPIDR_EL1.
Definition: utility.cc:212
gem5::RegVal
uint64_t RegVal
Definition: types.hh:173
gem5::ArmISA::MISCREG_SCTLR_EL3
@ MISCREG_SCTLR_EL3
Definition: misc.hh:597
gem5::ArmISA::MISCREG_ICIALLU
@ MISCREG_ICIALLU
Definition: misc.hh:302
gem5::ArmISA::MODE_FIQ
@ MODE_FIQ
Definition: types.hh:289
gem5::ArmISA::MISCREG_CNTPS_CTL_EL1
@ MISCREG_CNTPS_CTL_EL1
Definition: misc.hh:792
gem5::ArmSystem::highestELIs64
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
Definition: system.hh:187
gem5::ArmISA::MISCREG_TTBR0
@ MISCREG_TTBR0
Definition: misc.hh:259
gem5::ArmISA::MISCREG_CNTVCT
@ MISCREG_CNTVCT
Definition: misc.hh:420
gem5::ArmISA::NumVecRegs
const int NumVecRegs
Definition: vec.hh:83
gem5::ArmISA::el
Bitfield< 3, 2 > el
Definition: misc_types.hh:73
gem5::ArmISA::MISCREG_CNTFRQ
@ MISCREG_CNTFRQ
Definition: misc.hh:418
gem5::ArmISA::MISCREG_CONTEXTIDR
@ MISCREG_CONTEXTIDR
Definition: misc.hh:404
gem5::ArmISA::MISCREG_CNTV_CTL_EL0
@ MISCREG_CNTV_CTL_EL0
Definition: misc.hh:781
gem5::ArmISA::isGenericTimerPhysEL1SystemAccessTrapEL2
bool isGenericTimerPhysEL1SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1001
gem5::ArmISA::MISCREG_TCR_EL2
@ MISCREG_TCR_EL2
Definition: misc.hh:610
gem5::ArmISA::MISCREG_CNTPS_TVAL_EL1
@ MISCREG_CNTPS_TVAL_EL1
Definition: misc.hh:794
gem5::ArmISA::MISCREG_SPSR_FIQ
@ MISCREG_SPSR_FIQ
Definition: misc.hh:68
gem5::ArmISA::MISCREG_CNTP_CTL_EL0
@ MISCREG_CNTP_CTL_EL0
Definition: misc.hh:778
gem5::ArmISA::MISCREG_ITLBIMVA
@ MISCREG_ITLBIMVA
Definition: misc.hh:333
warn_once
#define warn_once(...)
Definition: logging.hh:260
gem5::ThreadContext::getReg
virtual RegVal getReg(const RegId &reg) const
Definition: thread_context.cc:180
gem5::ArmISA::MISCREG_MDCR_EL2
@ MISCREG_MDCR_EL2
Definition: misc.hh:593
gem5::ArmISA::isGenericTimerHypTrap
bool isGenericTimerHypTrap(const MiscRegIndex misc_reg, ThreadContext *tc, ExceptionClass *ec)
Definition: utility.cc:805
gem5::ArmISA::tbi
Bitfield< 20 > tbi
Definition: misc_types.hh:572
gem5::ArmISA::MISCREG_TLBIMVAAL
@ MISCREG_TLBIMVAAL
Definition: misc.hh:343
gem5::ArmISA::ISA
Definition: isa.hh:70
gem5::ArmISA::MISCREG_DCCSW
@ MISCREG_DCCSW
Definition: misc.hh:318
gem5::ArmISA::decodePhysAddrRange64
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
Definition: utility.cc:1279
gem5::ArmISA::MODE_UNDEFINED
@ MODE_UNDEFINED
Definition: types.hh:295
gem5::ArmISA::MODE_IRQ
@ MODE_IRQ
Definition: types.hh:290
gem5::ArmISA::iss
Bitfield< 24, 0 > iss
Definition: misc_types.hh:729
gem5::ArmISA::MISCREG_SCR_EL3
@ MISCREG_SCR_EL3
Definition: misc.hh:599
gem5::ArmISA::isGenericTimerSystemAccessTrapEL1
bool isGenericTimerSystemAccessTrapEL1(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:869
gem5::ArmISA::isGenericTimerCommonEL0HypTrap
bool isGenericTimerCommonEL0HypTrap(const MiscRegIndex misc_reg, ThreadContext *tc, ExceptionClass *ec)
Definition: utility.cc:831
gem5::ArmISA::encodePhysAddrRange64
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
Definition: utility.cc:1302
gem5::ArmISA::MISCREG_ICIMVAU
@ MISCREG_ICIMVAU
Definition: misc.hh:303
gem5::replaceBits
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:213
gem5::ArmISA::isSecureBelowEL3
bool isSecureBelowEL3(ThreadContext *tc)
Definition: utility.cc:86
gem5::ArmISA::isGenericTimerSystemAccessTrapEL2
bool isGenericTimerSystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:929
gem5::ArmISA::MISCREG_TTBCR
@ MISCREG_TTBCR
Definition: misc.hh:265
gem5::ArmISA::MISCREG_TLBIMVAL
@ MISCREG_TLBIMVAL
Definition: misc.hh:342
gem5::ArmISA::MISCREG_JOSCR
@ MISCREG_JOSCR
Definition: misc.hh:206
gem5::ArmISA::MISCREG_DCISW
@ MISCREG_DCISW
Definition: misc.hh:308
gem5::ArmISA::MISCREG_TLBIALLIS
@ MISCREG_TLBIALLIS
Definition: misc.hh:326
gem5::ArmISA::MISCREG_TLBTR
@ MISCREG_TLBTR
Definition: misc.hh:213
gem5::ArmISA::mcrrMrrc15TrapToHyp
bool mcrrMrrc15TrapToHyp(const MiscRegIndex misc_reg, ThreadContext *tc, uint32_t iss, ExceptionClass *ec)
Definition: utility.cc:717
gem5::ArmISA::MISCREG_ITLBIASID
@ MISCREG_ITLBIASID
Definition: misc.hh:334
gem5::ArmISA::MISCREG_TCR_EL3
@ MISCREG_TCR_EL3
Definition: misc.hh:616
gem5::ArmISA::ns
Bitfield< 0 > ns
Definition: misc_types.hh:388
gem5::ArmISA::EL1
@ EL1
Definition: types.hh:274
gem5::ArmISA::MISCREG_ID_ISAR3
@ MISCREG_ID_ISAR3
Definition: misc.hh:228
gem5::ArmISA::MISCREG_ID_AA64MMFR0_EL1
@ MISCREG_ID_AA64MMFR0_EL1
Definition: misc.hh:574
gem5::ArmISA::MISCREG_ID_MMFR3
@ MISCREG_ID_MMFR3
Definition: misc.hh:223
vec.hh
gem5::ArmISA::opModeToEL
static ExceptionLevel opModeToEL(OperatingMode mode)
Definition: types.hh:391
gem5::ArmISA::MISCREG_SPSR_MON
@ MISCREG_SPSR_MON
Definition: misc.hh:71
gem5::ArmISA::MISCREG_DBGOSLAR
@ MISCREG_DBGOSLAR
Definition: misc.hh:192
gem5::ArmISA::ELIsInHost
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:281
gem5::ArmISA::isAArch64AArch32SystemAccessTrapEL2
bool isAArch64AArch32SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:915
gem5::ArmISA::MISCREG_DCCISW
@ MISCREG_DCCISW
Definition: misc.hh:323
gem5::ArmISA::inAArch64
bool inAArch64(ThreadContext *tc)
Definition: utility.cc:117
gem5::ArmISA::MISCREG_ID_ISAR1
@ MISCREG_ID_ISAR1
Definition: misc.hh:226
gem5::VegaISA::r
Bitfield< 5 > r
Definition: pagetable.hh:60
gem5::ArmISA::opc2
Bitfield< 7, 5 > opc2
Definition: types.hh:106
gem5::ArmISA::badMode
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.
Definition: utility.cc:397
system.hh
gem5::ArmISA::MISCREG_SCTLR
@ MISCREG_SCTLR
Definition: misc.hh:240
gem5::ArmISA::MISCREG_CNTVCT_EL0
@ MISCREG_CNTVCT_EL0
Definition: misc.hh:777
gem5::ArmISA::MISCREG_CNTPCT_EL0
@ MISCREG_CNTPCT_EL0
Definition: misc.hh:776
gem5::ArmISA::MISCREG_CNTP_CTL
@ MISCREG_CNTP_CTL
Definition: misc.hh:421
gem5::ThreadContext::cpuId
virtual int cpuId() const =0
cc.hh
gem5::ArmISA::MISCREG_JIDR
@ MISCREG_JIDR
Definition: misc.hh:204
gem5::ArmISA::AArch64AArch32SystemAccessTrap
Fault AArch64AArch32SystemAccessTrap(const MiscRegIndex misc_reg, ExtMachInst mach_inst, ThreadContext *tc, uint32_t imm, ExceptionClass ec)
Definition: utility.cc:777
gem5::ArmISA::truncPage
Addr truncPage(Addr addr)
Definition: utility.cc:483
gem5::ArmISA::MISCREG_ID_MMFR1
@ MISCREG_ID_MMFR1
Definition: misc.hh:221
gem5::ArmISA::ELUsingAArch32K
std::pair< bool, bool > ELUsingAArch32K(ThreadContext *tc, ExceptionLevel el)
This function checks whether selected EL provided as an argument is using the AArch32 ISA.
Definition: utility.cc:292
gem5::ArmISA::condGenericTimerCommonEL0SystemAccessTrapEL2
bool condGenericTimerCommonEL0SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1035
gem5::ArmISA::condGenericTimerSystemAccessTrapEL1
bool condGenericTimerSystemAccessTrapEL1(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:888
gem5::ArmISA::mcrMrc14TrapToHyp
bool mcrMrc14TrapToHyp(const MiscRegIndex misc_reg, ThreadContext *tc, uint32_t iss)
Definition: utility.cc:652
gem5::ArmISA::MISCREG_JMCR
@ MISCREG_JMCR
Definition: misc.hh:207
gem5::ArmISA::MISCREG_DACR
@ MISCREG_DACR
Definition: misc.hh:270
gem5::ArmISA::MISCREG_HCPTR
@ MISCREG_HCPTR
Definition: misc.hh:256
gem5::ArmISA::MISCREG_ID_ISAR0
@ MISCREG_ID_ISAR0
Definition: misc.hh:225
gem5::ArmISA::MISCREG_CNTKCTL_EL1
@ MISCREG_CNTKCTL_EL1
Definition: misc.hh:790
gem5::ArmISA::ec
ec
Definition: misc_types.hh:727
gem5::ArmISA::mcrMrc15Trap
Fault mcrMrc15Trap(const MiscRegIndex misc_reg, ExtMachInst mach_inst, ThreadContext *tc, uint32_t imm)
Definition: utility.cc:495
gem5::ArmISA::purifyTaggedAddr
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TCR tcr, bool is_instr)
Removes the tag from tagged addresses if that mode is enabled.
Definition: utility.cc:464
gem5::ArmISA::MISCREG_DBGDSAR
@ MISCREG_DBGDSAR
Definition: misc.hh:196
gem5::ArmISA::MISCREG_ID_MMFR2
@ MISCREG_ID_MMFR2
Definition: misc.hh:222
gem5::ArmISA::MISCREG_IFSR
@ MISCREG_IFSR
Definition: misc.hh:276
gem5::ArmISA::unknownMode32
static bool unknownMode32(OperatingMode mode)
Definition: types.hh:446
gem5::ArmISA::MISCREG_DTLBIASID
@ MISCREG_DTLBIASID
Definition: misc.hh:337
mmu.hh
gem5::ArmISA::isGenericTimerCommonEL0SystemAccessTrapEL2
bool isGenericTimerCommonEL0SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:963
gem5::ArmRelease::has
bool has(ArmExtension ext) const
Definition: system.hh:76
gem5::ArmISA::MISCREG_CNTHCTL_EL2
@ MISCREG_CNTHCTL_EL2
Definition: misc.hh:795
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::ArmISA::MISCREG_CNTVOFF
@ MISCREG_CNTVOFF
Definition: misc.hh:438
gem5::ArmISA::int_reg::regInMode
static int regInMode(OperatingMode mode, int reg)
Definition: int.hh:566
gem5::ArmISA::MISCREG_DTLBIMVA
@ MISCREG_DTLBIMVA
Definition: misc.hh:336
gem5::ArmISA::getAff1
static RegVal getAff1(ArmSystem *arm_sys, ThreadContext *tc)
Definition: utility.cc:200
gem5::ArmSystem::multiProc
bool multiProc
true if this a multiprocessor system
Definition: system.hh:154
gem5::ArmISA::MISCREG_PRRR
@ MISCREG_PRRR
Definition: misc.hh:374
gem5::ArmISA::getAff2
static RegVal getAff2(ArmSystem *arm_sys, ThreadContext *tc)
Definition: utility.cc:194
gem5::ArmISA::MISCREG_DBGDRAR
@ MISCREG_DBGDRAR
Definition: misc.hh:175
gem5::ArmSystem::highestEL
ArmISA::ExceptionLevel highestEL() const
Returns the highest implemented exception level.
Definition: system.hh:191
gem5::VecRegContainer
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition: vec_reg.hh:123
gem5::ThreadContext::socketId
virtual uint32_t socketId() const =0
interrupts.hh
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
gem5::ArmISA::MODE_HYP
@ MODE_HYP
Definition: types.hh:294
gem5::ArmISA::mcrrMrrc15Trap
Fault mcrrMrrc15Trap(const MiscRegIndex misc_reg, ExtMachInst mach_inst, ThreadContext *tc, uint32_t imm)
Definition: utility.cc:707
gem5::ArmISA::condGenericTimerPhysHypTrap
bool condGenericTimerPhysHypTrap(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:854
gem5::ArmISA::MISCREG_SCTLR_EL1
@ MISCREG_SCTLR_EL1
Definition: misc.hh:584
gem5::ArmISA::MISCREG_ID_ISAR2
@ MISCREG_ID_ISAR2
Definition: misc.hh:227
gem5::Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
gem5::ArmISA::MISCREG_HDCR
@ MISCREG_HDCR
Definition: misc.hh:255
gem5::ArmISA::MISCREG_ID_ISAR4
@ MISCREG_ID_ISAR4
Definition: misc.hh:229
gem5::PowerISA::ri
Bitfield< 1 > ri
Definition: misc.hh:125
gem5::ArmISA::roundPage
Addr roundPage(Addr addr)
Definition: utility.cc:489
gem5::ArmISA::rt
Bitfield< 15, 12 > rt
Definition: types.hh:115
gem5::ArmISA::MISCREG_MAIR1
@ MISCREG_MAIR1
Definition: misc.hh:383
gem5::ArmISA::EL2
@ EL2
Definition: types.hh:275
gem5::ArmISA::MISCREG_CNTPCT
@ MISCREG_CNTPCT
Definition: misc.hh:419
gem5::ArmISA::MISCREG_SPSR_IRQ
@ MISCREG_SPSR_IRQ
Definition: misc.hh:69
gem5::ArmISA::MISCREG_SCTLR_EL2
@ MISCREG_SCTLR_EL2
Definition: misc.hh:589
gem5::ArmISA::unknownMode
static bool unknownMode(OperatingMode mode)
Definition: types.hh:420
isa.hh
gem5::ArmISA::ELIs32
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:273
gem5::ArmISA::MISCREG_CCSIDR
@ MISCREG_CCSIDR
Definition: misc.hh:232
gem5::ArmISA::ExceptionClass::TRAPPED_CP15_MCR_MRC
@ TRAPPED_CP15_MCR_MRC
cpu.hh
gem5::ArmISA::syncVecElemsToRegs
void syncVecElemsToRegs(ThreadContext *tc)
Definition: utility.cc:1337
gem5::ArmISA::MISCREG_ICIALLUIS
@ MISCREG_ICIALLUIS
Definition: misc.hh:297
port_proxy.hh
gem5::ArmISA::MISCREG_DCCIMVAC
@ MISCREG_DCCIMVAC
Definition: misc.hh:322
gem5::ArmISA::tbid
Bitfield< 29 > tbid
Definition: misc_types.hh:595
gem5::ArmISA::EL2Enabled
bool EL2Enabled(ThreadContext *tc)
Definition: utility.cc:258
gem5::ArmISA::MISCREG_TEEHBR
@ MISCREG_TEEHBR
Definition: misc.hh:205
gem5::ArmISA::MISCREG_ACTLR
@ MISCREG_ACTLR
Definition: misc.hh:243
gem5::ArmISA::MISCREG_IFAR
@ MISCREG_IFAR
Definition: misc.hh:291
gem5::ArmISA::MISCREG_ICC_ASGI1R
@ MISCREG_ICC_ASGI1R
Definition: misc.hh:997
gem5::ArmISA::mask
Bitfield< 3, 0 > mask
Definition: pcstate.hh:63
gem5::ArmISA::MISCREG_ID_AFR0
@ MISCREG_ID_AFR0
Definition: misc.hh:219
gem5::bits
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
compiler.hh
gem5::ArmISA::SPAlignmentCheckEnabled
bool SPAlignmentCheckEnabled(ThreadContext *tc)
Definition: utility.cc:1255
gem5::ArmISA::EL3
@ EL3
Definition: types.hh:276
gem5::ArmISA::mcrMrc15TrapToHyp
bool mcrMrc15TrapToHyp(const MiscRegIndex misc_reg, ThreadContext *tc, uint32_t iss, ExceptionClass *ec)
Definition: utility.cc:505
gem5::ArmISA::ext
Bitfield< 12 > ext
Definition: misc_types.hh:485
gem5::ThreadContext::readMiscRegNoEffect
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
gem5::ArmISA::MODE_USER
@ MODE_USER
Definition: types.hh:288
gem5::ArmISA::MISCREG_DBGPRCR
@ MISCREG_DBGPRCR
Definition: misc.hh:195
std::pair
STL pair class.
Definition: stl.hh:58
gem5::ArmISA::MISCREG_ID_PFR1
@ MISCREG_ID_PFR1
Definition: misc.hh:217
gem5::ArmISA::s1TranslationRegime
ExceptionLevel s1TranslationRegime(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:229
faults.hh
gem5::ArmISA::debugTargetFrom
ExceptionLevel debugTargetFrom(ThreadContext *tc, bool secure)
Definition: utility.cc:93
gem5::BaseCPU::postInterrupt
void postInterrupt(ThreadID tid, int int_num, int index)
Definition: base.cc:231
gem5::ArmISA::MISCREG_ICC_SGI1R
@ MISCREG_ICC_SGI1R
Definition: misc.hh:1023
gem5::ArmISA::MISCREG_TCMTR
@ MISCREG_TCMTR
Definition: misc.hh:212
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ArmISA::MISCREG_TLBIMVA
@ MISCREG_TLBIMVA
Definition: misc.hh:339
gem5::ArmISA::MISCREG_DBGOSDLR
@ MISCREG_DBGOSDLR
Definition: misc.hh:194
gem5::ArmISA::MISCREG_DFSR
@ MISCREG_DFSR
Definition: misc.hh:273
gem5::ArmISA::MISCREG_NMRR
@ MISCREG_NMRR
Definition: misc.hh:380
gem5::ArmISA::MiscRegIndex
MiscRegIndex
Definition: misc.hh:64
gem5::ArmISA::MISCREG_CNTP_TVAL_EL0
@ MISCREG_CNTP_TVAL_EL0
Definition: misc.hh:780
gem5::ArmISA::MISCREG_TTBR1
@ MISCREG_TTBR1
Definition: misc.hh:262
gem5::ArmISA::isSecure
bool isSecure(ThreadContext *tc)
Definition: utility.cc:74
gem5::ArmISA::ELStateUsingAArch32K
std::pair< bool, bool > ELStateUsingAArch32K(ThreadContext *tc, ExceptionLevel el, bool secure)
Definition: utility.cc:313
gem5::ArmISA::vecRegClass
constexpr RegClass vecRegClass
Definition: vec.hh:101
utility.hh
gem5::ArmISA::ExceptionClass
ExceptionClass
Definition: types.hh:300
full_system.hh
gem5::ArmISA::MISCREG_MAIR0
@ MISCREG_MAIR0
Definition: misc.hh:377
gem5::ArmISA::currEL
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Definition: utility.cc:124
gem5::X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:92
gem5::X86ISA::ExtMachInst
Definition: types.hh:212
gem5::ArmISA::MISCREG_TLBIASIDIS
@ MISCREG_TLBIASIDIS
Definition: misc.hh:328
gem5::System::multiThread
const bool multiThread
Definition: system.hh:312
gem5::ArmSystem::has
bool has(ArmExtension ext) const
Definition: system.hh:158
gem5::ArmISA::MISCREG_AIDR
@ MISCREG_AIDR
Definition: misc.hh:234
gem5::ArmISA::MISCREG_ICC_SGI0R
@ MISCREG_ICC_SGI0R
Definition: misc.hh:1022
gem5::ArmISA::IsSecureEL2Enabled
bool IsSecureEL2Enabled(ThreadContext *tc)
Definition: utility.cc:244
gem5::ArmISA::MISCREG_AIFSR
@ MISCREG_AIFSR
Definition: misc.hh:282
gem5::ArmISA::MISCREG_DCIMVAC
@ MISCREG_DCIMVAC
Definition: misc.hh:307
gem5::ArmISA::EL0
@ EL0
Definition: types.hh:273
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:214
gem5::ArmISA::MISCREG_CTR
@ MISCREG_CTR
Definition: misc.hh:211
gem5::ArmSystem
Definition: system.hh:92
gem5::ArmISA::imm
Bitfield< 7, 0 > imm
Definition: types.hh:132
gem5::ArmISA::MISCREG_TEECR
@ MISCREG_TEECR
Definition: misc.hh:203
gem5::ArmISA::MISCREG_DTLBIALL
@ MISCREG_DTLBIALL
Definition: misc.hh:335
gem5::ArmISA::MISCREG_ADFSR
@ MISCREG_ADFSR
Definition: misc.hh:279
inform
#define inform(...)
Definition: logging.hh:257
gem5::ArmISA::syncVecRegsToElems
void syncVecRegsToElems(ThreadContext *tc)
Definition: utility.cc:1325
gem5::ArmISA::vecElemClass
constexpr RegClass vecElemClass
Definition: vec.hh:105
gem5::ArmISA::decodeMrsMsrBankedReg
bool decodeMrsMsrBankedReg(uint8_t sysM, bool r, bool &isIntReg, int &regIdx, CPSR cpsr, SCR scr, NSACR nsacr, bool checkSecurity)
Definition: utility.cc:1120
gem5::ArmISA::MISCREG_SPSR_SVC
@ MISCREG_SPSR_SVC
Definition: misc.hh:70
gem5::ArmISA::isUnpriviledgeAccess
bool isUnpriviledgeAccess(ThreadContext *tc)
Definition: utility.cc:1237
base.hh
gem5::ArmISA::VecElem
uint32_t VecElem
Definition: vec.hh:63
gem5::ArmISA::MISCREG_CLIDR
@ MISCREG_CLIDR
Definition: misc.hh:233
gem5::ArmISA::getAff0
static RegVal getAff0(ArmSystem *arm_sys, ThreadContext *tc)
Definition: utility.cc:206
gem5::ArmISA::isGenericTimerSystemAccessTrapEL3
bool isGenericTimerSystemAccessTrapEL3(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1104
gem5::ArmISA::MISCREG_TLBIMVAALIS
@ MISCREG_TLBIMVAALIS
Definition: misc.hh:331
gem5::ArmISA::sendEvent
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
Definition: utility.cc:65
gem5::ArmISA::ELStateUsingAArch32
bool ELStateUsingAArch32(ThreadContext *tc, ExceptionLevel el, bool secure)
Definition: utility.cc:365
gem5::ArmISA::ExceptionClass::TRAPPED_CP15_MCRR_MRRC
@ TRAPPED_CP15_MCRR_MRRC
gem5::ArmISA::ExceptionClass::UNKNOWN
@ UNKNOWN
gem5::ArmISA::MISCREG_DBGOSLSR
@ MISCREG_DBGOSLSR
Definition: misc.hh:193
gem5::ArmISA::longDescFormatInUse
bool longDescFormatInUse(ThreadContext *tc)
Definition: utility.cc:131
gem5::ArmISA::MISCREG_ID_PFR0
@ MISCREG_ID_PFR0
Definition: misc.hh:216
gem5::ArmISA::MODE_SYSTEM
@ MODE_SYSTEM
Definition: types.hh:296
gem5::ArmISA::PageBytes
const Addr PageBytes
Definition: page_size.hh:53
gem5::ArmISA::MISCREG_VMPIDR_EL2
@ MISCREG_VMPIDR_EL2
Definition: misc.hh:583
gem5::ArmISA::MISCREG_REVIDR
@ MISCREG_REVIDR
Definition: misc.hh:215
gem5::ArmISA::badMode32
bool badMode32(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented for AArch3...
Definition: utility.cc:391
gem5::ArmISA::MISCREG_SPSR_ABT
@ MISCREG_SPSR_ABT
Definition: misc.hh:72
gem5::ArmISA::MISCREG_ELR_HYP
@ MISCREG_ELR_HYP
Definition: misc.hh:75
gem5::ArmISA::haveAArch32EL
bool haveAArch32EL(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:299
gem5::ArmISA::isGenericTimerVirtSystemAccessTrapEL2
bool isGenericTimerVirtSystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1025
gem5::ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
gem5::ArmISA::MISCREG_SEV_MAILBOX
@ MISCREG_SEV_MAILBOX
Definition: misc.hh:96
gem5::ThreadContext::threadId
virtual int threadId() const =0
gem5::ArmISA::MISCREG_ID_ISAR6
@ MISCREG_ID_ISAR6
Definition: misc.hh:231
gem5::ArmISA::MISCREG_CNTP_TVAL_S
@ MISCREG_CNTP_TVAL_S
Definition: misc.hh:429
gem5::ArmISA::condGenericTimerPhysEL1SystemAccessTrapEL2
bool condGenericTimerPhysEL1SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1096
page_size.hh
gem5::ArmISA::MISCREG_CNTFRQ_EL0
@ MISCREG_CNTFRQ_EL0
Definition: misc.hh:775
gem5::ThreadContext::getIsaPtr
virtual BaseISA * getIsaPtr() const =0
gem5::RegIndex
uint16_t RegIndex
Definition: types.hh:176
gem5::ArmISA::MISCREG_TLBIMVAIS
@ MISCREG_TLBIMVAIS
Definition: misc.hh:327
gem5::ArmSystem::haveEL
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition: system.cc:132
gem5::ArmISA::MODE_ABORT
@ MODE_ABORT
Definition: types.hh:293
gem5::ArmISA::MISCREG_HCR_EL2
@ MISCREG_HCR_EL2
Definition: misc.hh:591
gem5::ArmISA::condGenericTimerCommonEL1SystemAccessTrapEL2
bool condGenericTimerCommonEL1SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:1062
gem5::ArmISA::MISCREG_TLBIASID
@ MISCREG_TLBIASID
Definition: misc.hh:340
gem5::ArmISA::MISCREG_TLBIMVAA
@ MISCREG_TLBIMVAA
Definition: misc.hh:341
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ArmISA::MISCREG_TLBIMVAAIS
@ MISCREG_TLBIMVAAIS
Definition: misc.hh:329
gem5::ArmISA::computeAddrTop
int computeAddrTop(ThreadContext *tc, bool selbit, bool is_instr, TCR tcr, ExceptionLevel el)
Definition: utility.cc:403
gem5::ArmISA::isGenericTimerPhysHypTrap
bool isGenericTimerPhysHypTrap(const MiscRegIndex misc_reg, ThreadContext *tc, ExceptionClass *ec)
Definition: utility.cc:847
gem5::ArmISA::MISCREG_CNTV_CTL
@ MISCREG_CNTV_CTL
Definition: misc.hh:430
gem5::ArmISA::isBigEndian64
bool isBigEndian64(const ThreadContext *tc)
Definition: utility.cc:373
gem5::ArmISA::isAArch64AArch32SystemAccessTrapEL1
bool isAArch64AArch32SystemAccessTrapEL1(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:791
gem5::ArmISA::ISA::getRelease
const ArmRelease * getRelease() const
Definition: isa.hh:192
gem5::ArmISA::MISCREG_ID_MMFR0
@ MISCREG_ID_MMFR0
Definition: misc.hh:220
int.hh
gem5::ArmISA::MISCREG_CPACR
@ MISCREG_CPACR
Definition: misc.hh:246
gem5::ArmISA::HaveExt
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Definition: utility.cc:222
gem5::ArmISA::MISCREG_SPSR_HYP
@ MISCREG_SPSR_HYP
Definition: misc.hh:73
gem5::ArmISA::eel2
Bitfield< 18 > eel2
Definition: misc_types.hh:369
gem5::ArmISA::isGenericTimerPhysEL0SystemAccessTrapEL2
bool isGenericTimerPhysEL0SystemAccessTrapEL2(const MiscRegIndex misc_reg, ThreadContext *tc)
Definition: utility.cc:976
thread_context.hh
gem5::ArmISA::OperatingMode
OperatingMode
Definition: types.hh:279
gem5::ArmISA::readMPIDR
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
gem5::ArmISA::MISCREG_ID_DFR0
@ MISCREG_ID_DFR0
Definition: misc.hh:218
gem5::ArmISA::MISCREG_ITLBIALL
@ MISCREG_ITLBIALL
Definition: misc.hh:332
gem5::ArmISA::unflattenMiscReg
int unflattenMiscReg(int reg)
Definition: misc.cc:723
gem5::ArmISA::getMPIDR
RegVal getMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
This helper function is returning the value of MPIDR_EL1.
Definition: utility.cc:164
gem5::ArmISA::MISCREG_TCR_EL1
@ MISCREG_TCR_EL1
Definition: misc.hh:607
gem5::RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:92
gem5::ArmISA::ExceptionLevel
ExceptionLevel
Definition: types.hh:271
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:188
gem5::ArmISA::mode
Bitfield< 4, 0 > mode
Definition: misc_types.hh:74
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::ArmISA::INT_SEV
@ INT_SEV
Definition: interrupts.hh:65
gem5::ArmISA::MISCREG_CNTV_TVAL_EL0
@ MISCREG_CNTV_TVAL_EL0
Definition: misc.hh:783
gem5::ThreadContext::setReg
virtual void setReg(const RegId &reg, RegVal val)
Definition: thread_context.cc:188
gem5::ArmISA::MISCREG_SPSR_UND
@ MISCREG_SPSR_UND
Definition: misc.hh:74

Generated on Sun Jul 30 2023 01:56:50 for gem5 by doxygen 1.8.17