gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
self_debug.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Arm Limited
3  * Copyright (c) 2019 Metempsy Technology LSC
4  * All rights reserved
5  *
6  * The license below extends only to copyright in the software and shall
7  * not be construed as granting a license to any other intellectual
8  * property including but not limited to intellectual property relating
9  * to a hardware implementation of the functionality of the software
10  * licensed hereunder. You may use the software subject to the license
11  * terms below provided that you ensure that this notice is replicated
12  * unmodified and in its entirety in all distributions of the software,
13  * modified or unmodified, in source code or in binary form.
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions are
17  * met: redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer;
19  * redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution;
22  * neither the name of the copyright holders nor the names of its
23  * contributors may be used to endorse or promote products derived from
24  * this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  */
38 
39 #include "arch/arm/self_debug.hh"
40 
41 #include "arch/arm/faults.hh"
43 #include "base/bitfield.hh"
44 
45 namespace gem5
46 {
47 
48 using namespace ArmISA;
49 
50 Fault
53 {
54  Fault fault = NoFault;
55 
56  if (mode == BaseMMU::Execute) {
57  const bool d_step = softStep->advanceSS(tc);
58  if (!d_step) {
59  fault = testBreakPoints(tc, req->getVaddr());
60  }
61  } else if (!req->isCacheMaintenance() ||
62  (req->isCacheInvalidate() && !req->isCacheClean())) {
63  bool md = mode == BaseMMU::Write ? true: false;
64  fault = testWatchPoints(tc, req->getVaddr(), md,
65  req->isAtomic(),
66  req->getSize(),
67  req->isCacheMaintenance());
68  }
69 
70  return fault;
71 }
72 
73 Fault
75 {
76  if (!mde)
77  return NoFault;
78 
79  setAArch32(tc);
80 
81  to32 = targetAArch32(tc);
82 
83  if (!isDebugEnabled(tc))
84  return NoFault;
85 
87  for (auto &p: arBrkPoints){
88  PCState pcst = tc->pcState().as<PCState>();
89  Addr pc = vaddr;
90  if (pcst.itstate() != 0x0)
91  pc = pcst.pc();
92  if (p.enable && p.isActive(pc) &&(!to32 || !p.onUse)) {
93  const DBGBCR ctr = p.getControlReg(tc);
94  if (p.isEnabled(tc, el, ctr.hmc, ctr.ssc, ctr.pmc)) {
95  if (p.test(tc, pc, el, ctr, false)) {
96  if (to32)
97  p.onUse = true;
98  return triggerException(tc, pc);
99  }
100  }
101  }
102  }
103  return NoFault;
104 }
105 
106 
107 Fault
109 {
110  if (to32) {
111  return std::make_shared<PrefetchAbort>(vaddr,
112  ArmFault::DebugEvent, false,
115  } else {
116  return std::make_shared<HardwareBreakpoint>(vaddr, 0x22);
117  }
118 }
119 
120 Fault
122  bool atomic, unsigned size, bool cm)
123 {
124  setAArch32(tc);
125  to32 = targetAArch32(tc);
126  if (!isDebugEnabled(tc) || !mde)
127  return NoFault;
128 
130  for (auto &p: arWatchPoints){
131  if (p.enable) {
132  if (p.test(tc, vaddr, el, write, atomic, size)) {
133  return triggerWatchpointException(tc, vaddr, write, cm);
134  }
135  }
136  }
137  return NoFault;
138 }
139 
140 Fault
142  bool write, bool cm)
143 {
144  if (to32) {
147  return std::make_shared<DataAbort>(vaddr,
149  write, ArmFault::DebugEvent, cm,
151  } else {
152  return std::make_shared<Watchpoint>(0, vaddr, write, cm);
153  }
154 }
155 
156 bool
158  bool secure, bool mask)
159 {
160  bool route_to_el2 = ArmSystem::haveEL(tc, EL2) &&
161  (!secure || HaveExt(tc, ArmExtension::FEAT_SEL2)) &&
162  enableTdeTge;
163 
164  ExceptionLevel target_el = route_to_el2 ? EL2 : EL1;
165  if (oslk || (sdd && secure && ArmSystem::haveEL(tc, EL3))) {
166  return false;
167  }
168 
169  if (el == target_el) {
170  return kde && !mask;
171  } else {
172  return target_el > el;
173  }
174 }
175 
176 bool
178  bool secure, bool mask)
179 {
180  if (el == EL0 && !ELStateUsingAArch32(tc, EL1, secure)) {
181  return isDebugEnabledForEL64(tc, el, secure, mask);
182  }
183 
184  if (oslk) {
185  return false;
186  }
187 
188  bool enabled;
189  if (secure && ArmSystem::haveEL(tc, EL3)) {
190  // We ignore the check for invasive External debug checking SPIDEN
191  // and DBGEN signals. They are not implemented
192  bool spd32 = bits(tc->readMiscReg(MISCREG_MDCR_EL3), 14);
193  enabled = spd32;
194 
195  bool suiden = bits(tc->readMiscReg(MISCREG_SDER), 0);
196  enabled = el == EL0 ? (enabled || suiden) : enabled;
197  } else {
198  enabled = el != EL2;
199  }
200  return enabled;
201 }
202 
203 bool
205 {
206  const DBGBCR ctr = getControlReg(tc);
207  return ((ctr.bt & 0x1) && enable) && test(tc, vaddr, el, ctr, true);
208 }
209 
210 bool
212  bool from_link)
213 {
214  bool v = false;
215  switch (ctr.bt) {
216  case 0x0:
217  v = testAddrMatch(tc, pc, ctr.bas);
218  break;
219 
220  case 0x1:
221  v = testAddrMatch(tc, pc, ctr.bas); // linked
222  if (v) {
223  v = (conf->getBrkPoint(ctr.lbn))->testLinkedBk(tc, pc, el);
224  }
225  break;
226 
227  case 0x2:
228  {
229  bool host = ELIsInHost(tc, el);
230  v = testContextMatch(tc, !host, true);
231  }
232  break;
233 
234  case 0x3:
235  if (from_link){
236  bool host = ELIsInHost(tc, el);
237  v = testContextMatch(tc, !host, true);
238  }
239  break;
240 
241  case 0x4:
242  v = testAddrMissMatch(tc, pc, ctr.bas);
243  break;
244 
245  case 0x5:
246  v = testAddrMissMatch(tc, pc, ctr.bas); // linked
247  if (v && !from_link)
248  v = v && (conf->getBrkPoint(ctr.lbn))->testLinkedBk(tc, pc, el);
249  break;
250 
251  case 0x6:
252  if (HaveExt(tc, ArmExtension::FEAT_VHE) && !ELIsInHost(tc, el))
253  v = testContextMatch(tc, true);
254  break;
255 
256  case 0x7:
257  if (HaveExt(tc, ArmExtension::FEAT_VHE) && !ELIsInHost(tc, el) &&
258  from_link)
259  v = testContextMatch(tc, true);
260  break;
261 
262  case 0x8:
263  if (EL2Enabled(tc) && !ELIsInHost(tc, el)) {
264  v = testVMIDMatch(tc);
265  }
266  break;
267 
268  case 0x9:
269  if (from_link && EL2Enabled(tc) && !ELIsInHost(tc, el)) {
270  v = testVMIDMatch(tc);
271  }
272  break;
273 
274  case 0xa:
275  if (EL2Enabled(tc) && !ELIsInHost(tc, el)) {
276  v = testContextMatch(tc, true);
277  if (v && !from_link)
278  v = v && testVMIDMatch(tc);
279  }
280  break;
281  case 0xb:
282  if (from_link && EL2Enabled(tc) && !ELIsInHost(tc, el)) {
283  v = testContextMatch(tc, true);
284  v = v && testVMIDMatch(tc);
285  }
286  break;
287 
288  case 0xc:
289  if (HaveExt(tc, ArmExtension::FEAT_VHE) &&
290  (!isSecure(tc)|| HaveExt(tc, ArmExtension::FEAT_SEL2)))
291  v = testContextMatch(tc, false);
292  break;
293 
294  case 0xd:
295  if (HaveExt(tc, ArmExtension::FEAT_VHE) && from_link &&
296  (!isSecure(tc)|| HaveExt(tc, ArmExtension::FEAT_SEL2))) {
297  v = testContextMatch(tc, false);
298  }
299  break;
300 
301  case 0xe:
302  if (HaveExt(tc, ArmExtension::FEAT_VHE) && !ELIsInHost(tc, el) &&
303  (!isSecure(tc)|| HaveExt(tc, ArmExtension::FEAT_SEL2))) {
304  v = testContextMatch(tc, true); // CONTEXTIDR_EL1
305  v = v && testContextMatch(tc, false); // CONTEXTIDR_EL2
306  }
307  break;
308  case 0xf:
309  if (HaveExt(tc, ArmExtension::FEAT_VHE) && !ELIsInHost(tc, el) &&
310  from_link &&
311  (!isSecure(tc)|| HaveExt(tc, ArmExtension::FEAT_SEL2))) {
312  v = testContextMatch(tc, true); // CONTEXTIDR_EL1
313  v = v && testContextMatch(tc, false); // CONTEXTIDR_EL2
314  }
315  break;
316  default:
317  break;
318  }
319  return v;
320 }
321 
322 void
324 {
325  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
326  aarch32 = cpsr.width == 1;
327 
328  const AA64DFR0 dfr = tc->readMiscReg(MISCREG_ID_AA64DFR0_EL1);
329  const AA64MMFR2 mm_fr2 = tc->readMiscReg(MISCREG_ID_AA64MMFR2_EL1);
330  const AA64MMFR1 mm_fr1 = tc->readMiscReg(MISCREG_ID_AA64MMFR1_EL1);
331 
332  for (int i = 0; i <= dfr.brps; i++) {
333  const bool isctxaw = i >= (dfr.brps - dfr.ctx_cmps);
334 
337  this, isctxaw, (bool)mm_fr2.varange,
338  mm_fr1.vmidbits, aarch32);
339  const DBGBCR ctr = tc->readMiscReg(MISCREG_DBGBCR0_EL1 + i);
340 
341  bkp.updateControl(ctr);
342  arBrkPoints.push_back(bkp);
343  }
344 
345  for (int i = 0; i <= dfr.wrps; i++) {
348  this, (bool)mm_fr2.varange, aarch32);
349  const DBGWCR ctr = tc->readMiscReg(MISCREG_DBGWCR0_EL1 + i);
350 
351  wtp.updateControl(ctr);
352  arWatchPoints.push_back(wtp);
353  }
354 
355  RegVal oslar_el1 = tc->readMiscReg(MISCREG_OSLAR_EL1);
356  updateOSLock(oslar_el1);
357  // Initialize preloaded control booleans
358  uint64_t mdscr_el1 = tc->readMiscReg(MISCREG_MDSCR_EL1);
359  setMDSCRvals(mdscr_el1);
360 
361  const uint64_t mdcr_el3 = tc->readMiscReg(MISCREG_MDCR_EL3);
362  setbSDD(mdcr_el3);
363 
364  const HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
365  const HDCR mdcr = tc->readMiscRegNoEffect(MISCREG_MDCR_EL2);
366  setenableTDETGE(hcr, mdcr);
367 }
368 
369 bool
371 {
372  Addr pc_tocmp = getAddrfromReg(tc);
373  Addr pc = bits(in_pc, maxAddrSize, 2);
374 
375  bool prs = true;
376  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
377  bool thumb = cpsr.t;
378 
379  if (thumb) {
380  if (bas == 0xc)
381  prs = bits(in_pc, 1, 0) == 0x2;
382  else if (bas == 0x3)
383  prs = bits(in_pc, 1, 0) == 0x0;
384  }
385  return (pc == pc_tocmp) && prs;
386 }
387 
388 bool
390 {
391  if (bas == 0x0)
392  return true;
393  Addr pc_tocmp = getAddrfromReg(tc);
394  Addr pc = bits(in_pc, maxAddrSize, 2);
395  bool prs = false;
396  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
397  bool thumb = cpsr.t;
398 
399  if (thumb) {
400  if (bas == 0xc)
401  prs = bits(in_pc, 1, 0) == 0x2;
402  else if (bas == 0x3)
403  prs = bits(in_pc, 1, 0) == 0x0;
404  }
405  return (pc != pc_tocmp) && !prs;
406 }
407 
408 bool
410 {
411  return testContextMatch(tc, ctx1, ctx1);
412 }
413 
414 bool
415 BrkPoint::testContextMatch(ThreadContext *tc, bool ctx1, bool low_ctx)
416 {
417  if (!isCntxtAware)
418  return false;
419  MiscRegIndex miscridx;
420  ExceptionLevel el = currEL(tc);
421  bool a32 = conf->isAArch32();
422 
423  if (ctx1) {
424  miscridx = a32? MISCREG_CONTEXTIDR : MISCREG_CONTEXTIDR_EL1;
425  if ((el == EL3 && !a32) || el == EL2)
426  return false;
427  } else {
428  miscridx = MISCREG_CONTEXTIDR_EL2;
429  if (el == EL2 && a32)
430  return false;
431  }
432 
433  RegVal ctxid = bits(tc->readMiscReg(miscridx), 31, 0);
434  RegVal v = getContextfromReg(tc, low_ctx);
435  return (v == ctxid);
436 }
437 
438 bool
440 {
441  const bool vs = ((VTCR_t)(tc->readMiscReg(MISCREG_VTCR_EL2))).vs;
442 
443  uint32_t vmid_index = 55;
444  if (VMID16enabled && vs)
445  vmid_index = 63;
446  ExceptionLevel el = currEL(tc);
447  if (el == EL2)
448  return false;
449 
450  vmid_t vmid = bits(tc->readMiscReg(MISCREG_VTTBR_EL2), vmid_index, 48);
451  vmid_t v = getVMIDfromReg(tc, vs);
452 
453  return (v == vmid);
454 }
455 
456 
457 bool
459  uint8_t hmc, uint8_t ssc, uint8_t pmc)
460 {
461  bool v;
462  bool aarch32 = conf->isAArch32();
463  bool no_el2 = !ArmSystem::haveEL(tc, EL2);
464  bool no_el3 = !ArmSystem::haveEL(tc, EL3);
465 
466  if (no_el3 && !no_el2 && (ssc == 0x1 || ssc == 0x2) &&
467  !(hmc && ssc == 0x1 && pmc == 0x0)) {
468  return false;
469  } else if (no_el3 && no_el2 && (hmc != 0x0 || ssc != 0x0) &&
470  !(!aarch32 && ((hmc && ssc == 0x1 && pmc == 0x0) || ssc == 0x3))) {
471  return false;
472  } else if (no_el2 && hmc && ssc == 0x3 && pmc == 0x0) {
473  return false;
474  } else if (ssc == 0x11 && pmc == 0x1 &&
475  !(!aarch32 && hmc && ssc == 0x3 && pmc == 0x0)) {
476  // AND secureEL2 not implemented
477  return false;
478  } else if (hmc && ssc == 0x1 && pmc == 0x0) {
479  //AND secureEL2 not implemented
480  return false;
481  }
482  switch (el) {
483  case EL0:
484  v = (pmc == 0x3) || (pmc == 0x2 && hmc == 0x0);
485  if (aarch32)
486  v = v || (pmc == 0x0 && ssc != 0x3 && hmc == 0x0);
487  if (v && ssc == 0x3)
488  panic("Unexpected EL in SelfDebug::isDebugEnabled.\n");
489  break;
490  case EL1:
491  v = (pmc == 0x3) || (pmc == 0x1);
492  if (aarch32)
493  v = v || (pmc == 0x0 && hmc == 0x0 && ssc !=0x3);
494  break;
495  case EL2:
496  v = (ssc == 0x3) ||
497  ((hmc == 0x1) && !((ssc == 0x2) && (pmc == 0x0)));
498  if (v && pmc == 0x2)
499  panic("Unexpected EL in SelfDebug::isDebugEnabled.\n");
500  break;
501  case EL3:
502  if (ssc == 0x1)
503  panic("Unexpected EL in SelfDebug::isDebugEnabled.\n");
504  v = (hmc == 0x1) & (ssc != 0x3);
505  break;
506  default:
507  panic("Unexpected EL %d in BrkPoint::isEnabled.\n", el);
508  }
509  return v && SelfDebug::securityStateMatch(tc, ssc, hmc || !aarch32);
510 }
511 
512 vmid_t
514 {
515  uint32_t vmid_index = 39;
516  if (VMID16enabled && vs)
517  vmid_index = 47;
518  return bits(tc->readMiscReg(valRegIndex), vmid_index, 32);
519 }
520 
521 
522 bool
524  bool hmc, uint8_t ssc, uint8_t pac)
525 {
526 
527  bool v;
528  bool aarch32 = conf->isAArch32();
529  bool no_el2 = !ArmSystem::haveEL(tc, EL2);
530  bool no_el3 = !ArmSystem::haveEL(tc, EL3);
531 
532  if (aarch32) {
533  // WatchPoint PL2 using aarch32 is disabled except for
534  // debug state. Check G2-5395 table G2-15.
535  if (el == EL2)
536  return false;
537  if (no_el3) {
538  if (ssc == 0x01 || ssc == 0x02 ){
539  return false;
540  } else if (no_el2 &&
541  ((!hmc && ssc == 0x3) || (hmc && ssc == 0x0))) {
542  return false;
543  }
544  }
545  if (no_el2 && hmc && ssc == 0x03 && pac == 0)
546  return false;
547  }
548  switch (el) {
549  case EL0:
550  v = (pac == 0x3 || (pac == 0x2 && !hmc && ssc != 0x3));
551  break;
552  case EL1:
553  v = (pac == 0x1 || pac == 0x3);
554  break;
555  case EL2:
556  v = (hmc && (ssc != 0x2 || pac != 0x0));
557  break;
558  case EL3:
559  v = (hmc && (ssc == 0x2 ||
560  (ssc == 0x1 && (pac == 0x1 || pac == 0x3))));
561  break;
562  default:
563  panic("Unexpected EL in WatchPoint::isEnabled.\n");
564  }
565  return v && SelfDebug::securityStateMatch(tc, ssc, hmc);
566 }
567 
568 bool
570  bool atomic, unsigned size)
571 {
572 
573  bool v = false;
574  const DBGWCR ctr = tc->readMiscReg(ctrlRegIndex);
575  if (isEnabled(tc, el, ctr.hmc, ctr.ssc, ctr.pac) &&
576  ((wrt && (ctr.lsv & 0x2)) || (!wrt && (ctr.lsv & 0x1)) || atomic)) {
577  v = compareAddress(tc, addr, ctr.bas, ctr.mask, size);
578  if (ctr.wt) {
579  v = v && (conf->getBrkPoint(ctr.lbn))->testLinkedBk(tc, addr, el);
580  }
581  }
582  if (atomic && (ctr.lsv & 0x1)) {
583  wrt = false;
584  }
585  return v;
586 }
587 
588 bool
590  uint8_t mask, unsigned size)
591 {
592  Addr addr_tocmp = getAddrfromReg(tc);
593  int maxbits = isDoubleAligned(addr_tocmp) ? 4: 8;
594  int bottom = isDoubleAligned(addr_tocmp) ? 2: 3;
595  Addr addr = bits(in_addr, maxAddrSize, 0);
596 
597  if (bas == 0x0)
598  return false;
599 
600  if (mask == 0x0) {
601  for (int i = 0; i < maxbits; i++) {
602  uint8_t bas_m = 0x1 << i;
603  uint8_t masked_bas = bas & bas_m;
604  if (masked_bas == bas_m) {
605  uint8_t off = log2(masked_bas);
606  Addr cmpaddr = addr_tocmp | off;
607  for (int j = 0; j < size; j++) {
608  if ((addr + j) == cmpaddr) {
609  return true;
610  }
611  }
612  }
613  }
614  return false;
615  } else {
616  bool v = false;
617  for (int j = 0; j < size; j++) {
618  Addr compaddr;
619  if (mask > bottom) {
620  addr = bits((in_addr+j), maxAddrSize, mask);
621  compaddr = bits(addr_tocmp, maxAddrSize, mask);
622  } else {
623  addr = bits((in_addr+j), maxAddrSize, bottom);
624  compaddr = bits(addr_tocmp, maxAddrSize, bottom);
625  }
626  v = v || (addr == compaddr);
627  }
628  return v;
629  }
630 }
631 
632 bool
634  ExceptionLevel dest)
635 {
636  bool SS_bit = false;
637  bool enabled_src = false;
638  if (bSS) {
639  enabled_src = conf->isDebugEnabled(tc);
640 
641  bool enabled_dst = false;
642  bool secure = isSecureBelowEL3(tc) || dest == EL3;
643  if (spsr.width) {
644  enabled_dst = conf->isDebugEnabledForEL32(tc, dest, secure,
645  spsr.d == 1);
646  } else {
647  enabled_dst = conf->isDebugEnabledForEL64(tc, dest, secure,
648  spsr.d == 1);
649  }
650  ExceptionLevel ELd = debugTargetFrom(tc, secure);
651 
652  if (!ELIs32(tc, ELd) && !enabled_src && enabled_dst) {
653  SS_bit = spsr.ss;
654  if (SS_bit == 0x0) {
656  } else {
658  }
659  }
660  }
661  return SS_bit;
662 }
663 
664 bool
666 {
667  PCState pc = tc->pcState().as<PCState>();
668  bool res = false;
669  switch (stateSS) {
670  case INACTIVE_STATE:
671  pc.debugStep(false);
672  break;
673 
675  pc.debugStep(false);
676  if (cpsrD == 1 || !bSS) {
678  } else {
679  pc.stepped(true);
681  tc->pcState(pc);
682  }
683  break;
684 
686  if (!cpsrD && bSS) {
687  pc.debugStep(true);
688  res = true;
689  tc->pcState(pc);
690  }
692  clearLdx();
693  break;
694 
695  default:
696  break;
697  }
698  return res;
699 }
700 
701 } // namespace gem5
gem5::ArmISA::SelfDebug::testWatchPoints
Fault testWatchPoints(ThreadContext *tc, Addr vaddr, bool write, bool atomic, unsigned size, bool cm)
Definition: self_debug.cc:121
gem5::ArmISA::WatchPoint::updateControl
void updateControl(DBGWCR val)
Definition: self_debug.hh:184
gem5::ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: misc.hh:66
gem5::GenericISA::PCStateWithNext::pc
Addr pc() const
Definition: pcstate.hh:263
gem5::ArmISA::pmc
Bitfield< 2, 1 > pmc
Definition: misc_types.hh:853
gem5::ArmISA::SelfDebug::setenableTDETGE
void setenableTDETGE(HCR hcr, HDCR mdcr)
Definition: self_debug.hh:357
gem5::ArmISA::SelfDebug::init
void init(ThreadContext *tc)
Definition: self_debug.cc:323
gem5::ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
gem5::NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:253
gem5::ArmISA::MISCREG_MDCR_EL3
@ MISCREG_MDCR_EL3
Definition: misc.hh:602
gem5::ArmISA::WatchPoint::isDoubleAligned
bool isDoubleAligned(Addr addr)
Definition: self_debug.hh:178
gem5::RegVal
uint64_t RegVal
Definition: types.hh:173
gem5::ArmISA::BrkPoint::test
bool test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr, bool from_link)
Definition: self_debug.cc:211
gem5::ArmISA::SoftwareStep::ACTIVE_PENDING_STATE
static const uint8_t ACTIVE_PENDING_STATE
Definition: self_debug.hh:199
gem5::ArmISA::ArmFault::BRKPOINT
@ BRKPOINT
Definition: faults.hh:160
gem5::ArmISA::el
Bitfield< 3, 2 > el
Definition: misc_types.hh:73
gem5::ArmISA::MISCREG_CONTEXTIDR
@ MISCREG_CONTEXTIDR
Definition: misc.hh:404
gem5::ArmISA::BrkPoint::getContextfromReg
RegVal getContextfromReg(ThreadContext *tc, bool ctxid1) const
Definition: self_debug.hh:101
gem5::ArmISA::BrkPoint::testVMIDMatch
bool testVMIDMatch(ThreadContext *tc)
Definition: self_debug.cc:439
gem5::ArmISA::WatchPoint::ctrlRegIndex
MiscRegIndex ctrlRegIndex
Definition: self_debug.hh:150
gem5::ArmISA::SoftwareStep::cpsrD
bool cpsrD
Definition: self_debug.hh:207
gem5::ArmISA::SelfDebug::to32
bool to32
Definition: self_debug.hh:257
gem5::ArmISA::MISCREG_MDCR_EL2
@ MISCREG_MDCR_EL2
Definition: misc.hh:593
gem5::ArmISA::SelfDebug::arBrkPoints
std::vector< BrkPoint > arBrkPoints
Definition: self_debug.hh:245
gem5::ArmISA::SoftwareStep::clearLdx
void clearLdx()
Definition: self_debug.hh:229
gem5::BaseMMU::Mode
Mode
Definition: mmu.hh:56
gem5::PCStateBase::as
Target & as()
Definition: pcstate.hh:72
gem5::BaseMMU::Write
@ Write
Definition: mmu.hh:56
gem5::ArmISA::TlbEntry::DomainType::NoAccess
@ NoAccess
gem5::ThreadContext::pcState
virtual const PCStateBase & pcState() const =0
gem5::ArmISA::BrkPoint::testAddrMissMatch
bool testAddrMissMatch(ThreadContext *tc, Addr pc, uint8_t bas)
Definition: self_debug.cc:389
gem5::ArmISA::SelfDebug::isDebugEnabledForEL64
bool isDebugEnabledForEL64(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
Definition: self_debug.cc:157
gem5::ArmISA::SoftwareStep::bSS
bool bSS
Definition: self_debug.hh:202
gem5::ArmISA::isSecureBelowEL3
bool isSecureBelowEL3(ThreadContext *tc)
Definition: utility.cc:86
gem5::ArmISA::vmid_t
uint16_t vmid_t
Definition: types.hh:57
gem5::ArmISA::SelfDebug::updateOSLock
void updateOSLock(RegVal val)
Definition: self_debug.hh:363
gem5::ArmISA::SelfDebug::targetAArch32
bool targetAArch32(ThreadContext *tc)
Definition: self_debug.hh:410
gem5::ArmISA::MISCREG_CONTEXTIDR_EL1
@ MISCREG_CONTEXTIDR_EL1
Definition: misc.hh:767
gem5::ArmISA::bas
Bitfield< 8, 5 > bas
Definition: misc_types.hh:851
gem5::ArmISA::EL1
@ EL1
Definition: types.hh:274
gem5::ArmISA::ArmFault::DebugEvent
@ DebugEvent
Definition: faults.hh:105
gem5::ArmISA::SoftwareStep::debugExceptionReturnSS
bool debugExceptionReturnSS(ThreadContext *tc, CPSR spsr, ExceptionLevel dest)
Definition: self_debug.cc:633
gem5::ArmISA::SelfDebug::aarch32
bool aarch32
Definition: self_debug.hh:256
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::SelfDebug::sdd
bool sdd
Definition: self_debug.hh:252
gem5::ArmISA::SoftwareStep::advanceSS
bool advanceSS(ThreadContext *tc)
Definition: self_debug.cc:665
gem5::ArmISA::SelfDebug::testBreakPoints
Fault testBreakPoints(ThreadContext *tc, Addr vaddr)
Definition: self_debug.cc:74
gem5::ArmISA::SelfDebug::isDebugEnabledForEL32
bool isDebugEnabledForEL32(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
Definition: self_debug.cc:177
gem5::ArmISA::BrkPoint::testAddrMatch
bool testAddrMatch(ThreadContext *tc, Addr pc, uint8_t bas)
Definition: self_debug.cc:370
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::PowerISA::PCState
Definition: pcstate.hh:42
gem5::ArmISA::SelfDebug::isAArch32
bool isAArch32() const
Definition: self_debug.hh:387
gem5::ArmISA::BrkPoint::valRegIndex
MiscRegIndex valRegIndex
Definition: self_debug.hh:65
gem5::ArmISA::SelfDebug::mde
bool mde
Definition: self_debug.hh:251
gem5::ArmISA::SelfDebug::testDebug
Fault testDebug(ThreadContext *tc, const RequestPtr &req, BaseMMU::Mode mode)
Definition: self_debug.cc:51
gem5::ArmISA::md
Bitfield< 12 > md
Definition: misc_types.hh:909
gem5::ArmISA::MISCREG_VTCR_EL2
@ MISCREG_VTCR_EL2
Definition: misc.hh:612
gem5::BaseMMU::Execute
@ Execute
Definition: mmu.hh:56
gem5::ArmISA::WatchPoint
Definition: self_debug.hh:147
gem5::ArmISA::atomic
Bitfield< 23, 20 > atomic
Definition: misc_types.hh:122
gem5::ArmISA::MISCREG_DBGBVR0_EL1
@ MISCREG_DBGBVR0_EL1
Definition: misc.hh:463
gem5::ArmISA::SelfDebug::setbSDD
void setbSDD(RegVal val)
Definition: self_debug.hh:337
gem5::ArmISA::BrkPoint::testContextMatch
bool testContextMatch(ThreadContext *tc, bool ctx1, bool low_ctx)
Definition: self_debug.cc:415
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::ArmISA::BrkPoint::getAddrfromReg
Addr getAddrfromReg(ThreadContext *tc) const
Definition: self_debug.hh:95
gem5::ArmISA::BrkPoint::isCntxtAware
bool isCntxtAware
Definition: self_debug.hh:67
gem5::ArmISA::SelfDebug::triggerException
Fault triggerException(ThreadContext *tc, Addr vaddr)
Definition: self_debug.cc:108
bitfield.hh
gem5::ArmISA::SelfDebug::setMDSCRvals
void setMDSCRvals(RegVal val)
Definition: self_debug.hh:343
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
gem5::ArmISA::WatchPoint::getAddrfromReg
Addr getAddrfromReg(ThreadContext *tc)
Definition: self_debug.hh:172
gem5::ArmISA::MISCREG_ID_AA64MMFR2_EL1
@ MISCREG_ID_AA64MMFR2_EL1
Definition: misc.hh:844
gem5::Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
gem5::ArmISA::SoftwareStep::INACTIVE_STATE
static const uint8_t INACTIVE_STATE
Definition: self_debug.hh:198
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::ArmISA::BrkPoint::getControlReg
const DBGBCR getControlReg(ThreadContext *tc)
Definition: self_debug.hh:120
gem5::ArmISA::BrkPoint::testLinkedBk
bool testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el)
Definition: self_debug.cc:204
gem5::ArmISA::WatchPoint::test
bool test(ThreadContext *tc, Addr addr, ExceptionLevel el, bool &wrt, bool atomic, unsigned size)
Definition: self_debug.cc:569
gem5::ArmISA::d
Bitfield< 9 > d
Definition: misc_types.hh:64
gem5::ArmISA::hmc
Bitfield< 13 > hmc
Definition: misc_types.hh:849
gem5::ArmISA::EL2
@ EL2
Definition: types.hh:275
misc_types.hh
gem5::ArmISA::ELIs32
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition: utility.cc:273
gem5::ArmISA::v
Bitfield< 28 > v
Definition: misc_types.hh:54
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::ArmISA::MISCREG_DBGWVR0_EL1
@ MISCREG_DBGWVR0_EL1
Definition: misc.hh:495
gem5::ArmISA::SoftwareStep::ACTIVE_NOT_PENDING_STATE
static const uint8_t ACTIVE_NOT_PENDING_STATE
Definition: self_debug.hh:200
gem5::ArmISA::SelfDebug::securityStateMatch
static bool securityStateMatch(ThreadContext *tc, uint8_t ssc, bool hmc)
Definition: self_debug.hh:293
gem5::ArmISA::EL2Enabled
bool EL2Enabled(ThreadContext *tc)
Definition: utility.cc:258
gem5::ArmISA::ArmFault::WPOINT_NOCM
@ WPOINT_NOCM
Definition: faults.hh:163
gem5::ArmISA::mask
Bitfield< 3, 0 > mask
Definition: pcstate.hh:63
gem5::ArmISA::SelfDebug::softStep
SoftwareStep * softStep
Definition: self_debug.hh:247
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
gem5::ArmISA::BrkPoint::VMID16enabled
bool VMID16enabled
Definition: self_debug.hh:68
gem5::ArmISA::EL3
@ EL3
Definition: types.hh:276
gem5::ArmISA::SoftwareStep::stateSS
int stateSS
Definition: self_debug.hh:203
gem5::ArmISA::SoftwareStep::conf
SelfDebug * conf
Definition: self_debug.hh:204
gem5::ThreadContext::readMiscRegNoEffect
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
gem5::ArmISA::MISCREG_ID_AA64DFR0_EL1
@ MISCREG_ID_AA64DFR0_EL1
Definition: misc.hh:568
faults.hh
gem5::ArmISA::WatchPoint::isEnabled
bool isEnabled(ThreadContext *tc, ExceptionLevel el, bool hmc, uint8_t ssc, uint8_t pac)
Definition: self_debug.cc:523
gem5::ArmISA::MISCREG_ID_AA64MMFR1_EL1
@ MISCREG_ID_AA64MMFR1_EL1
Definition: misc.hh:575
gem5::ArmISA::debugTargetFrom
ExceptionLevel debugTargetFrom(ThreadContext *tc, bool secure)
Definition: utility.cc:93
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_DBGBCR0_EL1
@ MISCREG_DBGBCR0_EL1
Definition: misc.hh:479
gem5::ArmISA::MiscRegIndex
MiscRegIndex
Definition: misc.hh:64
gem5::ArmISA::WatchPoint::conf
SelfDebug * conf
Definition: self_debug.hh:152
gem5::ArmISA::isSecure
bool isSecure(ThreadContext *tc)
Definition: utility.cc:74
gem5::ArmISA::SelfDebug::enableTdeTge
bool enableTdeTge
Definition: self_debug.hh:249
gem5::ArmISA::pac
Bitfield< 2, 1 > pac
Definition: misc_types.hh:867
gem5::ArmISA::MISCREG_SDER
@ MISCREG_SDER
Definition: misc.hh:249
gem5::ArmISA::currEL
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Definition: utility.cc:124
gem5::ArmISA::BrkPoint::enable
bool enable
Definition: self_debug.hh:70
gem5::ArmISA::MISCREG_DBGWCR0_EL1
@ MISCREG_DBGWCR0_EL1
Definition: misc.hh:511
gem5::ArmISA::BrkPoint
Definition: self_debug.hh:61
gem5::ArmISA::BrkPoint::getVMIDfromReg
vmid_t getVMIDfromReg(ThreadContext *tc, bool vs)
Definition: self_debug.cc:513
gem5::ArmISA::EL0
@ EL0
Definition: types.hh:273
gem5::ArmISA::WatchPoint::maxAddrSize
int maxAddrSize
Definition: self_debug.hh:154
gem5::ArmISA::SelfDebug::isDebugEnabled
bool isDebugEnabled(ThreadContext *tc)
Definition: self_debug.hh:323
gem5::ArmISA::SelfDebug::getBrkPoint
BrkPoint * getBrkPoint(uint8_t index)
Definition: self_debug.hh:287
gem5::ArmISA::MISCREG_VTTBR_EL2
@ MISCREG_VTTBR_EL2
Definition: misc.hh:611
gem5::ArmISA::SelfDebug::arWatchPoints
std::vector< WatchPoint > arWatchPoints
Definition: self_debug.hh:246
gem5::ArmISA::ArmFault::WPOINT_CM
@ WPOINT_CM
Definition: faults.hh:162
gem5::ArmISA::ELStateUsingAArch32
bool ELStateUsingAArch32(ThreadContext *tc, ExceptionLevel el, bool secure)
Definition: utility.cc:365
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::ArmISA::ArmFault::DebugType
DebugType
Definition: faults.hh:157
gem5::ArmISA::vs
Bitfield< 19 > vs
Definition: misc_types.hh:627
gem5::ArmISA::SelfDebug::oslk
bool oslk
Definition: self_debug.hh:254
gem5::ArmISA::cm
Bitfield< 13 > cm
Definition: misc_types.hh:486
gem5::ArmISA::SelfDebug::kde
bool kde
Definition: self_debug.hh:253
gem5::ArmISA::MISCREG_CONTEXTIDR_EL2
@ MISCREG_CONTEXTIDR_EL2
Definition: misc.hh:839
gem5::MipsISA::vaddr
vaddr
Definition: pra_constants.hh:278
gem5::ArmISA::SelfDebug::enabled
bool enabled() const
Definition: self_debug.hh:284
gem5::ArmISA::thumb
Bitfield< 36 > thumb
Definition: types.hh:79
gem5::ArmISA::ssc
Bitfield< 15, 14 > ssc
Definition: misc_types.hh:848
gem5::ArmISA::BrkPoint::conf
SelfDebug * conf
Definition: self_debug.hh:66
self_debug.hh
gem5::ArmISA::BrkPoint::updateControl
void updateControl(DBGBCR val)
Definition: self_debug.hh:141
gem5::ArmISA::BrkPoint::isEnabled
bool isEnabled(ThreadContext *tc, ExceptionLevel el, uint8_t hmc, uint8_t ssc, uint8_t pmc)
Definition: self_debug.cc:458
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::MISCREG_HCR_EL2
@ MISCREG_HCR_EL2
Definition: misc.hh:591
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ArmISA::BrkPoint::maxAddrSize
int maxAddrSize
Definition: self_debug.hh:71
gem5::ArmISA::MISCREG_MDSCR_EL1
@ MISCREG_MDSCR_EL1
Definition: misc.hh:460
gem5::ArmISA::SelfDebug::triggerWatchpointException
Fault triggerWatchpointException(ThreadContext *tc, Addr vaddr, bool write, bool cm)
Definition: self_debug.cc:141
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::WatchPoint::compareAddress
bool compareAddress(ThreadContext *tc, Addr in_addr, uint8_t bas, uint8_t mask, unsigned size)
Definition: self_debug.cc:589
gem5::ArmISA::ArmFault::UnknownTran
@ UnknownTran
Definition: faults.hh:154
gem5::ArmISA::MISCREG_OSLAR_EL1
@ MISCREG_OSLAR_EL1
Definition: misc.hh:533
gem5::ArmISA::SelfDebug::setAArch32
void setAArch32(ThreadContext *tc)
Definition: self_debug.hh:393
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

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