gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
40
41#include "arch/arm/faults.hh"
43#include "base/bitfield.hh"
44
45namespace gem5
46{
47
48using namespace ArmISA;
49
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
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
107Fault
109{
110 if (to32) {
111 return std::make_shared<PrefetchAbort>(vaddr,
115 } else {
116 return std::make_shared<HardwareBreakpoint>(vaddr, 0x22);
117 }
118}
119
120Fault
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
140Fault
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
156bool
158 bool secure, bool mask)
159{
160 bool route_to_el2 = ArmSystem::haveEL(tc, EL2) &&
161 (!secure || HaveExt(tc, ArmExtension::FEAT_SEL2)) &&
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
176bool
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
203bool
205{
206 const DBGBCR ctr = getControlReg(tc);
207 return ((ctr.bt & 0x1) && enable) && test(tc, vaddr, el, ctr, true);
208}
209
210bool
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
322void
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
369bool
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
388bool
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
408bool
410{
411 return testContextMatch(tc, ctx1, ctx1);
412}
413
414bool
415BrkPoint::testContextMatch(ThreadContext *tc, bool ctx1, bool low_ctx)
416{
417 if (!isCntxtAware)
418 return false;
419 MiscRegIndex miscridx;
421 bool a32 = conf->isAArch32();
422
423 if (ctx1) {
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
438bool
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;
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
457bool
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
512vmid_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
522bool
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
568bool
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
588bool
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
632bool
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
664bool
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
void updateControl(DBGBCR val)
bool test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr, bool from_link)
bool testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el)
const DBGBCR getControlReg(ThreadContext *tc)
bool isEnabled(ThreadContext *tc, ExceptionLevel el, uint8_t hmc, uint8_t ssc, uint8_t pmc)
vmid_t getVMIDfromReg(ThreadContext *tc, bool vs)
MiscRegIndex valRegIndex
Definition self_debug.hh:65
bool testContextMatch(ThreadContext *tc, bool ctx1, bool low_ctx)
bool testAddrMissMatch(ThreadContext *tc, Addr pc, uint8_t bas)
bool testVMIDMatch(ThreadContext *tc)
RegVal getContextfromReg(ThreadContext *tc, bool ctxid1) const
bool testAddrMatch(ThreadContext *tc, Addr pc, uint8_t bas)
Addr getAddrfromReg(ThreadContext *tc) const
Definition self_debug.hh:95
Fault triggerException(ThreadContext *tc, Addr vaddr)
bool targetAArch32(ThreadContext *tc)
void setenableTDETGE(HCR hcr, HDCR mdcr)
Fault triggerWatchpointException(ThreadContext *tc, Addr vaddr, bool write, bool cm)
BrkPoint * getBrkPoint(uint8_t index)
static bool securityStateMatch(ThreadContext *tc, uint8_t ssc, bool hmc)
void init(ThreadContext *tc)
void updateOSLock(RegVal val)
void setMDSCRvals(RegVal val)
Fault testBreakPoints(ThreadContext *tc, Addr vaddr)
Definition self_debug.cc:74
Fault testDebug(ThreadContext *tc, const RequestPtr &req, BaseMMU::Mode mode)
Definition self_debug.cc:51
void setbSDD(RegVal val)
bool isDebugEnabled(ThreadContext *tc)
std::vector< BrkPoint > arBrkPoints
SoftwareStep * softStep
void setAArch32(ThreadContext *tc)
bool isDebugEnabledForEL64(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
Fault testWatchPoints(ThreadContext *tc, Addr vaddr, bool write, bool atomic, unsigned size, bool cm)
bool isDebugEnabledForEL32(ThreadContext *tc, ExceptionLevel el, bool secure, bool mask)
std::vector< WatchPoint > arWatchPoints
bool advanceSS(ThreadContext *tc)
bool debugExceptionReturnSS(ThreadContext *tc, CPSR spsr, ExceptionLevel dest)
static const uint8_t ACTIVE_NOT_PENDING_STATE
static const uint8_t INACTIVE_STATE
static const uint8_t ACTIVE_PENDING_STATE
void updateControl(DBGWCR val)
bool compareAddress(ThreadContext *tc, Addr in_addr, uint8_t bas, uint8_t mask, unsigned size)
bool isEnabled(ThreadContext *tc, ExceptionLevel el, bool hmc, uint8_t ssc, uint8_t pac)
Addr getAddrfromReg(ThreadContext *tc)
bool isDoubleAligned(Addr addr)
bool test(ThreadContext *tc, Addr addr, ExceptionLevel el, bool &wrt, bool atomic, unsigned size)
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition system.cc:132
Target & as()
Definition pcstate.hh:73
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual const PCStateBase & pcState() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
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:79
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
Bitfield< 23, 20 > atomic
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
Definition utility.cc:282
Bitfield< 28 > v
Definition misc_types.hh:54
Bitfield< 15, 14 > ssc
Bitfield< 13 > hmc
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:290
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
ExceptionLevel debugTargetFrom(ThreadContext *tc, bool secure)
Definition utility.cc:102
Bitfield< 4, 0 > mode
Definition misc_types.hh:74
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Definition utility.cc:133
bool isSecure(ThreadContext *tc)
Definition utility.cc:74
Bitfield< 7 > i
Definition misc_types.hh:67
bool ELStateUsingAArch32(ThreadContext *tc, ExceptionLevel el, bool secure)
Definition utility.cc:374
Bitfield< 36 > thumb
Definition types.hh:79
bool isSecureBelowEL3(ThreadContext *tc)
Definition utility.cc:86
Bitfield< 2, 1 > pmc
bool EL2Enabled(ThreadContext *tc)
Definition utility.cc:267
@ MISCREG_SDER
Definition misc.hh:250
@ MISCREG_CONTEXTIDR_EL1
Definition misc.hh:805
@ MISCREG_ID_AA64DFR0_EL1
Definition misc.hh:569
@ MISCREG_OSLAR_EL1
Definition misc.hh:534
@ MISCREG_DBGWVR0_EL1
Definition misc.hh:496
@ MISCREG_DBGBCR0_EL1
Definition misc.hh:480
@ MISCREG_ID_AA64MMFR1_EL1
Definition misc.hh:576
@ MISCREG_DBGBVR0_EL1
Definition misc.hh:464
@ MISCREG_CPSR
Definition misc.hh:67
@ MISCREG_CONTEXTIDR
Definition misc.hh:405
@ MISCREG_CONTEXTIDR_EL2
Definition misc.hh:877
@ MISCREG_MDSCR_EL1
Definition misc.hh:461
@ MISCREG_HCR_EL2
Definition misc.hh:595
@ MISCREG_ID_AA64MMFR2_EL1
Definition misc.hh:882
@ MISCREG_VTCR_EL2
Definition misc.hh:620
@ MISCREG_MDCR_EL2
Definition misc.hh:597
@ MISCREG_DBGWCR0_EL1
Definition misc.hh:512
@ MISCREG_VTTBR_EL2
Definition misc.hh:619
@ MISCREG_MDCR_EL3
Definition misc.hh:607
Bitfield< 12 > md
Bitfield< 3, 2 > el
Definition misc_types.hh:73
uint16_t vmid_t
Definition types.hh:57
Bitfield< 13 > cm
Bitfield< 2, 1 > pac
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Definition utility.cc:231
Bitfield< 19 > vs
Bitfield< 9 > d
Definition misc_types.hh:64
Bitfield< 8, 5 > bas
Bitfield< 4 > pc
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
std::shared_ptr< Request > RequestPtr
Definition request.hh:94
uint64_t RegVal
Definition types.hh:173
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
constexpr decltype(nullptr) NoFault
Definition types.hh:253

Generated on Tue Jun 18 2024 16:23:57 for gem5 by doxygen 1.11.0