gem5 v24.1.0.1
Loading...
Searching...
No Matches
misc64.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2013,2017-2024 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
39#include "arch/arm/isa.hh"
40
41#include "arch/arm/tlbi_op.hh"
42#include "debug/MiscRegs.hh"
43
44namespace gem5
45{
46
47using namespace ArmISA;
48
49std::string
51{
52 std::stringstream ss;
53 printMnemonic(ss, "", false);
54 ccprintf(ss, "#0x%x", imm);
55 return ss.str();
56}
57
58std::string
60{
61 std::stringstream ss;
62 printMnemonic(ss, "", false);
64 return ss.str();
65}
66
67std::string
69{
70 std::stringstream ss;
71 printMnemonic(ss, "", false);
73 ccprintf(ss, "#0x%x", imm1);
74 ss << ", ";
75 ccprintf(ss, "#0x%x", imm2);
76 return ss.str();
77}
78
79std::string
81 Addr pc, const loader::SymbolTable *symtab) const
82{
83 std::stringstream ss;
84 printMnemonic(ss, "", false);
86 ss << ", ";
88 ccprintf(ss, ", #%d, #%d", imm1, imm2);
89 return ss.str();
90}
91
92std::string
94 Addr pc, const loader::SymbolTable *symtab) const
95{
96 std::stringstream ss;
97 printMnemonic(ss, "", false);
99 ss << ", ";
101 ss << ", ";
103 ccprintf(ss, ", #%d", imm);
104 return ss.str();
105}
106
107std::string
109 Addr pc, const loader::SymbolTable *symtab) const
110{
111 return csprintf("%-10s (inst %#08x)", "unknown", encoding());
112}
113
114uint32_t
115MiscRegOp64::_iss(const MiscRegNum64 &misc_reg, RegIndex int_index) const
116{
117 return _miscRead |
118 (misc_reg.crm << 1) |
119 (int_index << 5) |
120 (misc_reg.crn << 10) |
121 (misc_reg.op1 << 14) |
122 (misc_reg.op2 << 17) |
123 (misc_reg.op0 << 20);
124}
125
126Fault
128{
129 return generateTrap(el, ExceptionClass::TRAPPED_MSR_MRS_64, iss());
130}
131
132RegVal
134{
135 switch (dest) {
136 case MISCREG_SPSEL:
137 return imm & 0x1;
138 case MISCREG_PAN:
139 return (imm & 0x1) << 22;
140 case MISCREG_UAO:
141 return (imm & 0x1) << 23;
142 default:
143 panic("Not a valid PSTATE field register\n");
144 }
145}
146
147std::string
149 Addr pc, const loader::SymbolTable *symtab) const
150{
151 std::stringstream ss;
154 ss << ", ";
155 ccprintf(ss, "#0x%x", imm);
156 return ss.str();
157}
158
159std::string
161 Addr pc, const loader::SymbolTable *symtab) const
162{
163 std::stringstream ss;
166 ss << ", ";
168 return ss.str();
169}
170
171uint32_t
173{
174 const auto misc_reg = encodeAArch64SysReg(dest);
175 assert(misc_reg.has_value());
176 return _iss(misc_reg.value(), op1);
177}
178
179std::string
181 Addr pc, const loader::SymbolTable *symtab) const
182{
183 std::stringstream ss;
186 ss << ", ";
188 return ss.str();
189}
190
191uint32_t
193{
194 const auto misc_reg = encodeAArch64SysReg(op1);
195 assert(misc_reg.has_value());
196 return _iss(misc_reg.value(), dest);
197}
198
199Fault
201 trace::InstRecord *traceData) const
202{
203 auto tc = xc->tcBase();
204 const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
205
207 MISCREG_IMPDEF_UNIMPL, cpsr, tc, *this);
208}
209
210std::string
212 Addr pc, const loader::SymbolTable *symtab) const
213{
214 return csprintf("%-10s (implementation defined)", fullMnemonic.c_str());
215}
216
217uint32_t
219{
220 return _iss(miscReg, intReg);
221}
222
223std::string
225 Addr pc, const loader::SymbolTable *symtab) const
226{
227 std::stringstream ss;
230 return ss.str();
231}
232
233void
235 SecurityState ss, TranslationRegime regime, bool shareable,
236 TlbiAttr attrs)
237{
238 TLBIALLEL tlbi_op(regime, ss, attrs);
239 if (shareable) {
240 tlbi_op.broadcast(tc);
241 } else {
242 tlbi_op(tc);
243 }
244}
245
246void
248 SecurityState ss, TranslationRegime regime, bool shareable,
249 bool stage2, TlbiAttr attrs)
250{
251 TLBIVMALL tlbi_op(regime, ss, stage2, attrs);
252 if (shareable) {
253 tlbi_op.broadcast(tc);
254 } else {
255 tlbi_op(tc);
256 }
257}
258
259void
261 SecurityState ss, TranslationRegime regime, bool shareable,
262 bool last_level, TlbiAttr attrs)
263{
264 if (MMU::hasUnprivRegime(regime)) {
265 // The asid will only be used when e2h == 1
266 bool asid_16bits = ArmSystem::haveLargeAsid64(tc);
267 auto asid = asid_16bits ? bits(value, 63, 48) :
268 bits(value, 55, 48);
269
270 TLBIMVA tlbi_op(regime, ss, static_cast<Addr>(bits(value, 43, 0)) << 12,
271 asid, last_level, attrs);
272 if (shareable) {
273 tlbi_op.broadcast(tc);
274 } else {
275 tlbi_op(tc);
276 }
277 } else {
278 TLBIMVAA tlbi_op(regime, ss,
279 static_cast<Addr>(bits(value, 43, 0)) << 12, last_level,
280 attrs);
281 if (shareable) {
282 tlbi_op.broadcast(tc);
283 } else {
284 tlbi_op(tc);
285 }
286 }
287}
288
289void
291 SecurityState ss, TranslationRegime regime, bool shareable,
292 bool last_level, TlbiAttr attrs)
293{
294 TLBIMVAA tlbi_op(regime, ss,
295 static_cast<Addr>(bits(value, 43, 0)) << 12, last_level,
296 attrs);
297 if (shareable) {
298 tlbi_op.broadcast(tc);
299 } else {
300 tlbi_op(tc);
301 }
302}
303
304void
306 SecurityState ss, TranslationRegime regime, bool shareable,
307 TlbiAttr attrs)
308{
309 bool asid_16bits = ArmSystem::haveLargeAsid64(tc);
310 auto asid = asid_16bits ? bits(value, 63, 48) :
311 bits(value, 55, 48);
312
313 TLBIASID tlbi_op(regime, ss, asid, attrs);
314 if (shareable) {
315 tlbi_op.broadcast(tc);
316 } else {
317 tlbi_op(tc);
318 }
319}
320
321void
323 SecurityState ss, TranslationRegime regime, bool shareable,
324 bool last_level, TlbiAttr attrs)
325{
326 if (EL2Enabled(tc)) {
327 TLBIIPA tlbi_op(tc, TranslationRegime::EL10, ss, value,
328 last_level, attrs);
329
330 if (shareable) {
331 tlbi_op.broadcast(tc);
332 } else {
333 tlbi_op(tc);
334 }
335 }
336}
337
338void
340 SecurityState ss, TranslationRegime regime, bool shareable,
341 bool last_level, TlbiAttr attrs)
342{
343 TLBIRMVAA tlbi_op(regime, ss, value, last_level, attrs);
344 if (shareable) {
345 tlbi_op.broadcast(tc);
346 } else {
347 tlbi_op(tc);
348 }
349}
350
351void
353 SecurityState ss, TranslationRegime regime, bool shareable, bool last_level,
354 TlbiAttr attrs)
355{
356 if (MMU::hasUnprivRegime(regime)) {
357 // The asid will only be used when e2h == 1
358 bool asid_16bits = ArmSystem::haveLargeAsid64(tc);
359 auto asid = asid_16bits ? bits(value, 63, 48) :
360 bits(value, 55, 48);
361
362 TLBIRMVA tlbi_op(regime, ss, value, asid, last_level, attrs);
363 if (shareable) {
364 tlbi_op.broadcast(tc);
365 } else {
366 tlbi_op(tc);
367 }
368 } else {
369 tlbiRvaa(tc, value, ss, regime, shareable, last_level, attrs);
370 }
371}
372
373void
375 SecurityState ss, TranslationRegime regime, bool shareable,
376 bool last_level, TlbiAttr attrs)
377{
378 if (EL2Enabled(tc)) {
379 TLBIRIPA tlbi_op(tc, TranslationRegime::EL10, ss, value,
380 last_level, attrs);
381
382 if (shareable) {
383 tlbi_op.broadcast(tc);
384 } else {
385 tlbi_op(tc);
386 }
387 }
388}
389
390bool
392{
393 HCRX hcrx = tc->readMiscRegNoEffect(MISCREG_HCRX_EL2);
394 return currEL(tc) == EL1 &&
395 HaveExt(tc, ArmExtension::FEAT_XS) &&
396 HaveExt(tc, ArmExtension::FEAT_HCX) &&
397 isHcrxEL2Enabled(tc) && hcrx.fnxs;
398}
399
400std::unordered_map<MiscRegIndex, TlbiOp64::TlbiFunc> TlbiOp64::tlbiOps = {
401 { MISCREG_TLBI_ALLE3, [](ThreadContext *tc, RegVal value)
402 {
403 TlbiOp64::tlbiAll(tc, value,
404 SecurityState::Secure, // secure
405 TranslationRegime::EL3, // regime
406 false); // shareable
407 }
408 },
409
410 { MISCREG_TLBI_ALLE3NXS, [](ThreadContext *tc, RegVal value)
411 {
412 TlbiOp64::tlbiAll(tc, value,
413 SecurityState::Secure, // secure
414 TranslationRegime::EL3, // regime
415 false, // shareable
416 TlbiAttr::ExcludeXS); // attrs
417 }
418 },
419
420 { MISCREG_TLBI_ALLE3IS, [](ThreadContext *tc, RegVal value)
421 {
422 TlbiOp64::tlbiAll(tc, value,
423 SecurityState::Secure, // secure
424 TranslationRegime::EL3, // regime
425 true); // shareable
426 }
427 },
428
429 { MISCREG_TLBI_ALLE3ISNXS, [](ThreadContext *tc, RegVal value)
430 {
431 TlbiOp64::tlbiAll(tc, value,
432 SecurityState::Secure, // secure
433 TranslationRegime::EL3, // regime
434 true, // shareable
435 TlbiAttr::ExcludeXS); // attrs
436 }
437 },
438
439 { MISCREG_TLBI_ALLE3OS, [](ThreadContext *tc, RegVal value)
440 {
441 TlbiOp64::tlbiAll(tc, value,
442 SecurityState::Secure, // secure
443 TranslationRegime::EL3, // regime
444 true); // shareable
445 }
446 },
447
448 { MISCREG_TLBI_ALLE3OSNXS, [](ThreadContext *tc, RegVal value)
449 {
450 TlbiOp64::tlbiAll(tc, value,
451 SecurityState::Secure, // secure
452 TranslationRegime::EL3, // regime
453 true, // shareable
454 TlbiAttr::ExcludeXS); // attrs
455 }
456 },
457
458
459 { MISCREG_TLBI_ALLE2, [](ThreadContext *tc, RegVal value)
460 {
461 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
462 TranslationRegime::EL20 : TranslationRegime::EL2;
463
464 TlbiOp64::tlbiAll(tc, value,
465 securityStateAtEL(tc, EL2), // secure
466 regime, // regime
467 false); // shareable
468 }
469 },
470
471 { MISCREG_TLBI_ALLE2NXS, [](ThreadContext *tc, RegVal value)
472 {
473 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
474 TranslationRegime::EL20 : TranslationRegime::EL2;
475
476 TlbiOp64::tlbiAll(tc, value,
477 securityStateAtEL(tc, EL2), // secure
478 regime, // regime
479 false, // shareable
480 TlbiAttr::ExcludeXS); // attrs
481 }
482 },
483
484 { MISCREG_TLBI_ALLE2IS, [](ThreadContext *tc, RegVal value)
485 {
486 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
487 TranslationRegime::EL20 : TranslationRegime::EL2;
488
489 TlbiOp64::tlbiAll(tc, value,
490 securityStateAtEL(tc, EL2), // secure
491 regime, // regime
492 true); // shareable
493 }
494 },
495
496 { MISCREG_TLBI_ALLE2ISNXS, [](ThreadContext *tc, RegVal value)
497 {
498 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
499 TranslationRegime::EL20 : TranslationRegime::EL2;
500
501 TlbiOp64::tlbiAll(tc, value,
502 securityStateAtEL(tc, EL2), // secure
503 regime, // regime
504 true, // shareable
505 TlbiAttr::ExcludeXS); // attrs
506 }
507 },
508
509 { MISCREG_TLBI_ALLE2OS, [](ThreadContext *tc, RegVal value)
510 {
511 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
512 TranslationRegime::EL20 : TranslationRegime::EL2;
513
514 TlbiOp64::tlbiAll(tc, value,
515 securityStateAtEL(tc, EL2), // secure
516 regime, // regime
517 true); // shareable
518 }
519 },
520
521 { MISCREG_TLBI_ALLE2OSNXS, [](ThreadContext *tc, RegVal value)
522 {
523 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
524 TranslationRegime::EL20 : TranslationRegime::EL2;
525
526 TlbiOp64::tlbiAll(tc, value,
527 securityStateAtEL(tc, EL2), // secure
528 regime, // regime
529 true, // shareable
530 TlbiAttr::ExcludeXS); // attrs
531 }
532 },
533
534 { MISCREG_TLBI_ALLE1, [](ThreadContext *tc, RegVal value)
535 {
536 TlbiOp64::tlbiAll(tc, value,
537 securityStateAtEL(tc, EL1), // secure
538 TranslationRegime::EL10, // regime
539 false); // shareable
540 }
541 },
542
543 { MISCREG_TLBI_ALLE1NXS, [](ThreadContext *tc, RegVal value)
544 {
545 TlbiOp64::tlbiAll(tc, value,
546 securityStateAtEL(tc, EL1), // secure
547 TranslationRegime::EL10, // regime
548 false, // shareable
549 TlbiAttr::ExcludeXS); // attrs
550 }
551 },
552
553 { MISCREG_TLBI_ALLE1IS, [](ThreadContext *tc, RegVal value)
554 {
555 TlbiOp64::tlbiAll(tc, value,
556 securityStateAtEL(tc, EL1), // secure
557 TranslationRegime::EL10, // regime
558 true); // shareable
559 }
560 },
561
562 { MISCREG_TLBI_ALLE1ISNXS, [](ThreadContext *tc, RegVal value)
563 {
564 TlbiOp64::tlbiAll(tc, value,
565 securityStateAtEL(tc, EL1), // secure
566 TranslationRegime::EL10, // regime
567 true, // shareable
568 TlbiAttr::ExcludeXS); // attrs
569 }
570 },
571
572 { MISCREG_TLBI_ALLE1OS, [](ThreadContext *tc, RegVal value)
573 {
574 TlbiOp64::tlbiAll(tc, value,
575 securityStateAtEL(tc, EL1), // secure
576 TranslationRegime::EL10, // regime
577 true); // shareable
578 }
579 },
580
581 { MISCREG_TLBI_ALLE1OSNXS, [](ThreadContext *tc, RegVal value)
582 {
583 TlbiOp64::tlbiAll(tc, value,
584 securityStateAtEL(tc, EL1), // secure
585 TranslationRegime::EL10, // regime
586 true, // shareable
587 TlbiAttr::ExcludeXS); // attrs
588 }
589 },
590
591
592 { MISCREG_TLBI_VMALLE1, [](ThreadContext *tc, RegVal value)
593 {
594 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
595 TranslationRegime::EL20 : TranslationRegime::EL10;
596
597 const TlbiAttr attrs = fnxsAttrs(tc) ?
598 TlbiAttr::ExcludeXS : TlbiAttr::None;
599
600 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
601 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
602 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
603 hcr.fb && !hcr.tge;
604
605 TlbiOp64::tlbiVmall(tc, value,
606 securityStateAtEL(tc, translationEl(regime)), // secure
607 regime, // regime
608 shareable, // shareable
609 false, // stage2
610 attrs); // attrs
611 }
612 },
613
614 { MISCREG_TLBI_VMALLE1NXS, [](ThreadContext *tc, RegVal value)
615 {
616 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
617 TranslationRegime::EL20 : TranslationRegime::EL10;
618
619 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
620 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
621 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
622 hcr.fb && !hcr.tge;
623
624 TlbiOp64::tlbiVmall(tc, value,
625 securityStateAtEL(tc, translationEl(regime)), // secure
626 regime, // regime
627 shareable, // shareable
628 false, // stage2
629 TlbiAttr::ExcludeXS); // attrs
630 }
631 },
632
633 { MISCREG_TLBI_VMALLE1IS, [](ThreadContext *tc, RegVal value)
634 {
635 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
636 TranslationRegime::EL20 : TranslationRegime::EL10;
637
638 const TlbiAttr attrs = fnxsAttrs(tc) ?
639 TlbiAttr::ExcludeXS : TlbiAttr::None;
640
641 TlbiOp64::tlbiVmall(tc, value,
642 securityStateAtEL(tc, translationEl(regime)), // secure
643 regime, // regime
644 true, // shareable
645 false, // stage2
646 attrs); // attrs
647 }
648 },
649
650 { MISCREG_TLBI_VMALLE1ISNXS, [](ThreadContext *tc, RegVal value)
651 {
652 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
653 TranslationRegime::EL20 : TranslationRegime::EL10;
654
655 TlbiOp64::tlbiVmall(tc, value,
656 securityStateAtEL(tc, translationEl(regime)), // secure
657 regime, // regime
658 true, // shareable
659 false, // stage2
660 TlbiAttr::ExcludeXS); // attrs
661 }
662 },
663
664 { MISCREG_TLBI_VMALLE1OS, [](ThreadContext *tc, RegVal value)
665 {
666 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
667 TranslationRegime::EL20 : TranslationRegime::EL10;
668
669 const TlbiAttr attrs = fnxsAttrs(tc) ?
670 TlbiAttr::ExcludeXS : TlbiAttr::None;
671
672 TlbiOp64::tlbiVmall(tc, value,
673 securityStateAtEL(tc, translationEl(regime)), // secure
674 regime, // regime
675 true, // shareable
676 false, // stage2
677 attrs); // attrs
678 }
679 },
680
681 { MISCREG_TLBI_VMALLE1OSNXS, [](ThreadContext *tc, RegVal value)
682 {
683 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
684 TranslationRegime::EL20 : TranslationRegime::EL10;
685
686 TlbiOp64::tlbiVmall(tc, value,
687 securityStateAtEL(tc, translationEl(regime)), // secure
688 regime, // regime
689 true, // shareable
690 false, // stage2
691 TlbiAttr::ExcludeXS); // attrs
692 }
693 },
694
695 { MISCREG_TLBI_VMALLS12E1, [](ThreadContext *tc, RegVal value)
696 {
697 TlbiOp64::tlbiVmall(tc, value,
698 securityStateAtEL(tc, EL1), // secure
699 TranslationRegime::EL10, // regime
700 false, // shareable
701 true); // stage2
702 }
703 },
704
705 { MISCREG_TLBI_VMALLS12E1NXS, [](ThreadContext *tc, RegVal value)
706 {
707 TlbiOp64::tlbiVmall(tc, value,
708 securityStateAtEL(tc, EL1), // secure
709 TranslationRegime::EL10, // regime
710 false, // shareable
711 true, // stage2
712 TlbiAttr::ExcludeXS); // attrs
713 }
714 },
715
716 { MISCREG_TLBI_VMALLS12E1IS, [](ThreadContext *tc, RegVal value)
717 {
718 TlbiOp64::tlbiVmall(tc, value,
719 securityStateAtEL(tc, EL1), // secure
720 TranslationRegime::EL10, // regime
721 true, // shareable
722 true); // stage2
723 }
724 },
725
726 { MISCREG_TLBI_VMALLS12E1ISNXS, [](ThreadContext *tc, RegVal value)
727 {
728 TlbiOp64::tlbiVmall(tc, value,
729 securityStateAtEL(tc, EL1), // secure
730 TranslationRegime::EL10, // regime
731 true, // shareable
732 true, // stage2
733 TlbiAttr::ExcludeXS); // attrs
734 }
735 },
736
737 { MISCREG_TLBI_VMALLS12E1OS, [](ThreadContext *tc, RegVal value)
738 {
739 TlbiOp64::tlbiVmall(tc, value,
740 securityStateAtEL(tc, EL1), // secure
741 TranslationRegime::EL10, // regime
742 true, // shareable
743 true); // stage2
744 }
745 },
746
747 { MISCREG_TLBI_VMALLS12E1OSNXS, [](ThreadContext *tc, RegVal value)
748 {
749 TlbiOp64::tlbiVmall(tc, value,
750 securityStateAtEL(tc, EL1), // secure
751 TranslationRegime::EL10, // regime
752 true, // shareable
753 true, // stage2
754 TlbiAttr::ExcludeXS); // attrs
755 }
756 },
757
758
759 { MISCREG_TLBI_VAE3, [](ThreadContext *tc, RegVal value)
760 {
761 TlbiOp64::tlbiVa(tc, value,
762 SecurityState::Secure, // secure
763 TranslationRegime::EL3, // regime
764 false, // shareable
765 false); // last level only
766 }
767 },
768
769 { MISCREG_TLBI_VAE3NXS, [](ThreadContext *tc, RegVal value)
770 {
771 TlbiOp64::tlbiVa(tc, value,
772 SecurityState::Secure, // secure
773 TranslationRegime::EL3, // regime
774 false, // shareable
775 false, // last level only
776 TlbiAttr::ExcludeXS); // attrs
777 }
778 },
779
780
781 { MISCREG_TLBI_VAE3IS, [](ThreadContext *tc, RegVal value)
782 {
783 TlbiOp64::tlbiVa(tc, value,
784 SecurityState::Secure, // secure
785 TranslationRegime::EL3, // regime
786 true, // shareable
787 false); // last level only
788 }
789 },
790
791 { MISCREG_TLBI_VAE3ISNXS, [](ThreadContext *tc, RegVal value)
792 {
793 TlbiOp64::tlbiVa(tc, value,
794 SecurityState::Secure, // secure
795 TranslationRegime::EL3, // regime
796 true, // shareable
797 false, // last level only
798 TlbiAttr::ExcludeXS); // attrs
799 }
800 },
801
802 { MISCREG_TLBI_VAE3OS, [](ThreadContext *tc, RegVal value)
803 {
804 TlbiOp64::tlbiVa(tc, value,
805 SecurityState::Secure, // secure
806 TranslationRegime::EL3, // regime
807 true, // shareable
808 false); // last level only
809 }
810 },
811
812 { MISCREG_TLBI_VAE3OSNXS, [](ThreadContext *tc, RegVal value)
813 {
814 TlbiOp64::tlbiVa(tc, value,
815 SecurityState::Secure, // secure
816 TranslationRegime::EL3, // regime
817 true, // shareable
818 false, // last level only
819 TlbiAttr::ExcludeXS); // attrs
820 }
821 },
822
823
824 { MISCREG_TLBI_VALE3, [](ThreadContext *tc, RegVal value)
825 {
826 TlbiOp64::tlbiVa(tc, value,
827 SecurityState::Secure, // secure
828 TranslationRegime::EL3, // regime
829 false, // shareable
830 true); // last level only
831 }
832 },
833
834 { MISCREG_TLBI_VALE3NXS, [](ThreadContext *tc, RegVal value)
835 {
836 TlbiOp64::tlbiVa(tc, value,
837 SecurityState::Secure, // secure
838 TranslationRegime::EL3, // regime
839 false, // shareable
840 true, // last level only
841 TlbiAttr::ExcludeXS); // attrs
842 }
843 },
844
845
846 { MISCREG_TLBI_VALE3IS, [](ThreadContext *tc, RegVal value)
847 {
848 TlbiOp64::tlbiVa(tc, value,
849 SecurityState::Secure, // secure
850 TranslationRegime::EL3, // regime
851 true, // shareable
852 true); // last level only
853 }
854 },
855
856 { MISCREG_TLBI_VALE3ISNXS, [](ThreadContext *tc, RegVal value)
857 {
858 TlbiOp64::tlbiVa(tc, value,
859 SecurityState::Secure, // secure
860 TranslationRegime::EL3, // regime
861 true, // shareable
862 true, // last level only
863 TlbiAttr::ExcludeXS); // attrs
864 }
865 },
866
867
868 { MISCREG_TLBI_VALE3OS, [](ThreadContext *tc, RegVal value)
869 {
870 TlbiOp64::tlbiVa(tc, value,
871 SecurityState::Secure, // secure
872 TranslationRegime::EL3, // regime
873 true, // shareable
874 true); // last level only
875 }
876 },
877
878 { MISCREG_TLBI_VALE3OSNXS, [](ThreadContext *tc, RegVal value)
879 {
880 TlbiOp64::tlbiVa(tc, value,
881 SecurityState::Secure, // secure
882 TranslationRegime::EL3, // regime
883 true, // shareable
884 true, // last level only
885 TlbiAttr::ExcludeXS); // attrs
886 }
887 },
888
889 { MISCREG_TLBI_VAE2, [](ThreadContext *tc, RegVal value)
890 {
891 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
892 TranslationRegime::EL20 : TranslationRegime::EL2;
893
894 TlbiOp64::tlbiVa(tc, value,
895 securityStateAtEL(tc, EL2), // secure
896 regime, // regime
897 false, // shareable
898 false); // last level only
899 }
900 },
901
902 { MISCREG_TLBI_VAE2NXS, [](ThreadContext *tc, RegVal value)
903 {
904 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
905 TranslationRegime::EL20 : TranslationRegime::EL2;
906
907 TlbiOp64::tlbiVa(tc, value,
908 securityStateAtEL(tc, EL2), // secure
909 regime, // regime
910 false, // shareable
911 false, // last level only
912 TlbiAttr::ExcludeXS); // attrs
913 }
914 },
915
916 { MISCREG_TLBI_VAE2IS, [](ThreadContext *tc, RegVal value)
917 {
918 TlbiOp64::tlbiVa(tc, value,
919 securityStateAtEL(tc, EL2), // secure
920 TranslationRegime::EL2, // regime
921 true, // shareable
922 false); // last level only
923 }
924 },
925
926 { MISCREG_TLBI_VAE2ISNXS, [](ThreadContext *tc, RegVal value)
927 {
928 TlbiOp64::tlbiVa(tc, value,
929 securityStateAtEL(tc, EL2), // secure
930 TranslationRegime::EL2, // regime
931 true, // shareable
932 false, // last level only
933 TlbiAttr::ExcludeXS); // attrs
934 }
935 },
936
937
938 { MISCREG_TLBI_VAE2OS, [](ThreadContext *tc, RegVal value)
939 {
940 TlbiOp64::tlbiVa(tc, value,
941 securityStateAtEL(tc,EL2), // secure
942 TranslationRegime::EL2, // regime
943 true, // shareable
944 false); // last level only
945 }
946 },
947
948 { MISCREG_TLBI_VAE2OSNXS, [](ThreadContext *tc, RegVal value)
949 {
950 TlbiOp64::tlbiVa(tc, value,
951 securityStateAtEL(tc,EL2), // secure
952 TranslationRegime::EL2, // regime
953 true, // shareable
954 false, // last level only
955 TlbiAttr::ExcludeXS); // attrs
956 }
957 },
958
959
960 { MISCREG_TLBI_VALE2, [](ThreadContext *tc, RegVal value)
961 {
962 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
963 TranslationRegime::EL20 : TranslationRegime::EL2;
964
965 TlbiOp64::tlbiVa(tc, value,
966 securityStateAtEL(tc, EL2), // secure
967 regime, // regime
968 false, // shareable
969 true); // last level only
970 }
971 },
972
973 { MISCREG_TLBI_VALE2NXS, [](ThreadContext *tc, RegVal value)
974 {
975 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
976 TranslationRegime::EL20 : TranslationRegime::EL2;
977
978 TlbiOp64::tlbiVa(tc, value,
979 securityStateAtEL(tc, EL2), // secure
980 regime, // regime
981 false, // shareable
982 true, // last level only
983 TlbiAttr::ExcludeXS); // attrs
984 }
985 },
986
987 { MISCREG_TLBI_VALE2IS, [](ThreadContext *tc, RegVal value)
988 {
989 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
990 TranslationRegime::EL20 : TranslationRegime::EL2;
991
992 TlbiOp64::tlbiVa(tc, value,
993 securityStateAtEL(tc, EL2), // secure
994 regime, // regime
995 true, // shareable
996 true); // last level only
997 }
998 },
999
1000 { MISCREG_TLBI_VALE2ISNXS, [](ThreadContext *tc, RegVal value)
1001 {
1002 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
1003 TranslationRegime::EL20 : TranslationRegime::EL2;
1004
1005 TlbiOp64::tlbiVa(tc, value,
1006 securityStateAtEL(tc, EL2), // secure
1007 regime, // regime
1008 true, // shareable
1009 true, // last level only
1010 TlbiAttr::ExcludeXS); // attrs
1011 }
1012 },
1013
1014 { MISCREG_TLBI_VALE2OS, [](ThreadContext *tc, RegVal value)
1015 {
1016 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
1017 TranslationRegime::EL20 : TranslationRegime::EL2;
1018
1019 TlbiOp64::tlbiVa(tc, value,
1020 securityStateAtEL(tc, EL2), // secure
1021 regime, // regime
1022 true, // shareable
1023 true); // last level only
1024 }
1025 },
1026
1027 { MISCREG_TLBI_VALE2OSNXS, [](ThreadContext *tc, RegVal value)
1028 {
1029 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
1030 TranslationRegime::EL20 : TranslationRegime::EL2;
1031
1032 TlbiOp64::tlbiVa(tc, value,
1033 securityStateAtEL(tc, EL2), // secure
1034 regime, // regime
1035 true, // shareable
1036 true, // last level only
1037 TlbiAttr::ExcludeXS); // attrs
1038 }
1039 },
1040
1041 { MISCREG_TLBI_VAE1, [](ThreadContext *tc, RegVal value)
1042 {
1043 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1044 TranslationRegime::EL20 : TranslationRegime::EL10;
1045
1046 const TlbiAttr attrs = fnxsAttrs(tc) ?
1047 TlbiAttr::ExcludeXS : TlbiAttr::None;
1048
1049 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1050 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1051 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1052 hcr.fb && !hcr.tge;
1053
1054 TlbiOp64::tlbiVa(tc, value,
1055 securityStateAtEL(tc, translationEl(regime)), // secure
1056 regime, // regime
1057 shareable, // shareable
1058 false, // last level only
1059 attrs); // attrs
1060 }
1061 },
1062
1063 { MISCREG_TLBI_VAE1NXS, [](ThreadContext *tc, RegVal value)
1064 {
1065 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1066 TranslationRegime::EL20 : TranslationRegime::EL10;
1067
1068 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1069 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1070 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1071 hcr.fb && !hcr.tge;
1072
1073 TlbiOp64::tlbiVa(tc, value,
1074 securityStateAtEL(tc, translationEl(regime)), // secure
1075 regime, // regime
1076 shareable, // shareable
1077 false, // last level only
1078 TlbiAttr::ExcludeXS); // attrs
1079 }
1080 },
1081
1082 { MISCREG_TLBI_VAE1IS, [](ThreadContext *tc, RegVal value)
1083 {
1084 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1085 TranslationRegime::EL20 : TranslationRegime::EL10;
1086
1087 const TlbiAttr attrs = fnxsAttrs(tc) ?
1088 TlbiAttr::ExcludeXS : TlbiAttr::None;
1089
1090 TlbiOp64::tlbiVa(tc, value,
1091 securityStateAtEL(tc, translationEl(regime)), // secure
1092 regime, // regime
1093 true, // shareable
1094 false, // last level only
1095 attrs); // attrs
1096 }
1097 },
1098
1099 { MISCREG_TLBI_VAE1ISNXS, [](ThreadContext *tc, RegVal value)
1100 {
1101 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1102 TranslationRegime::EL20 : TranslationRegime::EL10;
1103
1104 TlbiOp64::tlbiVa(tc, value,
1105 securityStateAtEL(tc, translationEl(regime)), // secure
1106 regime, // regime
1107 true, // shareable
1108 false, // last level only
1109 TlbiAttr::ExcludeXS); // attrs
1110 }
1111 },
1112
1113 { MISCREG_TLBI_VAE1OS, [](ThreadContext *tc, RegVal value)
1114 {
1115 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1116 TranslationRegime::EL20 : TranslationRegime::EL10;
1117
1118 const TlbiAttr attrs = fnxsAttrs(tc) ?
1119 TlbiAttr::ExcludeXS : TlbiAttr::None;
1120
1121 TlbiOp64::tlbiVa(tc, value,
1122 securityStateAtEL(tc, translationEl(regime)), // secure
1123 regime, // regime
1124 true, // shareable
1125 false, // last level only
1126 attrs); // attrs
1127 }
1128 },
1129
1130 { MISCREG_TLBI_VAE1OSNXS, [](ThreadContext *tc, RegVal value)
1131 {
1132 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1133 TranslationRegime::EL20 : TranslationRegime::EL10;
1134
1135 TlbiOp64::tlbiVa(tc, value,
1136 securityStateAtEL(tc, translationEl(regime)), // secure
1137 regime, // regime
1138 true, // shareable
1139 false, // last level only
1140 TlbiAttr::ExcludeXS); // attrs
1141 }
1142 },
1143
1144 { MISCREG_TLBI_VALE1, [](ThreadContext *tc, RegVal value)
1145 {
1146 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1147 TranslationRegime::EL20 : TranslationRegime::EL10;
1148
1149 const TlbiAttr attrs = fnxsAttrs(tc) ?
1150 TlbiAttr::ExcludeXS : TlbiAttr::None;
1151
1152 TlbiOp64::tlbiVa(tc, value,
1153 securityStateAtEL(tc, translationEl(regime)), // secure
1154 regime, // regime
1155 false, // shareable
1156 true, // last level only
1157 attrs); // attrs
1158 }
1159 },
1160
1161 { MISCREG_TLBI_VALE1NXS, [](ThreadContext *tc, RegVal value)
1162 {
1163 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1164 TranslationRegime::EL20 : TranslationRegime::EL10;
1165
1166 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1167 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1168 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1169 hcr.fb && !hcr.tge;
1170
1171 TlbiOp64::tlbiVa(tc, value,
1172 securityStateAtEL(tc, translationEl(regime)), // secure
1173 regime, // regime
1174 shareable, // shareable
1175 true, // last level only
1176 TlbiAttr::ExcludeXS); // attrs
1177 }
1178 },
1179
1180 { MISCREG_TLBI_VALE1IS, [](ThreadContext *tc, RegVal value)
1181 {
1182 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1183 TranslationRegime::EL20 : TranslationRegime::EL10;
1184
1185 const TlbiAttr attrs = fnxsAttrs(tc) ?
1186 TlbiAttr::ExcludeXS : TlbiAttr::None;
1187
1188 TlbiOp64::tlbiVa(tc, value,
1189 securityStateAtEL(tc, translationEl(regime)), // secure
1190 regime, // regime
1191 true, // shareable
1192 true, // last level only
1193 attrs); // attrs
1194 }
1195 },
1196
1197 { MISCREG_TLBI_VALE1ISNXS, [](ThreadContext *tc, RegVal value)
1198 {
1199 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1200 TranslationRegime::EL20 : TranslationRegime::EL10;
1201
1202 TlbiOp64::tlbiVa(tc, value,
1203 securityStateAtEL(tc, translationEl(regime)), // secure
1204 regime, // regime
1205 true, // shareable
1206 true, // last level only
1207 TlbiAttr::ExcludeXS); // attrs
1208 }
1209 },
1210
1211 { MISCREG_TLBI_VALE1OS, [](ThreadContext *tc, RegVal value)
1212 {
1213 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1214 TranslationRegime::EL20 : TranslationRegime::EL10;
1215
1216 const TlbiAttr attrs = fnxsAttrs(tc) ?
1217 TlbiAttr::ExcludeXS : TlbiAttr::None;
1218
1219 TlbiOp64::tlbiVa(tc, value,
1220 securityStateAtEL(tc, translationEl(regime)), // secure
1221 regime, // regime
1222 true, // shareable
1223 true, // last level only
1224 attrs); // attrs
1225 }
1226 },
1227
1228 { MISCREG_TLBI_VALE1OSNXS, [](ThreadContext *tc, RegVal value)
1229 {
1230 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1231 TranslationRegime::EL20 : TranslationRegime::EL10;
1232
1233 TlbiOp64::tlbiVa(tc, value,
1234 securityStateAtEL(tc, translationEl(regime)), // secure
1235 regime, // regime
1236 true, // shareable
1237 true, // last level only
1238 TlbiAttr::ExcludeXS); // attrs
1239 }
1240 },
1241
1242 { MISCREG_TLBI_ASIDE1, [](ThreadContext *tc, RegVal value)
1243 {
1244 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1245 TranslationRegime::EL20 : TranslationRegime::EL10;
1246
1247 const TlbiAttr attrs = fnxsAttrs(tc) ?
1248 TlbiAttr::ExcludeXS : TlbiAttr::None;
1249
1250 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1251 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1252 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1253 hcr.fb && !hcr.tge;
1254
1255 TlbiOp64::tlbiAsid(tc, value,
1256 securityStateAtEL(tc, translationEl(regime)), // secure
1257 regime, // regime
1258 shareable, // shareable
1259 attrs); // attrs
1260 }
1261 },
1262
1263 { MISCREG_TLBI_ASIDE1NXS, [](ThreadContext *tc, RegVal value)
1264 {
1265 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1266 TranslationRegime::EL20 : TranslationRegime::EL10;
1267
1268 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1269 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1270 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1271 hcr.fb && !hcr.tge;
1272
1273 TlbiOp64::tlbiAsid(tc, value,
1274 securityStateAtEL(tc, translationEl(regime)), // secure
1275 regime, // regime
1276 shareable, // shareable
1277 TlbiAttr::ExcludeXS); // attrs
1278 }
1279 },
1280
1281 { MISCREG_TLBI_ASIDE1IS, [](ThreadContext *tc, RegVal value)
1282 {
1283 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1284 TranslationRegime::EL20 : TranslationRegime::EL10;
1285
1286 const TlbiAttr attrs = fnxsAttrs(tc) ?
1287 TlbiAttr::ExcludeXS : TlbiAttr::None;
1288
1289 TlbiOp64::tlbiAsid(tc, value,
1290 securityStateAtEL(tc, translationEl(regime)), // secure
1291 regime, // regime
1292 true, // shareable
1293 attrs); // attrs
1294 }
1295 },
1296
1297 { MISCREG_TLBI_ASIDE1ISNXS, [](ThreadContext *tc, RegVal value)
1298 {
1299 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1300 TranslationRegime::EL20 : TranslationRegime::EL10;
1301
1302 TlbiOp64::tlbiAsid(tc, value,
1303 securityStateAtEL(tc, translationEl(regime)), // secure
1304 regime, // regime
1305 true, // shareable
1306 TlbiAttr::ExcludeXS); // attrs
1307 }
1308 },
1309
1310 { MISCREG_TLBI_ASIDE1OS, [](ThreadContext *tc, RegVal value)
1311 {
1312 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1313 TranslationRegime::EL20 : TranslationRegime::EL10;
1314
1315 const TlbiAttr attrs = fnxsAttrs(tc) ?
1316 TlbiAttr::ExcludeXS : TlbiAttr::None;
1317
1318 TlbiOp64::tlbiAsid(tc, value,
1319 securityStateAtEL(tc, translationEl(regime)), // secure
1320 regime, // regime
1321 true, // shareable
1322 attrs); // attrs
1323 }
1324 },
1325
1326 { MISCREG_TLBI_ASIDE1OSNXS, [](ThreadContext *tc, RegVal value)
1327 {
1328 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1329 TranslationRegime::EL20 : TranslationRegime::EL10;
1330
1331 TlbiOp64::tlbiAsid(tc, value,
1332 securityStateAtEL(tc, translationEl(regime)), // secure
1333 regime, // regime
1334 true, // shareable
1335 TlbiAttr::ExcludeXS); // attrs
1336 }
1337 },
1338
1339 { MISCREG_TLBI_VAAE1, [](ThreadContext *tc, RegVal value)
1340 {
1341 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1342 TranslationRegime::EL20 : TranslationRegime::EL10;
1343
1344 const TlbiAttr attrs = fnxsAttrs(tc) ?
1345 TlbiAttr::ExcludeXS : TlbiAttr::None;
1346
1347 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1348 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1349 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1350 hcr.fb && !hcr.tge;
1351
1352 TlbiOp64::tlbiVaa(tc, value,
1353 securityStateAtEL(tc, translationEl(regime)), // secure
1354 regime, // regime
1355 shareable, // shareable
1356 false, // last level only
1357 attrs); // attrs
1358 }
1359 },
1360
1361 { MISCREG_TLBI_VAAE1NXS, [](ThreadContext *tc, RegVal value)
1362 {
1363 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1364 TranslationRegime::EL20 : TranslationRegime::EL10;
1365
1366 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1367 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1368 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1369 hcr.fb && !hcr.tge;
1370
1371 TlbiOp64::tlbiVaa(tc, value,
1372 securityStateAtEL(tc, translationEl(regime)), // secure
1373 regime, // regime
1374 shareable, // shareable
1375 false, // last level
1376 TlbiAttr::ExcludeXS); // attrs
1377 }
1378 },
1379
1380 { MISCREG_TLBI_VAAE1IS, [](ThreadContext *tc, RegVal value)
1381 {
1382 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1383 TranslationRegime::EL20 : TranslationRegime::EL10;
1384
1385 const TlbiAttr attrs = fnxsAttrs(tc) ?
1386 TlbiAttr::ExcludeXS : TlbiAttr::None;
1387
1388 TlbiOp64::tlbiVaa(tc, value,
1389 securityStateAtEL(tc, translationEl(regime)), // secure
1390 regime, // regime
1391 true, // shareable
1392 false, // last level only
1393 attrs); // attrs
1394 }
1395 },
1396
1397 { MISCREG_TLBI_VAAE1ISNXS, [](ThreadContext *tc, RegVal value)
1398 {
1399 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1400 TranslationRegime::EL20 : TranslationRegime::EL10;
1401
1402 TlbiOp64::tlbiVaa(tc, value,
1403 securityStateAtEL(tc, translationEl(regime)), // secure
1404 regime, // regime
1405 true, // shareable
1406 false, // last level
1407 TlbiAttr::ExcludeXS); // attrs
1408 }
1409 },
1410
1411 { MISCREG_TLBI_VAAE1OS, [](ThreadContext *tc, RegVal value)
1412 {
1413 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1414 TranslationRegime::EL20 : TranslationRegime::EL10;
1415
1416 const TlbiAttr attrs = fnxsAttrs(tc) ?
1417 TlbiAttr::ExcludeXS : TlbiAttr::None;
1418
1419 TlbiOp64::tlbiVaa(tc, value,
1420 securityStateAtEL(tc, translationEl(regime)), // secure
1421 regime, // regime
1422 true, // shareable
1423 false, // last level only
1424 attrs); // attrs
1425 }
1426 },
1427
1428 { MISCREG_TLBI_VAAE1OSNXS, [](ThreadContext *tc, RegVal value)
1429 {
1430 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1431 TranslationRegime::EL20 : TranslationRegime::EL10;
1432
1433 TlbiOp64::tlbiVaa(tc, value,
1434 securityStateAtEL(tc, translationEl(regime)), // secure
1435 regime, // regime
1436 true, // shareable
1437 false, // last level
1438 TlbiAttr::ExcludeXS); // attrs
1439 }
1440 },
1441
1442 { MISCREG_TLBI_VAALE1, [](ThreadContext *tc, RegVal value)
1443 {
1444 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1445 TranslationRegime::EL20 : TranslationRegime::EL10;
1446
1447 const TlbiAttr attrs = fnxsAttrs(tc) ?
1448 TlbiAttr::ExcludeXS : TlbiAttr::None;
1449
1450 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1451 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1452 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1453 hcr.fb && !hcr.tge;
1454
1455 TlbiOp64::tlbiVaa(tc, value,
1456 securityStateAtEL(tc, translationEl(regime)), // secure
1457 regime, // regime
1458 shareable, // shareable
1459 true, // last level only
1460 attrs); // attrs
1461 }
1462 },
1463
1464 { MISCREG_TLBI_VAALE1NXS, [](ThreadContext *tc, RegVal value)
1465 {
1466 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1467 TranslationRegime::EL20 : TranslationRegime::EL10;
1468
1469 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1470 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1471 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1472 hcr.fb && !hcr.tge;
1473
1474 TlbiOp64::tlbiVaa(tc, value,
1475 securityStateAtEL(tc, translationEl(regime)), // secure
1476 regime, // regime
1477 shareable, // shareable
1478 true, // last level
1479 TlbiAttr::ExcludeXS); // attrs
1480 }
1481 },
1482
1483 { MISCREG_TLBI_VAALE1IS, [](ThreadContext *tc, RegVal value)
1484 {
1485 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1486 TranslationRegime::EL20 : TranslationRegime::EL10;
1487
1488 const TlbiAttr attrs = fnxsAttrs(tc) ?
1489 TlbiAttr::ExcludeXS : TlbiAttr::None;
1490
1491 TlbiOp64::tlbiVaa(tc, value,
1492 securityStateAtEL(tc, translationEl(regime)), // secure
1493 regime, // regime
1494 true, // shareable
1495 true, // last level only
1496 attrs); // attrs
1497 }
1498 },
1499
1500 { MISCREG_TLBI_VAALE1ISNXS, [](ThreadContext *tc, RegVal value)
1501 {
1502 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1503 TranslationRegime::EL20 : TranslationRegime::EL10;
1504
1505 TlbiOp64::tlbiVaa(tc, value,
1506 securityStateAtEL(tc, translationEl(regime)), // secure
1507 regime, // regime
1508 true, // shareable
1509 true, // last level
1510 TlbiAttr::ExcludeXS); // attrs
1511 }
1512 },
1513
1514 { MISCREG_TLBI_VAALE1OS, [](ThreadContext *tc, RegVal value)
1515 {
1516 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1517 TranslationRegime::EL20 : TranslationRegime::EL10;
1518
1519 const TlbiAttr attrs = fnxsAttrs(tc) ?
1520 TlbiAttr::ExcludeXS : TlbiAttr::None;
1521
1522 TlbiOp64::tlbiVaa(tc, value,
1523 securityStateAtEL(tc, translationEl(regime)), // secure
1524 regime, // regime
1525 true, // shareable
1526 true, // last level only
1527 attrs); // attrs
1528 }
1529 },
1530
1531 { MISCREG_TLBI_VAALE1OSNXS, [](ThreadContext *tc, RegVal value)
1532 {
1533 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1534 TranslationRegime::EL20 : TranslationRegime::EL10;
1535
1536 TlbiOp64::tlbiVaa(tc, value,
1537 securityStateAtEL(tc, translationEl(regime)), // secure
1538 regime, // regime
1539 true, // shareable
1540 true, // last level
1541 TlbiAttr::ExcludeXS); // attrs
1542 }
1543 },
1544
1545 { MISCREG_TLBI_IPAS2E1, [](ThreadContext *tc, RegVal value)
1546 {
1547 TlbiOp64::tlbiIpaS2(tc, value,
1548 securityStateAtEL(tc, EL1), // secure
1549 TranslationRegime::EL10, // regime
1550 false, // shareable
1551 false); // last level
1552 }
1553 },
1554
1555 { MISCREG_TLBI_IPAS2E1NXS, [](ThreadContext *tc, RegVal value)
1556 {
1557 TlbiOp64::tlbiIpaS2(tc, value,
1558 securityStateAtEL(tc, EL1), // secure
1559 TranslationRegime::EL10, // regime
1560 false, // shareable
1561 false, // last level
1562 TlbiAttr::ExcludeXS); // attrs
1563 }
1564 },
1565
1566 { MISCREG_TLBI_IPAS2E1IS, [](ThreadContext *tc, RegVal value)
1567 {
1568 TlbiOp64::tlbiIpaS2(tc, value,
1569 securityStateAtEL(tc, EL1), // secure
1570 TranslationRegime::EL10, // regime
1571 true, // shareable
1572 false); // last level
1573 }
1574 },
1575
1576 { MISCREG_TLBI_IPAS2E1ISNXS, [](ThreadContext *tc, RegVal value)
1577 {
1578 TlbiOp64::tlbiIpaS2(tc, value,
1579 securityStateAtEL(tc, EL1), // secure
1580 TranslationRegime::EL10, // regime
1581 true, // shareable
1582 false, // last level
1583 TlbiAttr::ExcludeXS); // attrs
1584 }
1585 },
1586
1587
1588 { MISCREG_TLBI_IPAS2E1OS, [](ThreadContext *tc, RegVal value)
1589 {
1590 TlbiOp64::tlbiIpaS2(tc, value,
1591 securityStateAtEL(tc, EL1), // secure
1592 TranslationRegime::EL10, // regime
1593 true, // shareable
1594 false); // last level
1595 }
1596 },
1597
1598 { MISCREG_TLBI_IPAS2E1OSNXS, [](ThreadContext *tc, RegVal value)
1599 {
1600 TlbiOp64::tlbiIpaS2(tc, value,
1601 securityStateAtEL(tc, EL1), // secure
1602 TranslationRegime::EL10, // regime
1603 true, // shareable
1604 false, // last level
1605 TlbiAttr::ExcludeXS); // attrs
1606 }
1607 },
1608
1609 { MISCREG_TLBI_IPAS2LE1, [](ThreadContext *tc, RegVal value)
1610 {
1611 TlbiOp64::tlbiIpaS2(tc, value,
1612 securityStateAtEL(tc, EL1), // secure
1613 TranslationRegime::EL10, // regime
1614 false, // shareable
1615 true); // last level
1616 }
1617 },
1618
1619 { MISCREG_TLBI_IPAS2LE1NXS, [](ThreadContext *tc, RegVal value)
1620 {
1621 TlbiOp64::tlbiIpaS2(tc, value,
1622 securityStateAtEL(tc, EL1), // secure
1623 TranslationRegime::EL10, // regime
1624 false, // shareable
1625 true, // last level
1626 TlbiAttr::ExcludeXS); // attrs
1627 }
1628 },
1629
1630
1631 { MISCREG_TLBI_IPAS2LE1IS, [](ThreadContext *tc, RegVal value)
1632 {
1633 TlbiOp64::tlbiIpaS2(tc, value,
1634 securityStateAtEL(tc, EL1), // secure
1635 TranslationRegime::EL10, // regime
1636 true, // shareable
1637 true); // last level
1638 }
1639 },
1640
1641 { MISCREG_TLBI_IPAS2LE1ISNXS, [](ThreadContext *tc, RegVal value)
1642 {
1643 TlbiOp64::tlbiIpaS2(tc, value,
1644 securityStateAtEL(tc, EL1), // secure
1645 TranslationRegime::EL10, // regime
1646 true, // shareable
1647 true, // last level
1648 TlbiAttr::ExcludeXS); // attrs
1649 }
1650 },
1651
1652
1653 { MISCREG_TLBI_IPAS2LE1OS, [](ThreadContext *tc, RegVal value)
1654 {
1655 TlbiOp64::tlbiIpaS2(tc, value,
1656 securityStateAtEL(tc, EL1), // secure
1657 TranslationRegime::EL10, // regime
1658 true, // shareable
1659 true); // last level
1660 }
1661 },
1662
1663 { MISCREG_TLBI_IPAS2LE1OSNXS, [](ThreadContext *tc, RegVal value)
1664 {
1665 TlbiOp64::tlbiIpaS2(tc, value,
1666 securityStateAtEL(tc, EL1), // secure
1667 TranslationRegime::EL10, // regime
1668 true, // shareable
1669 true, // last level
1670 TlbiAttr::ExcludeXS); // attrs
1671 }
1672 },
1673
1674
1675 { MISCREG_TLBI_RVAE1, [](ThreadContext *tc, RegVal value)
1676 {
1677 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1678 TranslationRegime::EL20 : TranslationRegime::EL10;
1679
1680 const TlbiAttr attrs = fnxsAttrs(tc) ?
1681 TlbiAttr::ExcludeXS : TlbiAttr::None;
1682
1683 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1684 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1685 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1686 hcr.fb && !hcr.tge;
1687
1688 TlbiOp64::tlbiRva(tc, value,
1689 securityStateAtEL(tc, translationEl(regime)), // secure
1690 regime, // regime
1691 shareable, // shareable
1692 false, // last level only
1693 attrs); // attrs
1694 }
1695 },
1696
1697 { MISCREG_TLBI_RVAE1NXS, [](ThreadContext *tc, RegVal value)
1698 {
1699 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1700 TranslationRegime::EL20 : TranslationRegime::EL10;
1701
1702 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1703 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1704 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1705 hcr.fb && !hcr.tge;
1706
1707 TlbiOp64::tlbiRva(tc, value,
1708 securityStateAtEL(tc, translationEl(regime)), // secure
1709 regime, // regime
1710 shareable, // shareable
1711 false, // last level only
1712 TlbiAttr::ExcludeXS); // attrs
1713 }
1714 },
1715
1716 { MISCREG_TLBI_RVAE1IS, [](ThreadContext *tc, RegVal value)
1717 {
1718 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1719 TranslationRegime::EL20 : TranslationRegime::EL10;
1720
1721 const TlbiAttr attrs = fnxsAttrs(tc) ?
1722 TlbiAttr::ExcludeXS : TlbiAttr::None;
1723
1724 TlbiOp64::tlbiRva(tc, value,
1725 securityStateAtEL(tc, translationEl(regime)), // secure
1726 regime, // regime
1727 true, // shareable
1728 false, // last level only
1729 attrs); // attrs
1730 }
1731 },
1732
1733 { MISCREG_TLBI_RVAE1ISNXS, [](ThreadContext *tc, RegVal value)
1734 {
1735 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1736 TranslationRegime::EL20 : TranslationRegime::EL10;
1737
1738 TlbiOp64::tlbiRva(tc, value,
1739 securityStateAtEL(tc, translationEl(regime)), // secure
1740 regime, // regime
1741 true, // shareable
1742 false, // last level only
1743 TlbiAttr::ExcludeXS); // attrs
1744 }
1745 },
1746
1747 { MISCREG_TLBI_RVAE1OS, [](ThreadContext *tc, RegVal value)
1748 {
1749 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1750 TranslationRegime::EL20 : TranslationRegime::EL10;
1751
1752 const TlbiAttr attrs = fnxsAttrs(tc) ?
1753 TlbiAttr::ExcludeXS : TlbiAttr::None;
1754
1755 TlbiOp64::tlbiRva(tc, value,
1756 securityStateAtEL(tc, translationEl(regime)), // secure
1757 regime, // regime
1758 true, // shareable
1759 false, // last level only
1760 attrs); // attrs
1761 }
1762 },
1763
1764 { MISCREG_TLBI_RVAE1OSNXS, [](ThreadContext *tc, RegVal value)
1765 {
1766 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1767 TranslationRegime::EL20 : TranslationRegime::EL10;
1768
1769 TlbiOp64::tlbiRva(tc, value,
1770 securityStateAtEL(tc, translationEl(regime)), // secure
1771 regime, // regime
1772 true, // shareable
1773 false, // last level only
1774 TlbiAttr::ExcludeXS); // attrs
1775 }
1776 },
1777
1778 { MISCREG_TLBI_RVAAE1, [](ThreadContext *tc, RegVal value)
1779 {
1780 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1781 TranslationRegime::EL20 : TranslationRegime::EL10;
1782
1783 const TlbiAttr attrs = fnxsAttrs(tc) ?
1784 TlbiAttr::ExcludeXS : TlbiAttr::None;
1785
1786 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1787 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1788 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1789 hcr.fb && !hcr.tge;
1790
1791 TlbiOp64::tlbiRvaa(tc, value,
1792 securityStateAtEL(tc, translationEl(regime)), // secure
1793 regime, // regime
1794 shareable, // shareable
1795 false, // last level only
1796 attrs); // attrs
1797 }
1798 },
1799
1800 { MISCREG_TLBI_RVAAE1NXS, [](ThreadContext *tc, RegVal value)
1801 {
1802 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1803 TranslationRegime::EL20 : TranslationRegime::EL10;
1804
1805 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1806 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1807 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1808 hcr.fb && !hcr.tge;
1809
1810 TlbiOp64::tlbiRvaa(tc, value,
1811 securityStateAtEL(tc, translationEl(regime)), // secure
1812 regime, // regime
1813 shareable, // shareable
1814 false, // last level only
1815 TlbiAttr::ExcludeXS); // attrs
1816 }
1817 },
1818
1819 { MISCREG_TLBI_RVAAE1IS, [](ThreadContext *tc, RegVal value)
1820 {
1821 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1822 TranslationRegime::EL20 : TranslationRegime::EL10;
1823
1824 const TlbiAttr attrs = fnxsAttrs(tc) ?
1825 TlbiAttr::ExcludeXS : TlbiAttr::None;
1826
1827 TlbiOp64::tlbiRvaa(tc, value,
1828 securityStateAtEL(tc, translationEl(regime)), // secure
1829 regime, // regime
1830 true, // shareable
1831 false, // last level only
1832 attrs); // attrs
1833 }
1834 },
1835
1836 { MISCREG_TLBI_RVAAE1ISNXS, [](ThreadContext *tc, RegVal value)
1837 {
1838 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1839 TranslationRegime::EL20 : TranslationRegime::EL10;
1840
1841 TlbiOp64::tlbiRvaa(tc, value,
1842 securityStateAtEL(tc, translationEl(regime)), // secure
1843 regime, // regime
1844 true, // shareable
1845 false, // last level only
1846 TlbiAttr::ExcludeXS); // attrs
1847 }
1848 },
1849
1850
1851 { MISCREG_TLBI_RVAAE1OS, [](ThreadContext *tc, RegVal value)
1852 {
1853 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1854 TranslationRegime::EL20 : TranslationRegime::EL10;
1855
1856 const TlbiAttr attrs = fnxsAttrs(tc) ?
1857 TlbiAttr::ExcludeXS : TlbiAttr::None;
1858
1859 TlbiOp64::tlbiRvaa(tc, value,
1860 securityStateAtEL(tc, translationEl(regime)), // secure
1861 regime, // regime
1862 true, // shareable
1863 false, // last level only
1864 attrs); // attrs
1865 }
1866 },
1867
1868 { MISCREG_TLBI_RVAAE1OSNXS, [](ThreadContext *tc, RegVal value)
1869 {
1870 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1871 TranslationRegime::EL20 : TranslationRegime::EL10;
1872
1873 TlbiOp64::tlbiRvaa(tc, value,
1874 securityStateAtEL(tc, translationEl(regime)), // secure
1875 regime, // regime
1876 true, // shareable
1877 false, // last level only
1878 TlbiAttr::ExcludeXS); // attrs
1879 }
1880 },
1881
1882 { MISCREG_TLBI_RVALE1, [](ThreadContext *tc, RegVal value)
1883 {
1884 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1885 TranslationRegime::EL20 : TranslationRegime::EL10;
1886
1887 const TlbiAttr attrs = fnxsAttrs(tc) ?
1888 TlbiAttr::ExcludeXS : TlbiAttr::None;
1889
1890 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1891 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1892 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1893 hcr.fb && !hcr.tge;
1894
1895 TlbiOp64::tlbiRva(tc, value,
1896 securityStateAtEL(tc, translationEl(regime)), // secure
1897 regime, // regime
1898 shareable, // shareable
1899 true, // last level only
1900 attrs); // attrs
1901 }
1902 },
1903
1904 { MISCREG_TLBI_RVALE1NXS, [](ThreadContext *tc, RegVal value)
1905 {
1906 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1907 TranslationRegime::EL20 : TranslationRegime::EL10;
1908
1909 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1910 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1911 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1912 hcr.fb && !hcr.tge;
1913
1914 TlbiOp64::tlbiRva(tc, value,
1915 securityStateAtEL(tc, translationEl(regime)), // secure
1916 regime, // regime
1917 shareable, // shareable
1918 true, // last level only
1919 TlbiAttr::ExcludeXS); // attrs
1920 }
1921 },
1922
1923 { MISCREG_TLBI_RVALE1IS, [](ThreadContext *tc, RegVal value)
1924 {
1925 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1926 TranslationRegime::EL20 : TranslationRegime::EL10;
1927
1928 const TlbiAttr attrs = fnxsAttrs(tc) ?
1929 TlbiAttr::ExcludeXS : TlbiAttr::None;
1930
1931 TlbiOp64::tlbiRva(tc, value,
1932 securityStateAtEL(tc, translationEl(regime)), // secure
1933 regime, // regime
1934 true, // shareable
1935 true, // last level only
1936 attrs); // attrs
1937 }
1938 },
1939
1940 { MISCREG_TLBI_RVALE1ISNXS, [](ThreadContext *tc, RegVal value)
1941 {
1942 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1943 TranslationRegime::EL20 : TranslationRegime::EL10;
1944
1945 TlbiOp64::tlbiRva(tc, value,
1946 securityStateAtEL(tc, translationEl(regime)), // secure
1947 regime, // regime
1948 true, // shareable
1949 true, // last level only
1950 TlbiAttr::ExcludeXS); // attrs
1951 }
1952 },
1953
1954 { MISCREG_TLBI_RVALE1OS, [](ThreadContext *tc, RegVal value)
1955 {
1956 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1957 TranslationRegime::EL20 : TranslationRegime::EL10;
1958
1959 const TlbiAttr attrs = fnxsAttrs(tc) ?
1960 TlbiAttr::ExcludeXS : TlbiAttr::None;
1961
1962 TlbiOp64::tlbiRva(tc, value,
1963 securityStateAtEL(tc, translationEl(regime)), // secure
1964 regime, // regime
1965 true, // shareable
1966 true, // last level only
1967 attrs); // attrs
1968 }
1969 },
1970
1971 { MISCREG_TLBI_RVALE1OSNXS, [](ThreadContext *tc, RegVal value)
1972 {
1973 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1974 TranslationRegime::EL20 : TranslationRegime::EL10;
1975
1976 TlbiOp64::tlbiRva(tc, value,
1977 securityStateAtEL(tc, translationEl(regime)), // secure
1978 regime, // regime
1979 true, // shareable
1980 true, // last level only
1981 TlbiAttr::ExcludeXS); // attrs
1982 }
1983 },
1984
1985 { MISCREG_TLBI_RVAALE1, [](ThreadContext *tc, RegVal value)
1986 {
1987 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
1988 TranslationRegime::EL20 : TranslationRegime::EL10;
1989
1990 const TlbiAttr attrs = fnxsAttrs(tc) ?
1991 TlbiAttr::ExcludeXS : TlbiAttr::None;
1992
1993 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
1994 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
1995 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
1996 hcr.fb && !hcr.tge;
1997
1998 TlbiOp64::tlbiRvaa(tc, value,
1999 securityStateAtEL(tc, translationEl(regime)), // secure
2000 regime, // regime
2001 shareable, // shareable
2002 true, // last level only
2003 attrs); // attrs
2004 }
2005 },
2006
2007 { MISCREG_TLBI_RVAALE1NXS, [](ThreadContext *tc, RegVal value)
2008 {
2009 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
2010 TranslationRegime::EL20 : TranslationRegime::EL10;
2011
2012 // Check for Force Broadcast. Ignored if HCR_EL2.TGE == 1
2013 HCR hcr = tc->readMiscReg(MISCREG_HCR_EL2);
2014 bool shareable = currEL(tc) == EL1 && EL2Enabled(tc) &&
2015 hcr.fb && !hcr.tge;
2016
2017 TlbiOp64::tlbiRvaa(tc, value,
2018 securityStateAtEL(tc, translationEl(regime)), // secure
2019 regime, // regime
2020 shareable, // shareable
2021 true, // last level only
2022 TlbiAttr::ExcludeXS); // attrs
2023 }
2024 },
2025
2026 { MISCREG_TLBI_RVAALE1IS, [](ThreadContext *tc, RegVal value)
2027 {
2028 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
2029 TranslationRegime::EL20 : TranslationRegime::EL10;
2030
2031 const TlbiAttr attrs = fnxsAttrs(tc) ?
2032 TlbiAttr::ExcludeXS : TlbiAttr::None;
2033
2034 TlbiOp64::tlbiRvaa(tc, value,
2035 securityStateAtEL(tc, translationEl(regime)), // secure
2036 regime, // regime
2037 true, // shareable
2038 true, // last level only
2039 attrs); // attrs
2040 }
2041 },
2042
2043 { MISCREG_TLBI_RVAALE1ISNXS, [](ThreadContext *tc, RegVal value)
2044 {
2045 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
2046 TranslationRegime::EL20 : TranslationRegime::EL10;
2047
2048 TlbiOp64::tlbiRvaa(tc, value,
2049 securityStateAtEL(tc, translationEl(regime)), // secure
2050 regime, // regime
2051 true, // shareable
2052 true, // last level only
2053 TlbiAttr::ExcludeXS); // attrs
2054 }
2055 },
2056
2057 { MISCREG_TLBI_RVAALE1OS, [](ThreadContext *tc, RegVal value)
2058 {
2059 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
2060 TranslationRegime::EL20 : TranslationRegime::EL10;
2061
2062 const TlbiAttr attrs = fnxsAttrs(tc) ?
2063 TlbiAttr::ExcludeXS : TlbiAttr::None;
2064
2065 TlbiOp64::tlbiRvaa(tc, value,
2066 securityStateAtEL(tc, translationEl(regime)), // secure
2067 regime, // regime
2068 true, // shareable
2069 true, // last level only
2070 attrs); // attrs
2071 }
2072 },
2073
2074 { MISCREG_TLBI_RVAALE1OSNXS, [](ThreadContext *tc, RegVal value)
2075 {
2076 const TranslationRegime regime = ELIsInHost(tc, EL0) ?
2077 TranslationRegime::EL20 : TranslationRegime::EL10;
2078
2079 TlbiOp64::tlbiRvaa(tc, value,
2080 securityStateAtEL(tc, translationEl(regime)), // secure
2081 regime, // regime
2082 true, // shareable
2083 true, // last level only
2084 TlbiAttr::ExcludeXS); // attrs
2085 }
2086 },
2087
2088 { MISCREG_TLBI_RIPAS2E1, [](ThreadContext *tc, RegVal value)
2089 {
2090 TlbiOp64::tlbiRipaS2(tc, value,
2091 securityStateAtEL(tc, EL1), // secure
2092 TranslationRegime::EL10, // regime
2093 false, // shareable
2094 false); // last level only
2095 }
2096 },
2097
2098 { MISCREG_TLBI_RIPAS2E1NXS, [](ThreadContext *tc, RegVal value)
2099 {
2100 tlbiRipaS2(tc, value,
2101 securityStateAtEL(tc, EL1), // secure
2102 TranslationRegime::EL10, // regime
2103 false, // shareable
2104 false, // last level only
2105 TlbiAttr::ExcludeXS); // attrs
2106 }
2107 },
2108
2109
2110 { MISCREG_TLBI_RIPAS2E1IS, [](ThreadContext *tc, RegVal value)
2111 {
2112 TlbiOp64::tlbiRipaS2(tc, value,
2113 securityStateAtEL(tc, EL1), // secure
2114 TranslationRegime::EL10, // regime
2115 true, // shareable
2116 false); // last level only
2117 }
2118 },
2119
2120 { MISCREG_TLBI_RIPAS2E1ISNXS, [](ThreadContext *tc, RegVal value)
2121 {
2122 tlbiRipaS2(tc, value,
2123 securityStateAtEL(tc, EL1), // secure
2124 TranslationRegime::EL10, // regime
2125 true, // shareable
2126 false, // last level only
2127 TlbiAttr::ExcludeXS); // attrs
2128 }
2129 },
2130
2131 { MISCREG_TLBI_RIPAS2E1OS, [](ThreadContext *tc, RegVal value)
2132 {
2133 TlbiOp64::tlbiRipaS2(tc, value,
2134 securityStateAtEL(tc, EL1), // secure
2135 TranslationRegime::EL10, // regime
2136 true, // shareable
2137 false); // last level only
2138 }
2139 },
2140
2141 { MISCREG_TLBI_RIPAS2E1OSNXS, [](ThreadContext *tc, RegVal value)
2142 {
2143 tlbiRipaS2(tc, value,
2144 securityStateAtEL(tc, EL1), // secure
2145 TranslationRegime::EL10, // regime
2146 true, // shareable
2147 false, // last level only
2148 TlbiAttr::ExcludeXS); // attrs
2149 }
2150 },
2151
2152 { MISCREG_TLBI_RIPAS2E1OS, [](ThreadContext *tc, RegVal value)
2153 {
2154 tlbiRipaS2(tc, value,
2155 securityStateAtEL(tc, EL1), // secure
2156 TranslationRegime::EL10, // regime
2157 true, // shareable
2158 false); // last level only
2159 }
2160 },
2161
2162 { MISCREG_TLBI_RIPAS2E1OSNXS, [](ThreadContext *tc, RegVal value)
2163 {
2164 tlbiRipaS2(tc, value,
2165 securityStateAtEL(tc, EL1), // secure
2166 TranslationRegime::EL10, // regime
2167 true, // shareable
2168 false, // last level only
2169 TlbiAttr::ExcludeXS); // attrs
2170 }
2171 },
2172
2173 { MISCREG_TLBI_RIPAS2LE1, [](ThreadContext *tc, RegVal value)
2174 {
2175 TlbiOp64::tlbiRipaS2(tc, value,
2176 securityStateAtEL(tc, EL1), // secure
2177 TranslationRegime::EL10, // regime
2178 false, // shareable
2179 true); // last level only
2180 }
2181 },
2182
2183 { MISCREG_TLBI_RIPAS2LE1NXS, [](ThreadContext *tc, RegVal value)
2184 {
2185 tlbiRipaS2(tc, value,
2186 securityStateAtEL(tc, EL1), // secure
2187 TranslationRegime::EL10, // regime
2188 false, // shareable
2189 true, // last level only
2190 TlbiAttr::ExcludeXS); // attrs
2191 }
2192 },
2193
2194 { MISCREG_TLBI_RIPAS2LE1IS, [](ThreadContext *tc, RegVal value)
2195 {
2196 TlbiOp64::tlbiRipaS2(tc, value,
2197 securityStateAtEL(tc, EL1), // secure
2198 TranslationRegime::EL10, // regime
2199 true, // shareable
2200 true); // last level only
2201 }
2202 },
2203
2204 { MISCREG_TLBI_RIPAS2LE1ISNXS, [](ThreadContext *tc, RegVal value)
2205 {
2206 tlbiRipaS2(tc, value,
2207 securityStateAtEL(tc, EL1), // secure
2208 TranslationRegime::EL10, // regime
2209 true, // shareable
2210 true, // last level only
2211 TlbiAttr::ExcludeXS); // attrs
2212 }
2213 },
2214
2215 { MISCREG_TLBI_RIPAS2LE1OS, [](ThreadContext *tc, RegVal value)
2216 {
2217 TlbiOp64::tlbiRipaS2(tc, value,
2218 securityStateAtEL(tc, EL1), // secure
2219 TranslationRegime::EL10, // regime
2220 true, // shareable
2221 true); // last level only
2222 }
2223 },
2224
2225 { MISCREG_TLBI_RIPAS2LE1OSNXS, [](ThreadContext *tc, RegVal value)
2226 {
2227 tlbiRipaS2(tc, value,
2228 securityStateAtEL(tc, EL1), // secure
2229 TranslationRegime::EL10, // regime
2230 true, // shareable
2231 true, // last level only
2232 TlbiAttr::ExcludeXS); // attrs
2233 }
2234 },
2235
2236 { MISCREG_TLBI_RVAE2, [](ThreadContext *tc, RegVal value)
2237 {
2238 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2239 TranslationRegime::EL20 : TranslationRegime::EL2;
2240
2241 TlbiOp64::tlbiRva(tc, value,
2242 securityStateAtEL(tc, EL2), // secure
2243 regime, // regime
2244 false, // shareable
2245 false); // last level only
2246 }
2247 },
2248
2249 { MISCREG_TLBI_RVAE2NXS, [](ThreadContext *tc, RegVal value)
2250 {
2251 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2252 TranslationRegime::EL20 : TranslationRegime::EL2;
2253
2254 TlbiOp64::tlbiRva(tc, value,
2255 securityStateAtEL(tc, EL2), // secure
2256 regime, // regime
2257 false, // shareable
2258 false, // last level only
2259 TlbiAttr::ExcludeXS); // attrs
2260 }
2261 },
2262
2263 { MISCREG_TLBI_RVAE2IS, [](ThreadContext *tc, RegVal value)
2264 {
2265 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2266 TranslationRegime::EL20 : TranslationRegime::EL2;
2267
2268 TlbiOp64::tlbiRva(tc, value,
2269 securityStateAtEL(tc, EL2), // secure
2270 regime, // regime
2271 true, // shareable
2272 false); // last level only
2273 }
2274 },
2275
2276 { MISCREG_TLBI_RVAE2ISNXS, [](ThreadContext *tc, RegVal value)
2277 {
2278 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2279 TranslationRegime::EL20 : TranslationRegime::EL2;
2280
2281 TlbiOp64::tlbiRva(tc, value,
2282 securityStateAtEL(tc, EL2), // secure
2283 regime, // regime
2284 true, // shareable
2285 false, // last level only
2286 TlbiAttr::ExcludeXS); // attrs
2287 }
2288 },
2289
2290 { MISCREG_TLBI_RVAE2OS, [](ThreadContext *tc, RegVal value)
2291 {
2292 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2293 TranslationRegime::EL20 : TranslationRegime::EL2;
2294
2295 TlbiOp64::tlbiRva(tc, value,
2296 securityStateAtEL(tc, EL2), // secure
2297 regime, // regime
2298 true, // shareable
2299 false); // last level only
2300 }
2301 },
2302
2303 { MISCREG_TLBI_RVAE2OSNXS, [](ThreadContext *tc, RegVal value)
2304 {
2305 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2306 TranslationRegime::EL20 : TranslationRegime::EL2;
2307
2308 TlbiOp64::tlbiRva(tc, value,
2309 securityStateAtEL(tc, EL2), // secure
2310 regime, // regime
2311 true, // shareable
2312 false, // last level only
2313 TlbiAttr::ExcludeXS); // attrs
2314 }
2315 },
2316
2317 { MISCREG_TLBI_RVALE2, [](ThreadContext *tc, RegVal value)
2318 {
2319 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2320 TranslationRegime::EL20 : TranslationRegime::EL2;
2321
2322 TlbiOp64::tlbiRva(tc, value,
2323 securityStateAtEL(tc, EL2), // secure
2324 regime, // regime
2325 false, // shareable
2326 true); // last level only
2327 }
2328 },
2329
2330 { MISCREG_TLBI_RVALE2NXS, [](ThreadContext *tc, RegVal value)
2331 {
2332 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2333 TranslationRegime::EL20 : TranslationRegime::EL2;
2334
2335 TlbiOp64::tlbiRva(tc, value,
2336 securityStateAtEL(tc, EL2), // secure
2337 regime, // regime
2338 false, // shareable
2339 true, // last level only
2340 TlbiAttr::ExcludeXS); // attrs
2341 }
2342 },
2343
2344 { MISCREG_TLBI_RVALE2IS, [](ThreadContext *tc, RegVal value)
2345 {
2346 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2347 TranslationRegime::EL20 : TranslationRegime::EL2;
2348
2349 TlbiOp64::tlbiRva(tc, value,
2350 securityStateAtEL(tc, EL2), // secure
2351 regime, // regime
2352 true, // shareable
2353 true); // last level only
2354 }
2355 },
2356
2357 { MISCREG_TLBI_RVALE2ISNXS, [](ThreadContext *tc, RegVal value)
2358 {
2359 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2360 TranslationRegime::EL20 : TranslationRegime::EL2;
2361
2362 TlbiOp64::tlbiRva(tc, value,
2363 securityStateAtEL(tc, EL2), // secure
2364 regime, // regime
2365 true, // shareable
2366 true, // last level only
2367 TlbiAttr::ExcludeXS); // attrs
2368 }
2369 },
2370
2371 { MISCREG_TLBI_RVALE2OS, [](ThreadContext *tc, RegVal value)
2372 {
2373 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2374 TranslationRegime::EL20 : TranslationRegime::EL2;
2375
2376 TlbiOp64::tlbiRva(tc, value,
2377 securityStateAtEL(tc, EL2), // secure
2378 regime, // regime
2379 true, // shareable
2380 true); // last level only
2381 }
2382 },
2383
2384 { MISCREG_TLBI_RVALE2OSNXS, [](ThreadContext *tc, RegVal value)
2385 {
2386 const TranslationRegime regime = ELIsInHost(tc, EL2) ?
2387 TranslationRegime::EL20 : TranslationRegime::EL2;
2388
2389 TlbiOp64::tlbiRva(tc, value,
2390 securityStateAtEL(tc, EL2), // secure
2391 regime, // regime
2392 true, // shareable
2393 true, // last level only
2394 TlbiAttr::ExcludeXS); // attrs
2395 }
2396 },
2397
2398 { MISCREG_TLBI_RVAE3, [](ThreadContext *tc, RegVal value)
2399 {
2400 TlbiOp64::tlbiRva(tc, value,
2401 securityStateAtEL(tc, EL3), // secure
2402 TranslationRegime::EL3, // regime
2403 false, // shareable
2404 false); // last level only
2405 }
2406 },
2407
2408 { MISCREG_TLBI_RVAE3NXS, [](ThreadContext *tc, RegVal value)
2409 {
2410 TlbiOp64::tlbiRva(tc, value,
2411 securityStateAtEL(tc, EL3), // secure
2412 TranslationRegime::EL3, // regime
2413 false, // shareable
2414 false, // last level only
2415 TlbiAttr::ExcludeXS); // attrs
2416 }
2417 },
2418
2419 { MISCREG_TLBI_RVAE3IS, [](ThreadContext *tc, RegVal value)
2420 {
2421 TlbiOp64::tlbiRva(tc, value,
2422 securityStateAtEL(tc, EL3), // secure
2423 TranslationRegime::EL3, // regime
2424 true, // shareable
2425 false); // last level only
2426 }
2427 },
2428
2429 { MISCREG_TLBI_RVAE3ISNXS, [](ThreadContext *tc, RegVal value)
2430 {
2431 TlbiOp64::tlbiRva(tc, value,
2432 securityStateAtEL(tc, EL3), // secure
2433 TranslationRegime::EL3, // regime
2434 true, // shareable
2435 false, // last level only
2436 TlbiAttr::ExcludeXS); // attrs
2437 }
2438 },
2439
2440 { MISCREG_TLBI_RVAE3OS, [](ThreadContext *tc, RegVal value)
2441 {
2442 TlbiOp64::tlbiRva(tc, value,
2443 securityStateAtEL(tc, EL3), // secure
2444 TranslationRegime::EL3, // regime
2445 true, // shareable
2446 false); // last level only
2447 }
2448 },
2449
2450 { MISCREG_TLBI_RVAE3OSNXS, [](ThreadContext *tc, RegVal value)
2451 {
2452 TlbiOp64::tlbiRva(tc, value,
2453 securityStateAtEL(tc, EL3), // secure
2454 TranslationRegime::EL3, // regime
2455 true, // shareable
2456 false, // last level only
2457 TlbiAttr::ExcludeXS); // attrs
2458 }
2459 },
2460
2461 { MISCREG_TLBI_RVALE3, [](ThreadContext *tc, RegVal value)
2462 {
2463 TlbiOp64::tlbiRva(tc, value,
2464 securityStateAtEL(tc, EL3), // secure
2465 TranslationRegime::EL3, // regime
2466 false, // shareable
2467 true); // last level only
2468 }
2469 },
2470
2471 { MISCREG_TLBI_RVALE3NXS, [](ThreadContext *tc, RegVal value)
2472 {
2473 TlbiOp64::tlbiRva(tc, value,
2474 securityStateAtEL(tc, EL3), // secure
2475 TranslationRegime::EL3, // regime
2476 false, // shareable
2477 true, // last level only
2478 TlbiAttr::ExcludeXS); // attrs
2479 }
2480 },
2481
2482 { MISCREG_TLBI_RVALE3IS, [](ThreadContext *tc, RegVal value)
2483 {
2484 TlbiOp64::tlbiRva(tc, value,
2485 securityStateAtEL(tc, EL3), // secure
2486 TranslationRegime::EL3, // regime
2487 true, // shareable
2488 true); // last level only
2489 }
2490 },
2491
2492 { MISCREG_TLBI_RVALE3ISNXS, [](ThreadContext *tc, RegVal value)
2493 {
2494 TlbiOp64::tlbiRva(tc, value,
2495 securityStateAtEL(tc, EL3), // secure
2496 TranslationRegime::EL3, // regime
2497 true, // shareable
2498 true, // last level only
2499 TlbiAttr::ExcludeXS); // attrs
2500 }
2501 },
2502
2503 { MISCREG_TLBI_RVALE3OS, [](ThreadContext *tc, RegVal value)
2504 {
2505 TlbiOp64::tlbiRva(tc, value,
2506 securityStateAtEL(tc, EL3), // secure
2507 TranslationRegime::EL3, // regime
2508 true, // shareable
2509 true); // last level only
2510 }
2511 },
2512
2513 { MISCREG_TLBI_RVALE3OSNXS, [](ThreadContext *tc, RegVal value)
2514 {
2515 TlbiOp64::tlbiRva(tc, value,
2516 securityStateAtEL(tc, EL3), // secure
2517 TranslationRegime::EL3, // regime
2518 true, // shareable
2519 true, // last level only
2520 TlbiAttr::ExcludeXS); // attrs
2521 }
2522 },
2523};
2524
2525void
2527{
2528 ThreadContext* tc = xc->tcBase();
2529
2530 if (auto it = tlbiOps.find(dest_idx); it != tlbiOps.end()) {
2531 it->second(tc, value);
2532 } else {
2533 panic("Invalid TLBI\n");
2534 }
2535}
2536
2539{
2540 ThreadContext* tc = xc->tcBase();
2541
2542 switch (dest_idx) {
2561 0, val);
2572 default:
2573 return std::make_pair(NoFault, 0);
2574 }
2575
2576 return std::make_pair(NoFault, 0);
2577}
2578
2583{
2584 // If we're in timing mode then doing the translation in
2585 // functional mode then we're slightly distorting performance
2586 // results obtained from simulations. The translation should be
2587 // done in the same mode the core is running in. NOTE: This
2588 // can't be an atomic translation because that causes problems
2589 // with unexpected atomic snoop requests.
2590 warn_once("Doing AT (address translation) in functional mode! Fix Me!\n");
2591
2592 auto req = std::make_shared<Request>(
2594 tc->pcState().instAddr(), tc->contextId());
2595
2596 Fault fault = getMMUPtr(tc)->translateFunctional(
2597 req, tc, mode, tran_type);
2598
2599 PAR par = 0;
2600 bool raise_fault = false;
2601 if (fault == NoFault) {
2602 Addr paddr = req->getPaddr();
2603 uint64_t attr = getMMUPtr(tc)->getAttr();
2604 // clear LAPE bit from attribute.
2605 attr &= ~ uint64_t(0x800);
2606 uint64_t attr1 = attr >> 56;
2607 if (!(attr1 >> 4) || attr1 == 0x44) {
2608 attr |= 0x100;
2609 attr &= ~ uint64_t(0x80);
2610 }
2611 par = (paddr & mask(47, 12)) | attr;
2612 DPRINTF(MiscRegs, "AT: Translated addr %#x: PAR_EL1: %#x\n",
2613 val, par);
2614 } else {
2615 ArmFault *arm_fault = static_cast<ArmFault *>(fault.get());
2616 arm_fault->update(tc);
2617 // Set fault bit and FSR
2618 FSR fsr = arm_fault->getFsr(tc);
2619
2620 arm_fault->annotate(ArmFault::CM, 1); // CM
2621 arm_fault->annotate(ArmFault::WnR, 1); // Force WnR as 1
2622
2623 par.f = 1; // F bit
2624 par.fst = fsr.status; // FST
2625 par.ptw = (arm_fault->iss() >> 7) & 0x1; // S1PTW
2626 par.s = arm_fault->isStage2() ? 1 : 0; // S
2627 // set RES1 bit [11].
2628 par |= 0x800;
2629
2630 // Only raise fault for external abort and stage 2 fault,
2631 // see R~NHWXL~ in Arm-ARM.
2632 raise_fault = arm_fault->isExternalAbort() || par.ptw;
2633
2634 DPRINTF(MiscRegs, "AT: Translated addr %#x fault fsr %#x: PAR: %#x\n",
2635 val, fsr, par);
2636 }
2637
2638 // Fault filter.
2639 if (fault != NoFault && !raise_fault) {
2640 fault = NoFault;
2641 }
2642
2643 return std::make_pair(fault, par);
2644}
2645
2646} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:209
virtual FSR getFsr(ThreadContext *tc) const
Definition faults.hh:248
virtual uint32_t iss() const =0
virtual void annotate(AnnotationIDs id, uint64_t val)
Definition faults.hh:231
virtual bool isExternalAbort() const
Definition faults.hh:252
virtual void update(ThreadContext *tc)
Definition faults.cc:413
virtual bool isStage2() const
Definition faults.hh:247
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
static bool hasUnprivRegime(TranslationRegime regime)
Definition mmu.cc:816
uint64_t getAttr() const
Definition mmu.hh:306
TranslationGenPtr translateFunctional(Addr start, Addr size, ThreadContext *tc, Mode mode, Request::Flags flags) override
Returns a translation generator for a region of virtual addresses, instead of directly translating a ...
Definition mmu.hh:86
Implementaton of AArch64 TLBI ALLE(1,2,3)(IS) instructions.
Definition tlbi_op.hh:170
TLB Invalidate by ASID match.
Definition tlbi_op.hh:215
TLB Invalidate by Intermediate Physical Address.
Definition tlbi_op.hh:406
TLB Invalidate by VA, All ASID.
Definition tlbi_op.hh:280
TLB Invalidate by VA.
Definition tlbi_op.hh:300
void broadcast(ThreadContext *tc)
Broadcast the TLB Invalidate operation to all TLBs in the Arm system.
Definition tlbi_op.hh:79
TLB Range Invalidate by VA, All ASIDs.
Definition tlbi_op.hh:486
TLB Range Invalidate by VA, All ASIDs.
Definition tlbi_op.hh:473
TLB Range Invalidate by VA.
Definition tlbi_op.hh:460
Implementaton of AArch64 TLBI VMALLE1(IS)/VMALLS112E1(IS) instructions.
Definition tlbi_op.hh:191
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
Definition system.hh:206
std::pair< Fault, uint64_t > performAt(ExecContext *xc, ArmISA::MiscRegIndex idx, RegVal val) const
Definition misc64.cc:2538
std::pair< Fault, uint64_t > addressTranslation64(ThreadContext *tc, ArmISA::MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val) const
Definition misc64.cc:2580
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual ThreadContext * tcBase() const =0
Returns a pointer to the ThreadContext.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:50
uint64_t imm
Definition misc64.hh:52
RegVal miscRegImm() const
Returns the "register view" of the immediate field.
Definition misc64.cc:133
ArmISA::MiscRegIndex dest
Definition misc64.hh:185
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:148
const ArmISA::MiscRegNum64 miscReg
Definition misc64.hh:248
const std::string fullMnemonic
Definition misc64.hh:247
uint32_t iss() const override
Definition misc64.cc:218
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:211
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
Definition misc64.cc:200
const RegIndex intReg
Definition misc64.hh:249
uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg, RegIndex int_index) const
Definition misc64.cc:115
Fault generateTrap(ArmISA::ExceptionLevel el) const
Definition misc64.cc:127
virtual uint32_t iss() const
Definition misc64.hh:174
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:160
ArmISA::MiscRegIndex dest
Definition misc64.hh:209
uint32_t iss() const override
Definition misc64.cc:172
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
Definition pcstate.hh:108
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:68
uint32_t iss() const override
Definition misc64.cc:192
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:180
ArmISA::MiscRegIndex op1
Definition misc64.hh:229
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
Definition misc64.cc:224
RegIndex dest
Definition misc64.hh:274
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:59
RegIndex op1
Definition misc64.hh:66
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:80
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:93
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
Definition request.hh:282
std::bitset< Num_Flags > flags
Flag values for this instruction.
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
virtual ContextID contextId() const =0
static void tlbiVa(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:260
static void tlbiIpaS2(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:322
static bool fnxsAttrs(ThreadContext *tc)
Definition misc64.cc:391
static void tlbiVaa(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:290
static void tlbiAsid(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:305
static void tlbiRipaS2(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:374
static std::unordered_map< ArmISA::MiscRegIndex, TlbiFunc > tlbiOps
Definition misc64.hh:292
void performTlbi(ExecContext *xc, ArmISA::MiscRegIndex idx, RegVal value) const
Definition misc64.cc:2526
static void tlbiRvaa(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:339
static void tlbiRva(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:352
static void tlbiAll(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:234
static void tlbiVmall(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool stage2=false, TlbiAttr attrs=TlbiAttr::None)
Definition misc64.cc:247
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:108
STL pair class.
Definition stl.hh:58
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
uint8_t flags
Definition helpers.cc:87
#define warn_once(...)
Definition logging.hh:260
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:291
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
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:134
Fault checkFaultAccessAArch64SysReg(MiscRegIndex reg, CPSR cpsr, ThreadContext *tc, const MiscRegOp64 &inst)
Definition misc.cc:744
MMU * getMMUPtr(T *tc)
Definition mmu.hh:449
SecurityState securityStateAtEL(ThreadContext *tc, ExceptionLevel el)
Definition utility.cc:93
bool EL2Enabled(ThreadContext *tc)
Definition utility.cc:268
ExceptionLevel translationEl(TranslationRegime regime)
Definition utility.cc:1399
SecurityState
Security State.
Definition types.hh:273
bool isHcrxEL2Enabled(ThreadContext *tc)
Definition utility.cc:1369
@ MISCREG_SPSEL
Definition misc.hh:655
@ MISCREG_AT_S1E1W_Xt
Definition misc.hh:698
@ MISCREG_AT_S1E2W_Xt
Definition misc.hh:709
@ MISCREG_AT_S12E1W_Xt
Definition misc.hh:711
@ MISCREG_AT_S12E0W_Xt
Definition misc.hh:713
@ MISCREG_AT_S1E2R_Xt
Definition misc.hh:708
@ MISCREG_CPSR
Definition misc.hh:79
@ MISCREG_AT_S1E1R_Xt
Definition misc.hh:697
@ MISCREG_AT_S1E3R_Xt
Definition misc.hh:714
@ MISCREG_HCR_EL2
Definition misc.hh:619
@ MISCREG_AT_S12E0R_Xt
Definition misc.hh:712
@ MISCREG_AT_S1E0W_Xt
Definition misc.hh:700
@ MISCREG_AT_S12E1R_Xt
Definition misc.hh:710
@ MISCREG_HCRX_EL2
Definition misc.hh:620
@ MISCREG_AT_S1E3W_Xt
Definition misc.hh:715
@ MISCREG_AT_S1E0R_Xt
Definition misc.hh:699
@ MISCREG_IMPDEF_UNIMPL
Definition misc.hh:1203
std::optional< MiscRegNum64 > encodeAArch64SysReg(MiscRegIndex misc_reg)
Definition misc.cc:2956
Bitfield< 3, 2 > el
Definition misc_types.hh:73
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Definition utility.cc:232
Bitfield< 21 > ss
Definition misc_types.hh:60
Bitfield< 4 > pc
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint16_t RegIndex
Definition types.hh:176
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t RegVal
Definition types.hh:173
std::string csprintf(const char *format, const Args &...args)
Definition cprintf.hh:161
constexpr decltype(nullptr) NoFault
Definition types.hh:253
void ccprintf(cp::Print &print)
Definition cprintf.hh:130
The file contains the definition of a set of TLB Invalidate Instructions.

Generated on Mon Jan 13 2025 04:28:18 for gem5 by doxygen 1.9.8