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

Generated on Tue Mar 23 2021 19:41:20 for gem5 by doxygen 1.8.17