42#include "debug/MiscRegs.hh"
47using namespace ArmISA;
118 (misc_reg.
crm << 1) |
120 (misc_reg.
crn << 10) |
121 (misc_reg.
op1 << 14) |
122 (misc_reg.
op2 << 17) |
123 (misc_reg.
op0 << 20);
139 return (
imm & 0x1) << 22;
141 return (
imm & 0x1) << 23;
143 panic(
"Not a valid PSTATE field register\n");
151 std::stringstream
ss;
163 std::stringstream
ss;
175 assert(misc_reg.has_value());
176 return _iss(misc_reg.value(),
op1);
183 std::stringstream
ss;
195 assert(misc_reg.has_value());
196 return _iss(misc_reg.value(),
dest);
227 std::stringstream
ss;
267 auto asid = asid_16bits ?
bits(value, 63, 48) :
271 asid, last_level, attrs);
279 static_cast<Addr>(
bits(value, 43, 0)) << 12, last_level,
295 static_cast<Addr>(
bits(value, 43, 0)) << 12, last_level,
310 auto asid = asid_16bits ?
bits(value, 63, 48) :
327 TLBIIPA tlbi_op(tc, TranslationRegime::EL10,
ss, value,
343 TLBIRMVAA tlbi_op(regime,
ss, value, last_level, attrs);
359 auto asid = asid_16bits ?
bits(value, 63, 48) :
369 tlbiRvaa(tc, value,
ss, regime, shareable, last_level, attrs);
379 TLBIRIPA tlbi_op(tc, TranslationRegime::EL10,
ss, value,
395 HaveExt(tc, ArmExtension::FEAT_XS) &&
396 HaveExt(tc, ArmExtension::FEAT_HCX) &&
404 SecurityState::Secure,
405 TranslationRegime::EL3,
410 { MISCREG_TLBI_ALLE3NXS, [](ThreadContext *tc,
RegVal value)
413 SecurityState::Secure,
414 TranslationRegime::EL3,
416 TlbiAttr::ExcludeXS);
420 { MISCREG_TLBI_ALLE3IS, [](ThreadContext *tc,
RegVal value)
423 SecurityState::Secure,
424 TranslationRegime::EL3,
429 { MISCREG_TLBI_ALLE3ISNXS, [](ThreadContext *tc,
RegVal value)
432 SecurityState::Secure,
433 TranslationRegime::EL3,
435 TlbiAttr::ExcludeXS);
439 { MISCREG_TLBI_ALLE3OS, [](ThreadContext *tc,
RegVal value)
442 SecurityState::Secure,
443 TranslationRegime::EL3,
448 { MISCREG_TLBI_ALLE3OSNXS, [](ThreadContext *tc,
RegVal value)
451 SecurityState::Secure,
452 TranslationRegime::EL3,
454 TlbiAttr::ExcludeXS);
459 { MISCREG_TLBI_ALLE2, [](ThreadContext *tc,
RegVal value)
462 TranslationRegime::EL20 : TranslationRegime::EL2;
471 { MISCREG_TLBI_ALLE2NXS, [](ThreadContext *tc,
RegVal value)
474 TranslationRegime::EL20 : TranslationRegime::EL2;
480 TlbiAttr::ExcludeXS);
484 { MISCREG_TLBI_ALLE2IS, [](ThreadContext *tc,
RegVal value)
487 TranslationRegime::EL20 : TranslationRegime::EL2;
496 { MISCREG_TLBI_ALLE2ISNXS, [](ThreadContext *tc,
RegVal value)
499 TranslationRegime::EL20 : TranslationRegime::EL2;
505 TlbiAttr::ExcludeXS);
509 { MISCREG_TLBI_ALLE2OS, [](ThreadContext *tc,
RegVal value)
512 TranslationRegime::EL20 : TranslationRegime::EL2;
521 { MISCREG_TLBI_ALLE2OSNXS, [](ThreadContext *tc,
RegVal value)
524 TranslationRegime::EL20 : TranslationRegime::EL2;
530 TlbiAttr::ExcludeXS);
534 { MISCREG_TLBI_ALLE1, [](ThreadContext *tc,
RegVal value)
538 TranslationRegime::EL10,
543 { MISCREG_TLBI_ALLE1NXS, [](ThreadContext *tc,
RegVal value)
547 TranslationRegime::EL10,
549 TlbiAttr::ExcludeXS);
553 { MISCREG_TLBI_ALLE1IS, [](ThreadContext *tc,
RegVal value)
557 TranslationRegime::EL10,
562 { MISCREG_TLBI_ALLE1ISNXS, [](ThreadContext *tc,
RegVal value)
566 TranslationRegime::EL10,
568 TlbiAttr::ExcludeXS);
572 { MISCREG_TLBI_ALLE1OS, [](ThreadContext *tc,
RegVal value)
576 TranslationRegime::EL10,
581 { MISCREG_TLBI_ALLE1OSNXS, [](ThreadContext *tc,
RegVal value)
585 TranslationRegime::EL10,
587 TlbiAttr::ExcludeXS);
592 { MISCREG_TLBI_VMALLE1, [](ThreadContext *tc,
RegVal value)
595 TranslationRegime::EL20 : TranslationRegime::EL10;
597 const TlbiAttr attrs = fnxsAttrs(tc) ?
598 TlbiAttr::ExcludeXS : TlbiAttr::None;
614 { MISCREG_TLBI_VMALLE1NXS, [](ThreadContext *tc,
RegVal value)
617 TranslationRegime::EL20 : TranslationRegime::EL10;
629 TlbiAttr::ExcludeXS);
633 { MISCREG_TLBI_VMALLE1IS, [](ThreadContext *tc,
RegVal value)
636 TranslationRegime::EL20 : TranslationRegime::EL10;
638 const TlbiAttr attrs = fnxsAttrs(tc) ?
639 TlbiAttr::ExcludeXS : TlbiAttr::None;
650 { MISCREG_TLBI_VMALLE1ISNXS, [](ThreadContext *tc,
RegVal value)
653 TranslationRegime::EL20 : TranslationRegime::EL10;
660 TlbiAttr::ExcludeXS);
664 { MISCREG_TLBI_VMALLE1OS, [](ThreadContext *tc,
RegVal value)
667 TranslationRegime::EL20 : TranslationRegime::EL10;
669 const TlbiAttr attrs = fnxsAttrs(tc) ?
670 TlbiAttr::ExcludeXS : TlbiAttr::None;
681 { MISCREG_TLBI_VMALLE1OSNXS, [](ThreadContext *tc,
RegVal value)
684 TranslationRegime::EL20 : TranslationRegime::EL10;
691 TlbiAttr::ExcludeXS);
695 { MISCREG_TLBI_VMALLS12E1, [](ThreadContext *tc,
RegVal value)
699 TranslationRegime::EL10,
705 { MISCREG_TLBI_VMALLS12E1NXS, [](ThreadContext *tc,
RegVal value)
709 TranslationRegime::EL10,
712 TlbiAttr::ExcludeXS);
716 { MISCREG_TLBI_VMALLS12E1IS, [](ThreadContext *tc,
RegVal value)
720 TranslationRegime::EL10,
726 { MISCREG_TLBI_VMALLS12E1ISNXS, [](ThreadContext *tc,
RegVal value)
730 TranslationRegime::EL10,
733 TlbiAttr::ExcludeXS);
737 { MISCREG_TLBI_VMALLS12E1OS, [](ThreadContext *tc,
RegVal value)
741 TranslationRegime::EL10,
747 { MISCREG_TLBI_VMALLS12E1OSNXS, [](ThreadContext *tc,
RegVal value)
751 TranslationRegime::EL10,
754 TlbiAttr::ExcludeXS);
759 { MISCREG_TLBI_VAE3, [](ThreadContext *tc,
RegVal value)
762 SecurityState::Secure,
763 TranslationRegime::EL3,
769 { MISCREG_TLBI_VAE3NXS, [](ThreadContext *tc,
RegVal value)
772 SecurityState::Secure,
773 TranslationRegime::EL3,
776 TlbiAttr::ExcludeXS);
781 { MISCREG_TLBI_VAE3IS, [](ThreadContext *tc,
RegVal value)
784 SecurityState::Secure,
785 TranslationRegime::EL3,
791 { MISCREG_TLBI_VAE3ISNXS, [](ThreadContext *tc,
RegVal value)
794 SecurityState::Secure,
795 TranslationRegime::EL3,
798 TlbiAttr::ExcludeXS);
802 { MISCREG_TLBI_VAE3OS, [](ThreadContext *tc,
RegVal value)
805 SecurityState::Secure,
806 TranslationRegime::EL3,
812 { MISCREG_TLBI_VAE3OSNXS, [](ThreadContext *tc,
RegVal value)
815 SecurityState::Secure,
816 TranslationRegime::EL3,
819 TlbiAttr::ExcludeXS);
824 { MISCREG_TLBI_VALE3, [](ThreadContext *tc,
RegVal value)
827 SecurityState::Secure,
828 TranslationRegime::EL3,
834 { MISCREG_TLBI_VALE3NXS, [](ThreadContext *tc,
RegVal value)
837 SecurityState::Secure,
838 TranslationRegime::EL3,
841 TlbiAttr::ExcludeXS);
846 { MISCREG_TLBI_VALE3IS, [](ThreadContext *tc,
RegVal value)
849 SecurityState::Secure,
850 TranslationRegime::EL3,
856 { MISCREG_TLBI_VALE3ISNXS, [](ThreadContext *tc,
RegVal value)
859 SecurityState::Secure,
860 TranslationRegime::EL3,
863 TlbiAttr::ExcludeXS);
868 { MISCREG_TLBI_VALE3OS, [](ThreadContext *tc,
RegVal value)
871 SecurityState::Secure,
872 TranslationRegime::EL3,
878 { MISCREG_TLBI_VALE3OSNXS, [](ThreadContext *tc,
RegVal value)
881 SecurityState::Secure,
882 TranslationRegime::EL3,
885 TlbiAttr::ExcludeXS);
889 { MISCREG_TLBI_VAE2, [](ThreadContext *tc,
RegVal value)
892 TranslationRegime::EL20 : TranslationRegime::EL2;
902 { MISCREG_TLBI_VAE2NXS, [](ThreadContext *tc,
RegVal value)
905 TranslationRegime::EL20 : TranslationRegime::EL2;
912 TlbiAttr::ExcludeXS);
916 { MISCREG_TLBI_VAE2IS, [](ThreadContext *tc,
RegVal value)
920 TranslationRegime::EL2,
926 { MISCREG_TLBI_VAE2ISNXS, [](ThreadContext *tc,
RegVal value)
930 TranslationRegime::EL2,
933 TlbiAttr::ExcludeXS);
938 { MISCREG_TLBI_VAE2OS, [](ThreadContext *tc,
RegVal value)
942 TranslationRegime::EL2,
948 { MISCREG_TLBI_VAE2OSNXS, [](ThreadContext *tc,
RegVal value)
952 TranslationRegime::EL2,
955 TlbiAttr::ExcludeXS);
960 { MISCREG_TLBI_VALE2, [](ThreadContext *tc,
RegVal value)
963 TranslationRegime::EL20 : TranslationRegime::EL2;
973 { MISCREG_TLBI_VALE2NXS, [](ThreadContext *tc,
RegVal value)
976 TranslationRegime::EL20 : TranslationRegime::EL2;
983 TlbiAttr::ExcludeXS);
987 { MISCREG_TLBI_VALE2IS, [](ThreadContext *tc,
RegVal value)
990 TranslationRegime::EL20 : TranslationRegime::EL2;
1000 { MISCREG_TLBI_VALE2ISNXS, [](ThreadContext *tc,
RegVal value)
1003 TranslationRegime::EL20 : TranslationRegime::EL2;
1010 TlbiAttr::ExcludeXS);
1014 { MISCREG_TLBI_VALE2OS, [](ThreadContext *tc,
RegVal value)
1017 TranslationRegime::EL20 : TranslationRegime::EL2;
1027 { MISCREG_TLBI_VALE2OSNXS, [](ThreadContext *tc,
RegVal value)
1030 TranslationRegime::EL20 : TranslationRegime::EL2;
1037 TlbiAttr::ExcludeXS);
1041 { MISCREG_TLBI_VAE1, [](ThreadContext *tc,
RegVal value)
1044 TranslationRegime::EL20 : TranslationRegime::EL10;
1046 const TlbiAttr attrs = fnxsAttrs(tc) ?
1047 TlbiAttr::ExcludeXS : TlbiAttr::None;
1063 { MISCREG_TLBI_VAE1NXS, [](ThreadContext *tc,
RegVal value)
1066 TranslationRegime::EL20 : TranslationRegime::EL10;
1078 TlbiAttr::ExcludeXS);
1082 { MISCREG_TLBI_VAE1IS, [](ThreadContext *tc,
RegVal value)
1085 TranslationRegime::EL20 : TranslationRegime::EL10;
1087 const TlbiAttr attrs = fnxsAttrs(tc) ?
1088 TlbiAttr::ExcludeXS : TlbiAttr::None;
1099 { MISCREG_TLBI_VAE1ISNXS, [](ThreadContext *tc,
RegVal value)
1102 TranslationRegime::EL20 : TranslationRegime::EL10;
1109 TlbiAttr::ExcludeXS);
1113 { MISCREG_TLBI_VAE1OS, [](ThreadContext *tc,
RegVal value)
1116 TranslationRegime::EL20 : TranslationRegime::EL10;
1118 const TlbiAttr attrs = fnxsAttrs(tc) ?
1119 TlbiAttr::ExcludeXS : TlbiAttr::None;
1130 { MISCREG_TLBI_VAE1OSNXS, [](ThreadContext *tc,
RegVal value)
1133 TranslationRegime::EL20 : TranslationRegime::EL10;
1140 TlbiAttr::ExcludeXS);
1144 { MISCREG_TLBI_VALE1, [](ThreadContext *tc,
RegVal value)
1147 TranslationRegime::EL20 : TranslationRegime::EL10;
1149 const TlbiAttr attrs = fnxsAttrs(tc) ?
1150 TlbiAttr::ExcludeXS : TlbiAttr::None;
1161 { MISCREG_TLBI_VALE1NXS, [](ThreadContext *tc,
RegVal value)
1164 TranslationRegime::EL20 : TranslationRegime::EL10;
1176 TlbiAttr::ExcludeXS);
1180 { MISCREG_TLBI_VALE1IS, [](ThreadContext *tc,
RegVal value)
1183 TranslationRegime::EL20 : TranslationRegime::EL10;
1185 const TlbiAttr attrs = fnxsAttrs(tc) ?
1186 TlbiAttr::ExcludeXS : TlbiAttr::None;
1197 { MISCREG_TLBI_VALE1ISNXS, [](ThreadContext *tc,
RegVal value)
1200 TranslationRegime::EL20 : TranslationRegime::EL10;
1207 TlbiAttr::ExcludeXS);
1211 { MISCREG_TLBI_VALE1OS, [](ThreadContext *tc,
RegVal value)
1214 TranslationRegime::EL20 : TranslationRegime::EL10;
1216 const TlbiAttr attrs = fnxsAttrs(tc) ?
1217 TlbiAttr::ExcludeXS : TlbiAttr::None;
1228 { MISCREG_TLBI_VALE1OSNXS, [](ThreadContext *tc,
RegVal value)
1231 TranslationRegime::EL20 : TranslationRegime::EL10;
1238 TlbiAttr::ExcludeXS);
1242 { MISCREG_TLBI_ASIDE1, [](ThreadContext *tc,
RegVal value)
1245 TranslationRegime::EL20 : TranslationRegime::EL10;
1247 const TlbiAttr attrs = fnxsAttrs(tc) ?
1248 TlbiAttr::ExcludeXS : TlbiAttr::None;
1263 { MISCREG_TLBI_ASIDE1NXS, [](ThreadContext *tc,
RegVal value)
1266 TranslationRegime::EL20 : TranslationRegime::EL10;
1277 TlbiAttr::ExcludeXS);
1281 { MISCREG_TLBI_ASIDE1IS, [](ThreadContext *tc,
RegVal value)
1284 TranslationRegime::EL20 : TranslationRegime::EL10;
1286 const TlbiAttr attrs = fnxsAttrs(tc) ?
1287 TlbiAttr::ExcludeXS : TlbiAttr::None;
1297 { MISCREG_TLBI_ASIDE1ISNXS, [](ThreadContext *tc,
RegVal value)
1300 TranslationRegime::EL20 : TranslationRegime::EL10;
1306 TlbiAttr::ExcludeXS);
1310 { MISCREG_TLBI_ASIDE1OS, [](ThreadContext *tc,
RegVal value)
1313 TranslationRegime::EL20 : TranslationRegime::EL10;
1315 const TlbiAttr attrs = fnxsAttrs(tc) ?
1316 TlbiAttr::ExcludeXS : TlbiAttr::None;
1326 { MISCREG_TLBI_ASIDE1OSNXS, [](ThreadContext *tc,
RegVal value)
1329 TranslationRegime::EL20 : TranslationRegime::EL10;
1335 TlbiAttr::ExcludeXS);
1339 { MISCREG_TLBI_VAAE1, [](ThreadContext *tc,
RegVal value)
1342 TranslationRegime::EL20 : TranslationRegime::EL10;
1344 const TlbiAttr attrs = fnxsAttrs(tc) ?
1345 TlbiAttr::ExcludeXS : TlbiAttr::None;
1361 { MISCREG_TLBI_VAAE1NXS, [](ThreadContext *tc,
RegVal value)
1364 TranslationRegime::EL20 : TranslationRegime::EL10;
1376 TlbiAttr::ExcludeXS);
1380 { MISCREG_TLBI_VAAE1IS, [](ThreadContext *tc,
RegVal value)
1383 TranslationRegime::EL20 : TranslationRegime::EL10;
1385 const TlbiAttr attrs = fnxsAttrs(tc) ?
1386 TlbiAttr::ExcludeXS : TlbiAttr::None;
1397 { MISCREG_TLBI_VAAE1ISNXS, [](ThreadContext *tc,
RegVal value)
1400 TranslationRegime::EL20 : TranslationRegime::EL10;
1407 TlbiAttr::ExcludeXS);
1411 { MISCREG_TLBI_VAAE1OS, [](ThreadContext *tc,
RegVal value)
1414 TranslationRegime::EL20 : TranslationRegime::EL10;
1416 const TlbiAttr attrs = fnxsAttrs(tc) ?
1417 TlbiAttr::ExcludeXS : TlbiAttr::None;
1428 { MISCREG_TLBI_VAAE1OSNXS, [](ThreadContext *tc,
RegVal value)
1431 TranslationRegime::EL20 : TranslationRegime::EL10;
1438 TlbiAttr::ExcludeXS);
1442 { MISCREG_TLBI_VAALE1, [](ThreadContext *tc,
RegVal value)
1445 TranslationRegime::EL20 : TranslationRegime::EL10;
1447 const TlbiAttr attrs = fnxsAttrs(tc) ?
1448 TlbiAttr::ExcludeXS : TlbiAttr::None;
1464 { MISCREG_TLBI_VAALE1NXS, [](ThreadContext *tc,
RegVal value)
1467 TranslationRegime::EL20 : TranslationRegime::EL10;
1479 TlbiAttr::ExcludeXS);
1483 { MISCREG_TLBI_VAALE1IS, [](ThreadContext *tc,
RegVal value)
1486 TranslationRegime::EL20 : TranslationRegime::EL10;
1488 const TlbiAttr attrs = fnxsAttrs(tc) ?
1489 TlbiAttr::ExcludeXS : TlbiAttr::None;
1500 { MISCREG_TLBI_VAALE1ISNXS, [](ThreadContext *tc,
RegVal value)
1503 TranslationRegime::EL20 : TranslationRegime::EL10;
1510 TlbiAttr::ExcludeXS);
1514 { MISCREG_TLBI_VAALE1OS, [](ThreadContext *tc,
RegVal value)
1517 TranslationRegime::EL20 : TranslationRegime::EL10;
1519 const TlbiAttr attrs = fnxsAttrs(tc) ?
1520 TlbiAttr::ExcludeXS : TlbiAttr::None;
1531 { MISCREG_TLBI_VAALE1OSNXS, [](ThreadContext *tc,
RegVal value)
1534 TranslationRegime::EL20 : TranslationRegime::EL10;
1541 TlbiAttr::ExcludeXS);
1545 { MISCREG_TLBI_IPAS2E1, [](ThreadContext *tc,
RegVal value)
1549 TranslationRegime::EL10,
1555 { MISCREG_TLBI_IPAS2E1NXS, [](ThreadContext *tc,
RegVal value)
1559 TranslationRegime::EL10,
1562 TlbiAttr::ExcludeXS);
1566 { MISCREG_TLBI_IPAS2E1IS, [](ThreadContext *tc,
RegVal value)
1570 TranslationRegime::EL10,
1576 { MISCREG_TLBI_IPAS2E1ISNXS, [](ThreadContext *tc,
RegVal value)
1580 TranslationRegime::EL10,
1583 TlbiAttr::ExcludeXS);
1588 { MISCREG_TLBI_IPAS2E1OS, [](ThreadContext *tc,
RegVal value)
1592 TranslationRegime::EL10,
1598 { MISCREG_TLBI_IPAS2E1OSNXS, [](ThreadContext *tc,
RegVal value)
1602 TranslationRegime::EL10,
1605 TlbiAttr::ExcludeXS);
1609 { MISCREG_TLBI_IPAS2LE1, [](ThreadContext *tc,
RegVal value)
1613 TranslationRegime::EL10,
1619 { MISCREG_TLBI_IPAS2LE1NXS, [](ThreadContext *tc,
RegVal value)
1623 TranslationRegime::EL10,
1626 TlbiAttr::ExcludeXS);
1631 { MISCREG_TLBI_IPAS2LE1IS, [](ThreadContext *tc,
RegVal value)
1635 TranslationRegime::EL10,
1641 { MISCREG_TLBI_IPAS2LE1ISNXS, [](ThreadContext *tc,
RegVal value)
1645 TranslationRegime::EL10,
1648 TlbiAttr::ExcludeXS);
1653 { MISCREG_TLBI_IPAS2LE1OS, [](ThreadContext *tc,
RegVal value)
1657 TranslationRegime::EL10,
1663 { MISCREG_TLBI_IPAS2LE1OSNXS, [](ThreadContext *tc,
RegVal value)
1667 TranslationRegime::EL10,
1670 TlbiAttr::ExcludeXS);
1675 { MISCREG_TLBI_RVAE1, [](ThreadContext *tc,
RegVal value)
1678 TranslationRegime::EL20 : TranslationRegime::EL10;
1680 const TlbiAttr attrs = fnxsAttrs(tc) ?
1681 TlbiAttr::ExcludeXS : TlbiAttr::None;
1697 { MISCREG_TLBI_RVAE1NXS, [](ThreadContext *tc,
RegVal value)
1700 TranslationRegime::EL20 : TranslationRegime::EL10;
1712 TlbiAttr::ExcludeXS);
1716 { MISCREG_TLBI_RVAE1IS, [](ThreadContext *tc,
RegVal value)
1719 TranslationRegime::EL20 : TranslationRegime::EL10;
1721 const TlbiAttr attrs = fnxsAttrs(tc) ?
1722 TlbiAttr::ExcludeXS : TlbiAttr::None;
1733 { MISCREG_TLBI_RVAE1ISNXS, [](ThreadContext *tc,
RegVal value)
1736 TranslationRegime::EL20 : TranslationRegime::EL10;
1743 TlbiAttr::ExcludeXS);
1747 { MISCREG_TLBI_RVAE1OS, [](ThreadContext *tc,
RegVal value)
1750 TranslationRegime::EL20 : TranslationRegime::EL10;
1752 const TlbiAttr attrs = fnxsAttrs(tc) ?
1753 TlbiAttr::ExcludeXS : TlbiAttr::None;
1764 { MISCREG_TLBI_RVAE1OSNXS, [](ThreadContext *tc,
RegVal value)
1767 TranslationRegime::EL20 : TranslationRegime::EL10;
1774 TlbiAttr::ExcludeXS);
1778 { MISCREG_TLBI_RVAAE1, [](ThreadContext *tc,
RegVal value)
1781 TranslationRegime::EL20 : TranslationRegime::EL10;
1783 const TlbiAttr attrs = fnxsAttrs(tc) ?
1784 TlbiAttr::ExcludeXS : TlbiAttr::None;
1800 { MISCREG_TLBI_RVAAE1NXS, [](ThreadContext *tc,
RegVal value)
1803 TranslationRegime::EL20 : TranslationRegime::EL10;
1815 TlbiAttr::ExcludeXS);
1819 { MISCREG_TLBI_RVAAE1IS, [](ThreadContext *tc,
RegVal value)
1822 TranslationRegime::EL20 : TranslationRegime::EL10;
1824 const TlbiAttr attrs = fnxsAttrs(tc) ?
1825 TlbiAttr::ExcludeXS : TlbiAttr::None;
1836 { MISCREG_TLBI_RVAAE1ISNXS, [](ThreadContext *tc,
RegVal value)
1839 TranslationRegime::EL20 : TranslationRegime::EL10;
1846 TlbiAttr::ExcludeXS);
1851 { MISCREG_TLBI_RVAAE1OS, [](ThreadContext *tc,
RegVal value)
1854 TranslationRegime::EL20 : TranslationRegime::EL10;
1856 const TlbiAttr attrs = fnxsAttrs(tc) ?
1857 TlbiAttr::ExcludeXS : TlbiAttr::None;
1868 { MISCREG_TLBI_RVAAE1OSNXS, [](ThreadContext *tc,
RegVal value)
1871 TranslationRegime::EL20 : TranslationRegime::EL10;
1878 TlbiAttr::ExcludeXS);
1882 { MISCREG_TLBI_RVALE1, [](ThreadContext *tc,
RegVal value)
1885 TranslationRegime::EL20 : TranslationRegime::EL10;
1887 const TlbiAttr attrs = fnxsAttrs(tc) ?
1888 TlbiAttr::ExcludeXS : TlbiAttr::None;
1904 { MISCREG_TLBI_RVALE1NXS, [](ThreadContext *tc,
RegVal value)
1907 TranslationRegime::EL20 : TranslationRegime::EL10;
1919 TlbiAttr::ExcludeXS);
1923 { MISCREG_TLBI_RVALE1IS, [](ThreadContext *tc,
RegVal value)
1926 TranslationRegime::EL20 : TranslationRegime::EL10;
1928 const TlbiAttr attrs = fnxsAttrs(tc) ?
1929 TlbiAttr::ExcludeXS : TlbiAttr::None;
1940 { MISCREG_TLBI_RVALE1ISNXS, [](ThreadContext *tc,
RegVal value)
1943 TranslationRegime::EL20 : TranslationRegime::EL10;
1950 TlbiAttr::ExcludeXS);
1954 { MISCREG_TLBI_RVALE1OS, [](ThreadContext *tc,
RegVal value)
1957 TranslationRegime::EL20 : TranslationRegime::EL10;
1959 const TlbiAttr attrs = fnxsAttrs(tc) ?
1960 TlbiAttr::ExcludeXS : TlbiAttr::None;
1971 { MISCREG_TLBI_RVALE1OSNXS, [](ThreadContext *tc,
RegVal value)
1974 TranslationRegime::EL20 : TranslationRegime::EL10;
1981 TlbiAttr::ExcludeXS);
1985 { MISCREG_TLBI_RVAALE1, [](ThreadContext *tc,
RegVal value)
1988 TranslationRegime::EL20 : TranslationRegime::EL10;
1990 const TlbiAttr attrs = fnxsAttrs(tc) ?
1991 TlbiAttr::ExcludeXS : TlbiAttr::None;
2007 { MISCREG_TLBI_RVAALE1NXS, [](ThreadContext *tc,
RegVal value)
2010 TranslationRegime::EL20 : TranslationRegime::EL10;
2022 TlbiAttr::ExcludeXS);
2026 { MISCREG_TLBI_RVAALE1IS, [](ThreadContext *tc,
RegVal value)
2029 TranslationRegime::EL20 : TranslationRegime::EL10;
2031 const TlbiAttr attrs = fnxsAttrs(tc) ?
2032 TlbiAttr::ExcludeXS : TlbiAttr::None;
2043 { MISCREG_TLBI_RVAALE1ISNXS, [](ThreadContext *tc,
RegVal value)
2046 TranslationRegime::EL20 : TranslationRegime::EL10;
2053 TlbiAttr::ExcludeXS);
2057 { MISCREG_TLBI_RVAALE1OS, [](ThreadContext *tc,
RegVal value)
2060 TranslationRegime::EL20 : TranslationRegime::EL10;
2062 const TlbiAttr attrs = fnxsAttrs(tc) ?
2063 TlbiAttr::ExcludeXS : TlbiAttr::None;
2074 { MISCREG_TLBI_RVAALE1OSNXS, [](ThreadContext *tc,
RegVal value)
2077 TranslationRegime::EL20 : TranslationRegime::EL10;
2084 TlbiAttr::ExcludeXS);
2088 { MISCREG_TLBI_RIPAS2E1, [](ThreadContext *tc,
RegVal value)
2092 TranslationRegime::EL10,
2098 { MISCREG_TLBI_RIPAS2E1NXS, [](ThreadContext *tc,
RegVal value)
2100 tlbiRipaS2(tc, value,
2102 TranslationRegime::EL10,
2105 TlbiAttr::ExcludeXS);
2110 { MISCREG_TLBI_RIPAS2E1IS, [](ThreadContext *tc,
RegVal value)
2114 TranslationRegime::EL10,
2120 { MISCREG_TLBI_RIPAS2E1ISNXS, [](ThreadContext *tc,
RegVal value)
2122 tlbiRipaS2(tc, value,
2124 TranslationRegime::EL10,
2127 TlbiAttr::ExcludeXS);
2131 { MISCREG_TLBI_RIPAS2E1OS, [](ThreadContext *tc,
RegVal value)
2135 TranslationRegime::EL10,
2141 { MISCREG_TLBI_RIPAS2E1OSNXS, [](ThreadContext *tc,
RegVal value)
2143 tlbiRipaS2(tc, value,
2145 TranslationRegime::EL10,
2148 TlbiAttr::ExcludeXS);
2152 { MISCREG_TLBI_RIPAS2E1OS, [](ThreadContext *tc,
RegVal value)
2154 tlbiRipaS2(tc, value,
2156 TranslationRegime::EL10,
2162 { MISCREG_TLBI_RIPAS2E1OSNXS, [](ThreadContext *tc,
RegVal value)
2164 tlbiRipaS2(tc, value,
2166 TranslationRegime::EL10,
2169 TlbiAttr::ExcludeXS);
2173 { MISCREG_TLBI_RIPAS2LE1, [](ThreadContext *tc,
RegVal value)
2177 TranslationRegime::EL10,
2183 { MISCREG_TLBI_RIPAS2LE1NXS, [](ThreadContext *tc,
RegVal value)
2185 tlbiRipaS2(tc, value,
2187 TranslationRegime::EL10,
2190 TlbiAttr::ExcludeXS);
2194 { MISCREG_TLBI_RIPAS2LE1IS, [](ThreadContext *tc,
RegVal value)
2198 TranslationRegime::EL10,
2204 { MISCREG_TLBI_RIPAS2LE1ISNXS, [](ThreadContext *tc,
RegVal value)
2206 tlbiRipaS2(tc, value,
2208 TranslationRegime::EL10,
2211 TlbiAttr::ExcludeXS);
2215 { MISCREG_TLBI_RIPAS2LE1OS, [](ThreadContext *tc,
RegVal value)
2219 TranslationRegime::EL10,
2225 { MISCREG_TLBI_RIPAS2LE1OSNXS, [](ThreadContext *tc,
RegVal value)
2227 tlbiRipaS2(tc, value,
2229 TranslationRegime::EL10,
2232 TlbiAttr::ExcludeXS);
2236 { MISCREG_TLBI_RVAE2, [](ThreadContext *tc,
RegVal value)
2239 TranslationRegime::EL20 : TranslationRegime::EL2;
2249 { MISCREG_TLBI_RVAE2NXS, [](ThreadContext *tc,
RegVal value)
2252 TranslationRegime::EL20 : TranslationRegime::EL2;
2259 TlbiAttr::ExcludeXS);
2263 { MISCREG_TLBI_RVAE2IS, [](ThreadContext *tc,
RegVal value)
2266 TranslationRegime::EL20 : TranslationRegime::EL2;
2276 { MISCREG_TLBI_RVAE2ISNXS, [](ThreadContext *tc,
RegVal value)
2279 TranslationRegime::EL20 : TranslationRegime::EL2;
2286 TlbiAttr::ExcludeXS);
2290 { MISCREG_TLBI_RVAE2OS, [](ThreadContext *tc,
RegVal value)
2293 TranslationRegime::EL20 : TranslationRegime::EL2;
2303 { MISCREG_TLBI_RVAE2OSNXS, [](ThreadContext *tc,
RegVal value)
2306 TranslationRegime::EL20 : TranslationRegime::EL2;
2313 TlbiAttr::ExcludeXS);
2317 { MISCREG_TLBI_RVALE2, [](ThreadContext *tc,
RegVal value)
2320 TranslationRegime::EL20 : TranslationRegime::EL2;
2330 { MISCREG_TLBI_RVALE2NXS, [](ThreadContext *tc,
RegVal value)
2333 TranslationRegime::EL20 : TranslationRegime::EL2;
2340 TlbiAttr::ExcludeXS);
2344 { MISCREG_TLBI_RVALE2IS, [](ThreadContext *tc,
RegVal value)
2347 TranslationRegime::EL20 : TranslationRegime::EL2;
2357 { MISCREG_TLBI_RVALE2ISNXS, [](ThreadContext *tc,
RegVal value)
2360 TranslationRegime::EL20 : TranslationRegime::EL2;
2367 TlbiAttr::ExcludeXS);
2371 { MISCREG_TLBI_RVALE2OS, [](ThreadContext *tc,
RegVal value)
2374 TranslationRegime::EL20 : TranslationRegime::EL2;
2384 { MISCREG_TLBI_RVALE2OSNXS, [](ThreadContext *tc,
RegVal value)
2387 TranslationRegime::EL20 : TranslationRegime::EL2;
2394 TlbiAttr::ExcludeXS);
2398 { MISCREG_TLBI_RVAE3, [](ThreadContext *tc,
RegVal value)
2402 TranslationRegime::EL3,
2408 { MISCREG_TLBI_RVAE3NXS, [](ThreadContext *tc,
RegVal value)
2412 TranslationRegime::EL3,
2415 TlbiAttr::ExcludeXS);
2419 { MISCREG_TLBI_RVAE3IS, [](ThreadContext *tc,
RegVal value)
2423 TranslationRegime::EL3,
2429 { MISCREG_TLBI_RVAE3ISNXS, [](ThreadContext *tc,
RegVal value)
2433 TranslationRegime::EL3,
2436 TlbiAttr::ExcludeXS);
2440 { MISCREG_TLBI_RVAE3OS, [](ThreadContext *tc,
RegVal value)
2444 TranslationRegime::EL3,
2450 { MISCREG_TLBI_RVAE3OSNXS, [](ThreadContext *tc,
RegVal value)
2454 TranslationRegime::EL3,
2457 TlbiAttr::ExcludeXS);
2461 { MISCREG_TLBI_RVALE3, [](ThreadContext *tc,
RegVal value)
2465 TranslationRegime::EL3,
2471 { MISCREG_TLBI_RVALE3NXS, [](ThreadContext *tc,
RegVal value)
2475 TranslationRegime::EL3,
2478 TlbiAttr::ExcludeXS);
2482 { MISCREG_TLBI_RVALE3IS, [](ThreadContext *tc,
RegVal value)
2486 TranslationRegime::EL3,
2492 { MISCREG_TLBI_RVALE3ISNXS, [](ThreadContext *tc,
RegVal value)
2496 TranslationRegime::EL3,
2499 TlbiAttr::ExcludeXS);
2503 { MISCREG_TLBI_RVALE3OS, [](ThreadContext *tc,
RegVal value)
2507 TranslationRegime::EL3,
2513 { MISCREG_TLBI_RVALE3OSNXS, [](ThreadContext *tc,
RegVal value)
2517 TranslationRegime::EL3,
2520 TlbiAttr::ExcludeXS);
2531 it->second(tc, value);
2533 panic(
"Invalid TLBI\n");
2573 return std::make_pair(
NoFault, 0);
2576 return std::make_pair(
NoFault, 0);
2590 warn_once(
"Doing AT (address translation) in functional mode! Fix Me!\n");
2592 auto req = std::make_shared<Request>(
2597 req, tc,
mode, tran_type);
2600 bool raise_fault =
false;
2602 Addr paddr = req->getPaddr();
2605 attr &= ~ uint64_t(0x800);
2606 uint64_t attr1 =
attr >> 56;
2607 if (!(attr1 >> 4) || attr1 == 0x44) {
2609 attr &= ~ uint64_t(0x80);
2611 par = (paddr &
mask(47, 12)) |
attr;
2612 DPRINTF(MiscRegs,
"AT: Translated addr %#x: PAR_EL1: %#x\n",
2618 FSR fsr = arm_fault->
getFsr(tc);
2624 par.fst = fsr.status;
2625 par.ptw = (arm_fault->
iss() >> 7) & 0x1;
2626 par.s = arm_fault->
isStage2() ? 1 : 0;
2634 DPRINTF(MiscRegs,
"AT: Translated addr %#x fault fsr %#x: PAR: %#x\n",
2639 if (fault !=
NoFault && !raise_fault) {
2643 return std::make_pair(fault, par);
virtual FSR getFsr(ThreadContext *tc) const
virtual uint32_t iss() const =0
virtual void annotate(AnnotationIDs id, uint64_t val)
virtual bool isExternalAbort() const
virtual void update(ThreadContext *tc)
virtual bool isStage2() const
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)
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 ...
Implementaton of AArch64 TLBI ALLE(1,2,3)(IS) instructions.
TLB Invalidate by ASID match.
TLB Invalidate by Intermediate Physical Address.
TLB Invalidate by VA, All ASID.
void broadcast(ThreadContext *tc)
Broadcast the TLB Invalidate operation to all TLBs in the Arm system.
TLB Range Invalidate by VA, All ASIDs.
TLB Range Invalidate by VA, All ASIDs.
TLB Range Invalidate by VA.
Implementaton of AArch64 TLBI VMALLE1(IS)/VMALLS112E1(IS) instructions.
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
std::pair< Fault, uint64_t > performAt(ExecContext *xc, ArmISA::MiscRegIndex idx, RegVal val) const
std::pair< Fault, uint64_t > addressTranslation64(ThreadContext *tc, ArmISA::MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val) const
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.
RegVal miscRegImm() const
Returns the "register view" of the immediate field.
ArmISA::MiscRegIndex dest
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
const ArmISA::MiscRegNum64 miscReg
const std::string fullMnemonic
uint32_t iss() const override
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg, RegIndex int_index) const
Fault generateTrap(ArmISA::ExceptionLevel el) const
virtual uint32_t iss() const
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
ArmISA::MiscRegIndex dest
uint32_t iss() const override
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
uint32_t iss() const override
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
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)
static void tlbiIpaS2(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
static bool fnxsAttrs(ThreadContext *tc)
static void tlbiVaa(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
static void tlbiAsid(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, TlbiAttr attrs=TlbiAttr::None)
static void tlbiRipaS2(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
static std::unordered_map< ArmISA::MiscRegIndex, TlbiFunc > tlbiOps
void performTlbi(ExecContext *xc, ArmISA::MiscRegIndex idx, RegVal value) const
static void tlbiRvaa(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
static void tlbiRva(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool last_level, TlbiAttr attrs=TlbiAttr::None)
static void tlbiAll(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, TlbiAttr attrs=TlbiAttr::None)
static void tlbiVmall(ThreadContext *tc, RegVal value, ArmISA::SecurityState ss, ArmISA::TranslationRegime regime, bool shareable, bool stage2=false, TlbiAttr attrs=TlbiAttr::None)
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define panic(...)
This implements a cprintf based panic() function.
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 ...
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Fault checkFaultAccessAArch64SysReg(MiscRegIndex reg, CPSR cpsr, ThreadContext *tc, const MiscRegOp64 &inst)
SecurityState securityStateAtEL(ThreadContext *tc, ExceptionLevel el)
bool EL2Enabled(ThreadContext *tc)
ExceptionLevel translationEl(TranslationRegime regime)
SecurityState
Security State.
bool isHcrxEL2Enabled(ThreadContext *tc)
std::optional< MiscRegNum64 > encodeAArch64SysReg(MiscRegIndex misc_reg)
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< FaultBase > Fault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::string csprintf(const char *format, const Args &...args)
constexpr decltype(nullptr) NoFault
void ccprintf(cp::Print &print)
The file contains the definition of a set of TLB Invalidate Instructions.