48#include "params/ArmISA.hh"
60std::unordered_map<MiscRegNum32, MiscRegIndex> miscRegNum32ToIdx{
524 auto it = miscRegNum32ToIdx.find(cop_reg);
525 if (it != miscRegNum32ToIdx.end()) {
528 warn(
"CP14 unimplemented crn[%d], opc1[%d], crm[%d], opc2[%d]",
529 crn, opc1, crm,
opc2);
538 auto it = miscRegNum32ToIdx.find(cop_reg);
539 if (it != miscRegNum32ToIdx.end()) {
543 (crn == 9 && (crm <= 2 || crm >= 5)) ||
544 (crn == 10 && opc1 == 0 && crm <= 1) ||
545 (crn == 11 && opc1 <= 7 && (crm <= 8 || crm ==15))) {
557 auto it = miscRegNum32ToIdx.find(cop_reg);
558 if (it != miscRegNum32ToIdx.end()) {
565std::tuple<bool, bool>
568 bool secure = !scr.ns;
569 bool can_read =
false;
570 bool undefined =
false;
609 return std::make_tuple(can_read, undefined);
612std::tuple<bool, bool>
615 bool secure = !scr.ns;
616 bool can_write =
false;
617 bool undefined =
false;
656 return std::make_tuple(can_write, undefined);
665 if (trap_cond && (!
EL2Enabled(tc) || !hcr.tge))
681 int reg_as_int =
static_cast<int>(
reg);
694 return isa->snsBankedIndex64(
reg, scr.ns);
741std::unordered_map<MiscRegIndex, MiscRegNum64> idxToMiscRegNum;
745std::unordered_map<MiscRegNum64, MiscRegIndex> miscRegNumToIdx{
1310fgtRegister(ThreadContext *tc)
1312 if constexpr (read) {
1321fgtDebugRegister(ThreadContext *tc)
1323 if constexpr (read) {
1336template<
bool read, auto r_bitfield>
1338faultFgtEL0(
const MiscRegLUTEntry &entry,
1339 ThreadContext *tc,
const MiscRegOp64 &inst)
1342 const bool in_host =
EL2Enabled(tc) && hcr.e2h && hcr.tge;
1344 fgtRegister<read>(tc).*r_bitfield) {
1345 return inst.generateTrap(
EL2);
1357template<
bool read, auto r_bitfield>
1359faultFgtEL1(
const MiscRegLUTEntry &entry,
1360 ThreadContext *tc,
const MiscRegOp64 &inst)
1362 if (
fgtEnabled(tc) && fgtRegister<read>(tc).*r_bitfield) {
1363 return inst.generateTrap(
EL2);
1374template<auto r_bitfield>
1376faultFgtInstEL1(
const MiscRegLUTEntry &entry,
1377 ThreadContext *tc,
const MiscRegOp64 &inst)
1381 return inst.generateTrap(
EL2);
1393template<
bool read, auto r_bitfield>
1395faultFgtDebugEL1(
const MiscRegLUTEntry &entry,
1396 ThreadContext *tc,
const MiscRegOp64 &inst)
1398 if (
fgtEnabled(tc) && fgtDebugRegister<read>(tc).*r_bitfield) {
1399 return inst.generateTrap(
EL2);
1410template <auto g_bitfield>
1412faultHcrEL1(
const MiscRegLUTEntry &entry,
1413 ThreadContext *tc,
const MiscRegOp64 &inst)
1417 return inst.generateTrap(
EL2);
1430template<
bool read, auto g_bitfield, auto r_bitfield>
1432faultHcrFgtEL0(
const MiscRegLUTEntry &entry,
1433 ThreadContext *tc,
const MiscRegOp64 &inst)
1436 const bool in_host =
EL2Enabled(tc) && hcr.e2h && hcr.tge;
1438 if (
EL2Enabled(tc) && !in_host && hcr.*g_bitfield) {
1439 return inst.generateTrap(
EL2);
1440 }
else if (
auto fault = faultFgtEL0<read, r_bitfield>(entry, tc, inst);
1455template<
bool read, auto g_bitfield, auto r_bitfield>
1457faultHcrFgtEL1(
const MiscRegLUTEntry &entry,
1458 ThreadContext *tc,
const MiscRegOp64 &inst)
1463 return inst.generateTrap(
EL2);
1464 }
else if (
auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
1478template<auto g_bitfield, auto r_bitfield>
1480faultHcrFgtInstEL1(
const MiscRegLUTEntry &entry,
1481 ThreadContext *tc,
const MiscRegOp64 &inst)
1486 return inst.generateTrap(
EL2);
1487 }
else if (
auto fault = faultFgtInstEL1<r_bitfield>(entry, tc, inst);
1496faultSpEL0(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1497 const MiscRegOp64 &inst)
1500 return inst.undefined();
1506faultDaif(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1507 const MiscRegOp64 &inst)
1512 if ((el2_enabled && hcr.e2h && hcr.tge) || sctlr.uma == 0) {
1513 if (el2_enabled && hcr.tge) {
1514 return inst.generateTrap(
EL2);
1516 return inst.generateTrap(
EL1);
1524faultDczvaEL0(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1525 const MiscRegOp64 &inst)
1535 const bool in_host = hcr.e2h && hcr.tge;
1536 if (!(el2_enabled && in_host) && !sctlr.dze) {
1537 if (el2_enabled && hcr.tge) {
1538 return inst.generateTrap(
EL2);
1540 return inst.generateTrap(
EL1);
1542 }
else if (el2_enabled && !in_host && hcr.tdz) {
1543 return inst.generateTrap(
EL2);
1544 }
else if (el2_enabled && in_host && !sctlr2.dze) {
1545 return inst.generateTrap(
EL2);
1552faultCvacEL0(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1553 const MiscRegOp64 &inst)
1560 const bool in_host = hcr.e2h && hcr.tge;
1561 if (!(el2_enabled && in_host) && !sctlr.uci) {
1562 if (el2_enabled && hcr.tge) {
1563 return inst.generateTrap(
EL2);
1565 return inst.generateTrap(
EL1);
1567 }
else if (el2_enabled && !in_host && hcr.tpc) {
1568 return inst.generateTrap(
EL2);
1569 }
else if (el2_enabled && in_host && !sctlr2.uci) {
1570 return inst.generateTrap(
EL2);
1577faultFpcrEL0(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1578 const MiscRegOp64 &inst)
1586 const bool in_host = hcr.e2h && hcr.tge;
1587 if (!(el2_enabled && in_host) && cpacr.fpen != 0b11) {
1588 if (el2_enabled && hcr.tge) {
1591 return inst.generateTrap(
EL1,
1594 }
else if (el2_enabled && in_host && cptr_el2.fpen != 0b11) {
1595 return inst.generateTrap(
EL2,
1597 }
else if (el2_enabled && hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1598 return inst.generateTrap(
EL2,
1600 }
else if (el2_enabled && !hcr.e2h && cptr_el2.tfp) {
1601 return inst.generateTrap(
EL2,
1604 return inst.generateTrap(
EL3,
1612faultFpcrEL1(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1613 const MiscRegOp64 &inst)
1621 if ((cpacr.fpen & 0b1) == 0b0) {
1622 return inst.generateTrap(
EL1,
1624 }
else if (el2_enabled && !hcr.e2h && cptr_el2.tfp) {
1625 return inst.generateTrap(
EL2,
1627 }
else if (el2_enabled && hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1628 return inst.generateTrap(
EL2,
1631 return inst.generateTrap(
EL3,
1639faultFpcrEL2(
const MiscRegLUTEntry &entry, ThreadContext *tc,
1640 const MiscRegOp64 &inst)
1646 if (!hcr.e2h && cptr_el2.tfp) {
1647 return inst.generateTrap(
EL2,
1649 }
else if (hcr.e2h && ((cptr_el2.fpen & 0b1) == 0b0)) {
1650 return inst.generateTrap(
EL2,
1653 return inst.generateTrap(
EL3,
1661faultFpcrEL3(
const MiscRegLUTEntry &entry,
1662 ThreadContext *tc,
const MiscRegOp64 &inst)
1666 return inst.generateTrap(
EL3,
1674faultPouEL0(
const MiscRegLUTEntry &entry,
1675 ThreadContext *tc,
const MiscRegOp64 &inst)
1682 const bool in_host = hcr.e2h && hcr.tge;
1683 if (!(el2_enabled && in_host) && !sctlr.uci) {
1684 if (el2_enabled && hcr.tge) {
1685 return inst.generateTrap(
EL2);
1687 return inst.generateTrap(
EL1);
1689 }
else if (el2_enabled && !in_host && hcr.tpu) {
1690 return inst.generateTrap(
EL2);
1691 }
else if (el2_enabled && !in_host &&
1692 HaveExt(tc, ArmExtension::FEAT_EVT) && hcr.tocu) {
1693 return inst.generateTrap(
EL2);
1694 }
else if (el2_enabled && in_host && !sctlr2.uci) {
1695 return inst.generateTrap(
EL2);
1701template <auto bitfield>
1703faultPouEL1(
const MiscRegLUTEntry &entry,
1704 ThreadContext *tc,
const MiscRegOp64 &inst)
1708 if (el2_enabled && hcr.tpu) {
1709 return inst.generateTrap(
EL2);
1710 }
else if (el2_enabled &&
HaveExt(tc, ArmExtension::FEAT_EVT) &&
1712 return inst.generateTrap(
EL2);
1713 }
else if (
auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
1721template <auto bitfield>
1723faultPouIsEL1(
const MiscRegLUTEntry &entry,
1724 ThreadContext *tc,
const MiscRegOp64 &inst)
1728 if (el2_enabled && hcr.tpu) {
1729 return inst.generateTrap(
EL2);
1730 }
else if (el2_enabled &&
HaveExt(tc, ArmExtension::FEAT_EVT) &&
1732 return inst.generateTrap(
EL2);
1733 }
else if (
auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
1742faultCtrEL0(
const MiscRegLUTEntry &entry,
1743 ThreadContext *tc,
const MiscRegOp64 &inst)
1750 const bool in_host = hcr.e2h && hcr.tge;
1751 if (!(el2_enabled && in_host) && !sctlr.uct) {
1752 if (el2_enabled && hcr.tge) {
1753 return inst.generateTrap(
EL2);
1755 return inst.generateTrap(
EL1);
1757 }
else if (
auto fault = faultHcrFgtEL0<
1758 true, &HCR::tid2, &HFGTR::ctrEL0>(entry, tc, inst);
1761 }
else if (el2_enabled && in_host && !sctlr2.uct) {
1762 return inst.generateTrap(
EL2);
1769faultMdccsrEL0(
const MiscRegLUTEntry &entry,
1770 ThreadContext *tc,
const MiscRegOp64 &inst)
1779 if (el2_enabled && hcr.tge) {
1780 return inst.generateTrap(
EL2);
1782 return inst.generateTrap(
EL1);
1784 }
else if (el2_enabled && mdcr_el2.tdcc) {
1785 return inst.generateTrap(
EL2);
1786 }
else if (el2_enabled && (hcr.tge || (mdcr_el2.tde || mdcr_el2.tda))) {
1787 return inst.generateTrap(
EL2);
1789 return inst.generateTrap(
EL3);
1796faultMdccsrEL1(
const MiscRegLUTEntry &entry,
1797 ThreadContext *tc,
const MiscRegOp64 &inst)
1803 if (el2_enabled && mdcr_el2.tdcc) {
1804 return inst.generateTrap(
EL2);
1805 }
else if (el2_enabled && (mdcr_el2.tde || mdcr_el2.tda)) {
1806 return inst.generateTrap(
EL2);
1808 return inst.generateTrap(
EL3);
1815faultMdccsrEL2(
const MiscRegLUTEntry &entry,
1816 ThreadContext *tc,
const MiscRegOp64 &inst)
1820 return inst.generateTrap(
EL3);
1827faultDebugEL1(
const MiscRegLUTEntry &entry,
1828 ThreadContext *tc,
const MiscRegOp64 &inst)
1834 if (el2_enabled && (mdcr_el2.tde || mdcr_el2.tda)) {
1835 return inst.generateTrap(
EL2);
1837 return inst.generateTrap(
EL3);
1844faultDebugEL2(
const MiscRegLUTEntry &entry,
1845 ThreadContext *tc,
const MiscRegOp64 &inst)
1849 return inst.generateTrap(
EL3);
1855template<
bool read, auto r_bitfield>
1857faultDebugWithFgtEL1(
const MiscRegLUTEntry &entry,
1858 ThreadContext *tc,
const MiscRegOp64 &inst)
1860 if (
auto fault = faultFgtDebugEL1<read, r_bitfield>(entry, tc, inst);
1864 return faultDebugEL1(entry, tc, inst);
1868template<
bool read, auto r_bitfield>
1870faultDebugOsEL1(
const MiscRegLUTEntry &entry,
1871 ThreadContext *tc,
const MiscRegOp64 &inst)
1876 if (
auto fault = faultFgtDebugEL1<read, r_bitfield>(entry, tc, inst);
1879 }
else if (
EL2Enabled(tc) && (mdcr_el2.tde || mdcr_el2.tdosa)) {
1880 return inst.generateTrap(
EL2);
1882 return inst.generateTrap(
EL3);
1889faultDebugOsEL2(
const MiscRegLUTEntry &entry,
1890 ThreadContext *tc,
const MiscRegOp64 &inst)
1894 return inst.generateTrap(
EL3);
1901faultHcrxEL2(
const MiscRegLUTEntry &entry,
1902 ThreadContext *tc,
const MiscRegOp64 &inst)
1906 return inst.generateTrap(
EL3);
1913faultZcrEL1(
const MiscRegLUTEntry &entry,
1914 ThreadContext *tc,
const MiscRegOp64 &inst)
1922 if (!(cpacr_el1.zen & 0x1)) {
1924 }
else if (el2_enabled && !hcr.e2h && cptr_el2.tz) {
1926 }
else if (el2_enabled && hcr.e2h && !(cptr_el2.zen & 0x1)) {
1936faultZcrEL2(
const MiscRegLUTEntry &entry,
1937 ThreadContext *tc,
const MiscRegOp64 &inst)
1943 if (!hcr.e2h && cptr_el2.tz) {
1945 }
else if (hcr.e2h && !(cptr_el2.zen & 0x1)) {
1955faultZcrEL3(
const MiscRegLUTEntry &entry,
1956 ThreadContext *tc,
const MiscRegOp64 &inst)
1967faultGicv3(
const MiscRegLUTEntry &entry,
1968 ThreadContext *tc,
const MiscRegOp64 &inst)
1970 auto gic =
static_cast<ArmSystem*
>(tc->getSystemPtr())->getGIC();
1972 return inst.undefined();
1979faultIccSgiEL1(
const MiscRegLUTEntry &entry,
1980 ThreadContext *tc,
const MiscRegOp64 &inst)
1982 if (
auto fault = faultGicv3(entry, tc, inst); fault !=
NoFault) {
1986 const Gicv3CPUInterface::ICH_HCR_EL2 ich_hcr =
1990 if (
EL2Enabled(tc) && (hcr.fmo || hcr.imo || ich_hcr.TC)) {
1991 return inst.generateTrap(
EL2);
1993 return inst.generateTrap(
EL3);
2000faultIccSgiEL2(
const MiscRegLUTEntry &entry,
2001 ThreadContext *tc,
const MiscRegOp64 &inst)
2003 if (
auto fault = faultGicv3(entry, tc, inst); fault !=
NoFault) {
2009 return inst.generateTrap(
EL3);
2015template<
bool read, auto g_bitfield>
2017faultSctlr2EL1(
const MiscRegLUTEntry &entry,
2018 ThreadContext *tc,
const MiscRegOp64 &inst)
2020 if (
HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2024 auto fault = faultHcrFgtEL1<read, g_bitfield, &HFGTR::sctlrEL1>
2036 return inst.generateTrap(
EL2);
2038 return inst.generateTrap(
EL3);
2043 return inst.undefined();
2048faultSctlr2EL2(
const MiscRegLUTEntry &entry,
2049 ThreadContext *tc,
const MiscRegOp64 &inst)
2051 if (
HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2054 return inst.generateTrap(
EL3);
2059 return inst.undefined();
2064faultSctlr2VheEL2(
const MiscRegLUTEntry &entry,
2065 ThreadContext *tc,
const MiscRegOp64 &inst)
2067 if (
HaveExt(tc, ArmExtension::FEAT_SCTLR2)) {
2072 return inst.generateTrap(
EL3);
2077 return inst.undefined();
2080 return inst.undefined();
2084template<
bool read, auto g_bitfield>
2086faultTcr2EL1(
const MiscRegLUTEntry &entry,
2087 ThreadContext *tc,
const MiscRegOp64 &inst)
2089 if (
HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2093 auto fault = faultHcrFgtEL1<read, g_bitfield, &HFGTR::sctlrEL1>
2103 return inst.generateTrap(
EL2);
2105 return inst.generateTrap(
EL3);
2110 return inst.undefined();
2115faultTcr2EL2(
const MiscRegLUTEntry &entry,
2116 ThreadContext *tc,
const MiscRegOp64 &inst)
2118 if (
HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2121 return inst.generateTrap(
EL3);
2126 return inst.undefined();
2131faultTcr2VheEL2(
const MiscRegLUTEntry &entry,
2132 ThreadContext *tc,
const MiscRegOp64 &inst)
2134 if (
HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2139 return inst.generateTrap(
EL3);
2144 return inst.undefined();
2147 return inst.undefined();
2152faultTcr2VheEL3(
const MiscRegLUTEntry &entry,
2153 ThreadContext *tc,
const MiscRegOp64 &inst)
2155 if (
HaveExt(tc, ArmExtension::FEAT_TCR2)) {
2157 const bool el2_host =
EL2Enabled(tc) && hcr.e2h;
2161 return inst.undefined();
2164 return inst.undefined();
2168template<
bool read, auto r_bitfield>
2170faultCpacrEL1(
const MiscRegLUTEntry &entry,
2171 ThreadContext *tc,
const MiscRegOp64 &inst)
2177 if (el2_enabled && cptr_el2.tcpac) {
2178 return inst.generateTrap(
EL2);
2179 }
else if (
auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2183 return inst.generateTrap(
EL3);
2190faultCpacrEL2(
const MiscRegLUTEntry &entry,
2191 ThreadContext *tc,
const MiscRegOp64 &inst)
2195 return inst.generateTrap(
EL3);
2202faultCpacrVheEL2(
const MiscRegLUTEntry &entry,
2203 ThreadContext *tc,
const MiscRegOp64 &inst)
2207 return faultCpacrEL2(entry, tc, inst);
2209 return inst.undefined();
2213template <auto bitfield>
2215faultTlbiOsEL1(
const MiscRegLUTEntry &entry,
2216 ThreadContext *tc,
const MiscRegOp64 &inst)
2220 if (el2_enabled && hcr.ttlb) {
2221 return inst.generateTrap(
EL2);
2222 }
else if (el2_enabled &&
HaveExt(tc, ArmExtension::FEAT_EVT) &&
2224 return inst.generateTrap(
EL2);
2225 }
else if (
auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
2233template <auto bitfield>
2235faultTlbiIsEL1(
const MiscRegLUTEntry &entry,
2236 ThreadContext *tc,
const MiscRegOp64 &inst)
2240 if (el2_enabled && hcr.ttlb) {
2241 return inst.generateTrap(
EL2);
2242 }
else if (el2_enabled &&
HaveExt(tc, ArmExtension::FEAT_EVT) &&
2244 return inst.generateTrap(
EL2);
2245 }
else if (
auto fault = faultFgtInstEL1<bitfield>(entry, tc, inst);
2253template <
bool read, auto r_bitfield>
2255faultCacheEL1(
const MiscRegLUTEntry &entry,
2256 ThreadContext *tc,
const MiscRegOp64 &inst)
2260 if (el2_enabled && hcr.tid2) {
2261 return inst.generateTrap(
EL2);
2262 }
else if (el2_enabled &&
HaveExt(tc, ArmExtension::FEAT_EVT) &&
2264 return inst.generateTrap(
EL2);
2265 }
else if (
auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2273template <
bool read, auto r_bitfield>
2275faultPauthEL1(
const MiscRegLUTEntry &entry,
2276 ThreadContext *tc,
const MiscRegOp64 &inst)
2282 if (el2_enabled && !hcr.apk) {
2283 return inst.generateTrap(
EL2);
2284 }
else if (
auto fault = faultFgtEL1<read, r_bitfield>(entry, tc, inst);
2288 return inst.generateTrap(
EL3);
2295faultPauthEL2(
const MiscRegLUTEntry &entry,
2296 ThreadContext *tc,
const MiscRegOp64 &inst)
2300 return inst.generateTrap(
EL3);
2307faultGenericTimerEL0(
const MiscRegLUTEntry &entry,
2308 ThreadContext *tc,
const MiscRegOp64 &inst)
2312 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2315 if (!(in_host) && !cntkctl_el1.el0pcten && !cntkctl_el1.el0vcten) {
2316 if (el2_enabled && hcr.tge)
2317 return inst.generateTrap(
EL2);
2319 return inst.generateTrap(
EL1);
2320 }
else if (in_host && !cnthctl_el2.el0pcten && !cnthctl_el2.el0vcten) {
2321 return inst.generateTrap(
EL2);
2328faultCntpctEL0(
const MiscRegLUTEntry &entry,
2329 ThreadContext *tc,
const MiscRegOp64 &inst)
2333 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2336 if (!(in_host) && !cntkctl_el1.el0pcten) {
2337 if (el2_enabled && hcr.tge)
2338 return inst.generateTrap(
EL2);
2340 return inst.generateTrap(
EL1);
2341 }
else if (el2_enabled && !hcr.e2h &&
2342 !
static_cast<CNTHCTL
>(cnthctl_el2).el1pcten) {
2343 return inst.generateTrap(
EL2);
2344 }
else if (el2_enabled && hcr.e2h && !hcr.tge &&
2345 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).el1pcten) {
2346 return inst.generateTrap(
EL2);
2347 }
else if (in_host &&
2348 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).
el0pcten) {
2349 return inst.generateTrap(
EL2);
2356faultCntpctEL1(
const MiscRegLUTEntry &entry,
2357 ThreadContext *tc,
const MiscRegOp64 &inst)
2362 if (el2_enabled && hcr.e2h &&
2363 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).el1pcten) {
2364 return inst.generateTrap(
EL2);
2365 }
else if (el2_enabled && !hcr.e2h &&
2366 !
static_cast<CNTHCTL
>(cnthctl_el2).el1pcten) {
2367 return inst.generateTrap(
EL2);
2374faultCntvctEL0(
const MiscRegLUTEntry &entry,
2375 ThreadContext *tc,
const MiscRegOp64 &inst)
2379 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2382 if (!(in_host) && !cntkctl_el1.el0vcten) {
2383 if (el2_enabled && hcr.tge)
2384 return inst.generateTrap(
EL2);
2386 return inst.generateTrap(
EL1);
2387 }
else if (in_host && !cnthctl_el2.el0vcten) {
2388 return inst.generateTrap(
EL2);
2389 }
else if (el2_enabled && !(hcr.e2h && hcr.tge) && cnthctl_el2.el1tvct) {
2390 return inst.generateTrap(
EL2);
2397faultCntvctEL1(
const MiscRegLUTEntry &entry,
2398 ThreadContext *tc,
const MiscRegOp64 &inst)
2402 return inst.generateTrap(
EL2);
2410faultCntpCtlEL0(
const MiscRegLUTEntry &entry,
2411 ThreadContext *tc,
const MiscRegOp64 &inst)
2415 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2418 if (!(in_host) && !cntkctl_el1.el0pten) {
2419 if (el2_enabled && hcr.tge)
2420 return inst.generateTrap(
EL2);
2422 return inst.generateTrap(
EL1);
2423 }
else if (el2_enabled && !hcr.e2h &&
2424 !
static_cast<CNTHCTL
>(cnthctl_el2).el1pcen) {
2425 return inst.generateTrap(
EL2);
2426 }
else if (el2_enabled && hcr.e2h && !hcr.tge &&
2427 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).el1pten) {
2428 return inst.generateTrap(
EL2);
2429 }
else if (in_host &&
2430 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).
el0pten) {
2431 return inst.generateTrap(
EL2);
2438faultCntpCtlEL1(
const MiscRegLUTEntry &entry,
2439 ThreadContext *tc,
const MiscRegOp64 &inst)
2444 if (el2_enabled && !hcr.e2h &&
2445 !
static_cast<CNTHCTL
>(cnthctl_el2).el1pcen) {
2446 return inst.generateTrap(
EL2);
2447 }
else if (el2_enabled && hcr.e2h &&
2448 !
static_cast<CNTHCTL_E2H
>(cnthctl_el2).el1pten) {
2449 return inst.generateTrap(
EL2);
2457faultCntvCtlEL0(
const MiscRegLUTEntry &entry,
2458 ThreadContext *tc,
const MiscRegOp64 &inst)
2462 const bool in_host = el2_enabled && hcr.e2h && hcr.tge;
2465 if (!(in_host) && !cntkctl_el1.el0vten) {
2466 if (el2_enabled && hcr.tge)
2467 return inst.generateTrap(
EL2);
2469 return inst.generateTrap(
EL1);
2470 }
else if (in_host && !cnthctl_el2.el0vten) {
2471 return inst.generateTrap(
EL2);
2472 }
else if (el2_enabled && !(hcr.e2h && hcr.tge) && cnthctl_el2.el1tvt) {
2473 return inst.generateTrap(
EL2);
2480faultCntvCtlEL1(
const MiscRegLUTEntry &entry,
2481 ThreadContext *tc,
const MiscRegOp64 &inst)
2485 return inst.generateTrap(
EL2);
2492faultCntpsCtlEL1(
const MiscRegLUTEntry &entry,
2493 ThreadContext *tc,
const MiscRegOp64 &inst)
2498 return inst.undefined();
2500 return inst.generateTrap(
EL3);
2504 return inst.undefined();
2509faultUnimplemented(
const MiscRegLUTEntry &entry,
2510 ThreadContext *tc,
const MiscRegOp64 &inst)
2515 return inst.undefined();
2520faultImpdefUnimplEL1(
const MiscRegLUTEntry &entry,
2521 ThreadContext *tc,
const MiscRegOp64 &inst)
2525 return inst.generateTrap(
EL2);
2527 return faultUnimplemented(entry, tc, inst);
2532faultEsm(
const MiscRegLUTEntry &entry,
2533 ThreadContext *tc,
const MiscRegOp64 &inst)
2544faultTsmSmen(
const MiscRegLUTEntry &entry,
2545 ThreadContext *tc,
const MiscRegOp64 &inst)
2550 if (el2_enabled && !hcr_el2.e2h && cptr_el2.tsm) {
2552 }
else if (el2_enabled && hcr_el2.e2h && !(cptr_el2.smen & 0b1)) {
2555 return faultEsm(entry, tc, inst);
2560faultSmenEL1(
const MiscRegLUTEntry &entry,
2561 ThreadContext *tc,
const MiscRegOp64 &inst)
2564 if (!(cpacr.smen & 0b1)) {
2567 return faultTsmSmen(entry, tc, inst);
2572faultSmenEL0(
const MiscRegLUTEntry &entry,
2573 ThreadContext *tc,
const MiscRegOp64 &inst)
2577 const bool in_host = hcr.e2h && hcr.tge;
2581 if (!(el2_enabled && in_host) && cpacr.smen != 0b11) {
2582 if (el2_enabled && hcr.tge)
2586 }
else if (el2_enabled && in_host && cptr_el2.smen != 0b11) {
2589 return faultTsmSmen(entry, tc, inst);
2594faultRng(
const MiscRegLUTEntry &entry,
2595 ThreadContext *tc,
const MiscRegOp64 &inst)
2598 if (
HaveExt(tc, ArmExtension::FEAT_RNG_TRAP) && scr.trndr) {
2599 return inst.generateTrap(
EL3);
2600 }
else if (!
HaveExt(tc, ArmExtension::FEAT_RNG)) {
2601 return inst.undefined();
2608faultFgtCtrlRegs(
const MiscRegLUTEntry &entry,
2609 ThreadContext *tc,
const MiscRegOp64 &inst)
2611 if (
HaveExt(tc, ArmExtension::FEAT_FGT)) {
2614 return inst.generateTrap(
EL3);
2619 return inst.undefined();
2624faultIdst(
const MiscRegLUTEntry &entry,
2625 ThreadContext *tc,
const MiscRegOp64 &inst)
2627 if (
HaveExt(tc, ArmExtension::FEAT_IDST)) {
2630 return inst.generateTrap(
EL2);
2632 return inst.generateTrap(
EL1);
2635 return inst.undefined();
2640faultMpamIdrEL1(
const MiscRegLUTEntry &entry,
2641 ThreadContext *tc,
const MiscRegOp64 &inst)
2643 if (
HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2649 return inst.generateTrap(
EL3);
2650 }
else if (
EL2Enabled(tc) && mpamidr.hasHcr && mpamhcr.trapMpamIdrEL1) {
2651 return inst.generateTrap(
EL2);
2652 }
else if (
EL2Enabled(tc) && mpamidr.hasTidr && mpam2.el2.tidr) {
2653 return inst.generateTrap(
EL2);
2658 return inst.undefined();
2663faultMpam0EL1(
const MiscRegLUTEntry &entry,
2664 ThreadContext *tc,
const MiscRegOp64 &inst)
2666 if (
HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2670 return inst.generateTrap(
EL3);
2671 }
else if (
EL2Enabled(tc) && mpam2.el2.trapMpam0EL1) {
2672 return inst.generateTrap(
EL2);
2677 return inst.undefined();
2682faultMpam1EL1(
const MiscRegLUTEntry &entry,
2683 ThreadContext *tc,
const MiscRegOp64 &inst)
2685 if (
HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2689 return inst.generateTrap(
EL3);
2690 }
else if (
EL2Enabled(tc) && mpam2.el2.trapMpam1EL1) {
2691 return inst.generateTrap(
EL2);
2696 return inst.undefined();
2701faultMpamEL2(
const MiscRegLUTEntry &entry,
2702 ThreadContext *tc,
const MiscRegOp64 &inst)
2704 if (
HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2707 return inst.generateTrap(
EL3);
2712 return inst.undefined();
2717faultMpam12EL2(
const MiscRegLUTEntry &entry,
2718 ThreadContext *tc,
const MiscRegOp64 &inst)
2721 return faultMpamEL2(entry, tc, inst);
2723 return inst.undefined();
2728faultMpamsmEL1(
const MiscRegLUTEntry &entry,
2729 ThreadContext *tc,
const MiscRegOp64 &inst)
2731 if (
HaveExt(tc, ArmExtension::FEAT_MPAM)) {
2735 return inst.generateTrap(
EL3);
2736 }
else if (
EL2Enabled(tc) && mpam2.el2.enMpamSm) {
2737 return inst.generateTrap(
EL2);
2742 return inst.undefined();
2750 unsigned crn,
unsigned crm,
2760 auto it = miscRegNumToIdx.find(sys_reg);
2761 if (it != miscRegNumToIdx.end()) {
2765 if ((sys_reg.
op0 == 1 || sys_reg.
op0 == 3) &&
2766 (sys_reg.
crn == 11 || sys_reg.
crn == 15)) {
2774std::optional<MiscRegNum64>
2777 if (
auto it = idxToMiscRegNum.find(misc_reg);
2778 it != idxToMiscRegNum.end()) {
2781 return std::nullopt;
2793template <MiscRegInfo Sec, MiscRegInfo NonSec>
2822 const bool el2_host =
EL2Enabled(tc) && hcr.e2h;
2849 switch (
system->highestEL()) {
2863 panic(
"Invalid highest implemented exception level");
2880 static bool completed =
false;
2898 bool LSMAOE =
false;
2901 bool nTLSMD =
false;
2909 const bool vhe_implemented =
release->
has(ArmExtension::FEAT_VHE);
2910 const bool sel2_implemented =
release->
has(ArmExtension::FEAT_SEL2);
2967 mvfr1.flushToZero = 1;
2968 mvfr1.defaultNaN = 1;
2969 mvfr1.advSimdLoadStore = 1;
2970 mvfr1.advSimdInteger = 1;
2971 mvfr1.advSimdSinglePrecision = 1;
2972 mvfr1.advSimdHalfPrecision = 1;
2973 mvfr1.vfpHalfPrecision = 1;
2980 mvfr0.advSimdRegisters = 2;
2981 mvfr0.singlePrecision = 2;
2982 mvfr0.doublePrecision = 2;
2983 mvfr0.vfpExceptionTrapping = 0;
2985 mvfr0.squareRoot = 1;
2986 mvfr0.shortVectors = 1;
2987 mvfr0.roundingModes = 1;
3285 unsigned line_size_words =
3286 system->cacheLineSize() / 4;
3287 unsigned log2_line_size_words = 0;
3289 while (line_size_words >>= 1) {
3290 ++log2_line_size_words;
3295 ctr.iCacheLineSize = log2_line_size_words;
3297 ctr.l1IndexPolicy = 0x3;
3299 ctr.dCacheLineSize = log2_line_size_words;
3301 ctr.erg = log2_line_size_words;
3303 ctr.cwg = log2_line_size_words;
3330 bool have_timer = (
system &&
system->getGenericTimer() !=
nullptr);
3332 (release->has(ArmExtension::SECURITY) ?
3334 (release->has(ArmExtension::VIRTUALIZATION) ?
3336 (have_timer ? 0x00010000 : 0x0);
3341 .
reset(
p.pmu ? 0x03000000 : 0)
3342 .allPrivileges().exceptUserMode().writes(0);
3346 .
reset([
p,release=release](){
3348 if (release->has(ArmExtension::LPAE))
3349 mmfr0 = (mmfr0 & ~0xf) | 0x5;
3381 .
reset([
p,release=release] () {
3382 ISAR5 isar5 =
p.id_isar5;
3383 isar5.crc32 = release->has(ArmExtension::FEAT_CRC32) ? 0x1 : 0x0;
3384 isar5.sha2 = release->has(ArmExtension::FEAT_SHA256) ? 0x1 : 0x0;
3385 isar5.sha1 = release->has(ArmExtension::FEAT_SHA1) ? 0x1 : 0x0;
3386 isar5.aes = release->has(ArmExtension::FEAT_PMULL) ?
3387 0x2 : release->has(ArmExtension::FEAT_AES) ?
3389 isar5.rdm = release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0;
3390 isar5.vcma = release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0;
3395 .
reset([
p,release=release] () {
3396 ISAR6 isar6 =
p.id_isar6;
3397 isar6.jscvt = release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0;
3428 .
res1(0x00400800 | (SPAN ? 0 : 0x800000)
3429 | (LSMAOE ? 0 : 0x10)
3430 | (nTLSMD ? 0 : 0x8));
3432 auto sctlr_reset = [
aarch64=highestELIs64] ()
3478 .
reset(release->has(ArmExtension::SECURITY) ? 0 : 1)
3479 .mon().secure().exceptUserMode()
3489 .
res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
3490 | (IESB ? 0 : 0x200000)
3491 | (EnDA ? 0 : 0x8000000)
3492 | (EnIB ? 0 : 0x40000000)
3493 | (EnIA ? 0 : 0x80000000))
3499 .
res0(release->has(ArmExtension::VIRTUALIZATION) ?
3500 0x90000000 :
mask(31, 0));
3503 .
res0(release->has(ArmExtension::VIRTUALIZATION) ?
3504 0xffa9ff8c :
mask(31, 0));
3884 .
res0(release->has(ArmExtension::LPAE) ? 0 :
mask(31, 0))
3894 .
res0(release->has(ArmExtension::LPAE) ? 0 :
mask(31, 0))
4119 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::mdscrEL1>)
4120 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::mdscrEL1>)
4128 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::oseccrEL1>)
4129 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::oseccrEL1>)
4134 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4135 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4140 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4141 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4146 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4147 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4152 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4153 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4158 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4159 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4164 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4165 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4170 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4171 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4176 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4177 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4182 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4183 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4188 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4189 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4194 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4195 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4200 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4201 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4206 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4207 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4212 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4213 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4218 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4219 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4224 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbvrnEL1>)
4225 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbvrnEL1>)
4230 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4231 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4236 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4237 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4242 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4243 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4248 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4249 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4254 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4255 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4260 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4261 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4266 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4267 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4272 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4273 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4278 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4279 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4284 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4285 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4290 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4291 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4296 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4297 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4302 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4303 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4308 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4309 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4314 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4315 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4320 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgbcrnEL1>)
4321 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgbcrnEL1>)
4326 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4327 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4332 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4333 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4338 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4339 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4344 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4345 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4350 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4351 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4356 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4357 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4362 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4363 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4368 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4369 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4374 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4375 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4380 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4381 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4386 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4387 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4392 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4393 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4398 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4399 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4404 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4405 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4410 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4411 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4416 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwvrnEL1>)
4417 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwvrnEL1>)
4422 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4423 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4428 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4429 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4434 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4435 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4440 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4441 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4446 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4447 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4452 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4453 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4458 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4459 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4464 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4465 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4470 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4471 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4476 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4477 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4482 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4483 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4488 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4489 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4494 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4495 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4500 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4501 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4506 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4507 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4512 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgwcrnEL1>)
4513 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgwcrnEL1>)
4544 .
faultRead(
EL1, faultDebugOsEL1<true, &HDFGTR::oslsrEL1>)
4549 .
faultRead(
EL1, faultDebugOsEL1<true, &HDFGTR::osdlrEL1>)
4555 .
faultRead(
EL1, faultDebugOsEL1<true, &HDFGTR::dbgprcrEL1>)
4556 .
faultWrite(
EL1, faultDebugOsEL1<false, &HDFGTR::dbgprcrEL1>)
4561 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgclaim>)
4562 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgclaim>)
4567 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgclaim>)
4568 .
faultWrite(
EL1, faultDebugWithFgtEL1<false, &HDFGTR::dbgclaim>)
4573 .
faultRead(
EL1, faultDebugWithFgtEL1<true, &HDFGTR::dbgauthstatusEL1>)
4581 .allPrivileges().exceptUserMode().writes(0)
4582 .faultRead(
EL0, faultIdst)
4583 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::midrEL1>)
4586 .allPrivileges().exceptUserMode().writes(0)
4587 .faultRead(
EL0, faultIdst)
4588 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::mpidrEL1>)
4591 .faultRead(
EL0, faultIdst)
4592 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::tid1, &HFGTR::revidrEL1>)
4593 .allPrivileges().exceptUserMode().writes(0);
4595 .allPrivileges().exceptUserMode().writes(0)
4596 .faultRead(
EL0, faultIdst)
4597 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4600 .allPrivileges().exceptUserMode().writes(0)
4601 .faultRead(
EL0, faultIdst)
4602 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4605 .allPrivileges().exceptUserMode().writes(0)
4606 .faultRead(
EL0, faultIdst)
4607 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4610 .allPrivileges().exceptUserMode().writes(0)
4611 .faultRead(
EL0, faultIdst)
4612 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4615 .allPrivileges().exceptUserMode().writes(0)
4616 .faultRead(
EL0, faultIdst)
4617 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4620 .allPrivileges().exceptUserMode().writes(0)
4621 .faultRead(
EL0, faultIdst)
4622 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4625 .allPrivileges().exceptUserMode().writes(0)
4626 .faultRead(
EL0, faultIdst)
4627 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4630 .allPrivileges().exceptUserMode().writes(0)
4631 .faultRead(
EL0, faultIdst)
4632 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4635 .allPrivileges().exceptUserMode().writes(0)
4636 .faultRead(
EL0, faultIdst)
4637 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4640 .allPrivileges().exceptUserMode().writes(0)
4641 .faultRead(
EL0, faultIdst)
4642 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4645 .allPrivileges().exceptUserMode().writes(0)
4646 .faultRead(
EL0, faultIdst)
4647 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4650 .allPrivileges().exceptUserMode().writes(0)
4651 .faultRead(
EL0, faultIdst)
4652 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4655 .allPrivileges().exceptUserMode().writes(0)
4656 .faultRead(
EL0, faultIdst)
4657 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4660 .allPrivileges().exceptUserMode().writes(0)
4661 .faultRead(
EL0, faultIdst)
4662 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4665 .allPrivileges().exceptUserMode().writes(0)
4666 .faultRead(
EL0, faultIdst)
4667 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4670 .allPrivileges().exceptUserMode().writes(0)
4671 .faultRead(
EL0, faultIdst)
4672 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4675 .faultRead(
EL0, faultIdst)
4676 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4677 .allPrivileges().exceptUserMode().writes(0)
4680 .faultRead(
EL0, faultIdst)
4681 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4682 .allPrivileges().exceptUserMode().writes(0)
4685 .faultRead(
EL0, faultIdst)
4686 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4687 .allPrivileges().exceptUserMode().writes(0);
4689 .reset([
this,release=release,tc=tc](){
4690 AA64PFR0 pfr0_el1 = 0;
4693 pfr0_el1.el2 = release->has(ArmExtension::VIRTUALIZATION)
4695 pfr0_el1.el3 = release->has(ArmExtension::SECURITY) ? 0x2 : 0x0;
4696 pfr0_el1.sve = release->has(ArmExtension::FEAT_SVE) ? 0x1 : 0x0;
4697 pfr0_el1.sel2 = release->has(ArmExtension::FEAT_SEL2) ? 0x1 : 0x0;
4700 pfr0_el1.mpam = 0x0;
4701 pfr0_el1.gic =
FullSystem && getGICv3CPUInterface(tc) ? 0x1 : 0;
4705 .faultRead(
EL0, faultIdst)
4706 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4707 .allPrivileges().writes(0);
4709 .reset([release=release](){
4710 AA64PFR1 pfr1_el1 = 0;
4711 pfr1_el1.sme = release->has(ArmExtension::FEAT_SME) ? 0x1 : 0x0;
4712 pfr1_el1.mpamFrac = release->has(ArmExtension::FEAT_MPAM) ?
4717 .faultRead(
EL0, faultIdst)
4718 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4719 .allPrivileges().writes(0);
4722 AA64DFR0 dfr0_el1 =
p.id_aa64dfr0_el1;
4723 dfr0_el1.pmuver =
p.pmu ? 1 : 0;
4726 .faultRead(
EL0, faultIdst)
4727 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4728 .allPrivileges().writes(0);
4730 .reset(
p.id_aa64dfr1_el1)
4731 .faultRead(
EL0, faultIdst)
4732 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4733 .allPrivileges().writes(0);
4735 .reset(
p.id_aa64afr0_el1)
4736 .faultRead(
EL0, faultIdst)
4737 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4738 .allPrivileges().writes(0);
4740 .reset(
p.id_aa64afr1_el1)
4741 .faultRead(
EL0, faultIdst)
4742 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4743 .allPrivileges().writes(0);
4745 .reset([
p,release=release](){
4746 AA64ISAR0 isar0_el1 =
p.id_aa64isar0_el1;
4747 isar0_el1.crc32 = release->has(ArmExtension::FEAT_CRC32) ? 0x1 : 0x0;
4748 isar0_el1.sha2 = release->has(ArmExtension::FEAT_SHA256) ? 0x1 : 0x0;
4749 isar0_el1.sha1 = release->has(ArmExtension::FEAT_SHA1) ? 0x1 : 0x0;
4750 isar0_el1.aes = release->has(ArmExtension::FEAT_PMULL) ?
4751 0x2 : release->has(ArmExtension::FEAT_AES) ?
4753 isar0_el1.dp = release->has(ArmExtension::FEAT_DOTPROD) ? 0x1 : 0x0;
4754 isar0_el1.atomic = release->has(ArmExtension::FEAT_LSE) ? 0x2 : 0x0;
4755 isar0_el1.rdm = release->has(ArmExtension::FEAT_RDM) ? 0x1 : 0x0;
4756 isar0_el1.tme = release->has(ArmExtension::TME) ? 0x1 : 0x0;
4757 isar0_el1.tlb = release->has(ArmExtension::FEAT_TLBIRANGE) ?
4758 0x2 : release->has(ArmExtension::FEAT_TLBIOS) ?
4760 isar0_el1.ts = release->has(ArmExtension::FEAT_FLAGM2) ?
4761 0x2 : release->has(ArmExtension::FEAT_FLAGM) ?
4763 isar0_el1.rndr = release->has(ArmExtension::FEAT_RNG) ? 0x1 : 0x0;
4766 .faultRead(
EL0, faultIdst)
4767 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4768 .allPrivileges().writes(0);
4770 .reset([
p,release=release](){
4771 AA64ISAR1 isar1_el1 =
p.id_aa64isar1_el1;
4772 isar1_el1.i8mm = release->has(ArmExtension::FEAT_I8MM) ? 0x1 : 0x0;
4773 isar1_el1.apa = release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0;
4774 isar1_el1.jscvt = release->has(ArmExtension::FEAT_JSCVT) ? 0x1 : 0x0;
4775 isar1_el1.fcma = release->has(ArmExtension::FEAT_FCMA) ? 0x1 : 0x0;
4776 isar1_el1.gpa = release->has(ArmExtension::FEAT_PAuth) ? 0x1 : 0x0;
4779 .faultRead(
EL0, faultIdst)
4780 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4781 .allPrivileges().writes(0);
4784 AA64MMFR0 mmfr0_el1 =
p.id_aa64mmfr0_el1;
4785 mmfr0_el1.asidbits =
asidbits ? 0x2 : 0x0;
4789 .faultRead(
EL0, faultIdst)
4790 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4791 .allPrivileges().writes(0);
4793 .reset([
p,release=release](){
4794 AA64MMFR1 mmfr1_el1 =
p.id_aa64mmfr1_el1;
4795 mmfr1_el1.vmidbits =
4796 release->has(ArmExtension::FEAT_VMID16) ? 0x2 : 0x0;
4797 mmfr1_el1.vh = release->has(ArmExtension::FEAT_VHE) ? 0x1 : 0x0;
4798 mmfr1_el1.hpds = release->has(ArmExtension::FEAT_HPDS) ? 0x1 : 0x0;
4799 mmfr1_el1.pan = release->has(ArmExtension::FEAT_PAN) ? 0x1 : 0x0;
4800 mmfr1_el1.hcx = release->has(ArmExtension::FEAT_HCX) ? 0x1 : 0x0;
4803 .faultRead(
EL0, faultIdst)
4804 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4805 .allPrivileges().writes(0);
4807 .reset([
p,release=release](){
4808 AA64MMFR2 mmfr2_el1 =
p.id_aa64mmfr2_el1;
4809 mmfr2_el1.uao = release->has(ArmExtension::FEAT_UAO) ? 0x1 : 0x0;
4810 mmfr2_el1.varange = release->has(ArmExtension::FEAT_LVA) ? 0x1 : 0x0;
4811 mmfr2_el1.ids = release->has(ArmExtension::FEAT_IDST) ? 0x1 : 0x0;
4812 mmfr2_el1.evt = release->has(ArmExtension::FEAT_EVT) ? 0x2 : 0x0;
4815 .faultRead(
EL0, faultIdst)
4816 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4817 .allPrivileges().writes(0);
4819 .reset([
p,release=release](){
4820 AA64MMFR3 mmfr3_el1 = 0;
4822 release->has(ArmExtension::FEAT_SCTLR2) ? 0x1 : 0x0;
4823 mmfr3_el1.tcrx = release->has(ArmExtension::FEAT_TCR2) ? 0x1 : 0x0;
4826 .faultRead(
EL0, faultIdst)
4827 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
4828 .allPrivileges().writes(0);
4831 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apdaKey>)
4832 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apdaKey>)
4833 .fault(
EL2, faultPauthEL2)
4834 .allPrivileges().exceptUserMode();
4836 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apdaKey>)
4837 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apdaKey>)
4838 .fault(
EL2, faultPauthEL2)
4839 .allPrivileges().exceptUserMode();
4841 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apdbKey>)
4842 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apdbKey>)
4843 .fault(
EL2, faultPauthEL2)
4844 .allPrivileges().exceptUserMode();
4846 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apdbKey>)
4847 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apdbKey>)
4848 .fault(
EL2, faultPauthEL2)
4849 .allPrivileges().exceptUserMode();
4851 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apgaKey>)
4852 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apgaKey>)
4853 .fault(
EL2, faultPauthEL2)
4854 .allPrivileges().exceptUserMode();
4856 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apgaKey>)
4857 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apgaKey>)
4858 .fault(
EL2, faultPauthEL2)
4859 .allPrivileges().exceptUserMode();
4861 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apiaKey>)
4862 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apiaKey>)
4863 .fault(
EL2, faultPauthEL2)
4864 .allPrivileges().exceptUserMode();
4866 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apiaKey>)
4867 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apiaKey>)
4868 .fault(
EL2, faultPauthEL2)
4869 .allPrivileges().exceptUserMode();
4871 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apibKey>)
4872 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apibKey>)
4873 .fault(
EL2, faultPauthEL2)
4874 .allPrivileges().exceptUserMode();
4876 .faultRead(
EL1, faultPauthEL1<true, &HFGTR::apibKey>)
4877 .faultWrite(
EL1, faultPauthEL1<false, &HFGTR::apibKey>)
4878 .fault(
EL2, faultPauthEL2)
4879 .allPrivileges().exceptUserMode();
4882 .faultRead(
EL0, faultIdst)
4883 .faultRead(
EL1, faultCacheEL1<true, &HFGTR::ccsidrEL1>)
4884 .allPrivileges().writes(0);
4886 .faultRead(
EL0, faultIdst)
4887 .faultRead(
EL1, faultCacheEL1<true, &HFGTR::clidrEL1>)
4888 .allPrivileges().writes(0);
4890 .faultRead(
EL0, faultIdst)
4891 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::tid1, &HFGTR::aidrEL1>)
4892 .allPrivileges().writes(0);
4894 .allPrivileges().exceptUserMode()
4895 .faultRead(
EL1, faultCacheEL1<true, &HFGTR::csselrEL1>)
4896 .faultWrite(
EL1, faultCacheEL1<false, &HFGTR::csselrEL1>)
4899 .faultRead(
EL0, faultCtrEL0)
4900 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::tid2, &HFGTR::ctrEL0>)
4905 .faultRead(
EL0, faultFgtEL0<true, &HFGTR::dczidEL0>)
4906 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::dczidEL0>)
4917 .allPrivileges().exceptUserMode()
4918 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::sctlrEL1>)
4919 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::sctlrEL1>)
4920 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4921 | (IESB ? 0 : 0x200000)
4922 | (EnDA ? 0 : 0x8000000)
4923 | (EnIB ? 0 : 0x40000000)
4924 | (EnIA ? 0 : 0x80000000))
4925 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4926 | (nTLSMD ? 0 : 0x8000000)
4927 | (LSMAOE ? 0 : 0x10000000))
4932 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4933 | (IESB ? 0 : 0x200000)
4934 | (EnDA ? 0 : 0x8000000)
4935 | (EnIB ? 0 : 0x40000000)
4936 | (EnIA ? 0 : 0x80000000))
4937 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4938 | (nTLSMD ? 0 : 0x8000000)
4939 | (LSMAOE ? 0 : 0x10000000))
4942 .allPrivileges().exceptUserMode()
4943 .faultRead(
EL1, faultSctlr2EL1<true, &HCR::trvm>)
4944 .faultWrite(
EL1, faultSctlr2EL1<false, &HCR::tvm>)
4945 .fault(
EL2,faultSctlr2EL2);
4947 .fault(
EL2, faultSctlr2VheEL2)
4951 .allPrivileges().exceptUserMode()
4952 .fault(
EL1, faultHcrEL1<&HCR::tacr>)
4955 .allPrivileges().exceptUserMode()
4956 .faultRead(
EL1, faultCpacrEL1<true, &HFGTR::cpacrEL1>)
4957 .faultWrite(
EL1, faultCpacrEL1<false, &HFGTR::cpacrEL1>)
4958 .fault(
EL2, faultCpacrEL2)
4961 .fault(
EL2, faultCpacrVheEL2)
4966 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
4967 | (IESB ? 0 : 0x200000)
4968 | (EnDA ? 0 : 0x8000000)
4969 | (EnIB ? 0 : 0x40000000)
4970 | (EnIA ? 0 : 0x80000000))
4975 .fault(
EL2, faultSctlr2EL2);
4984 .fault(
EL2, faultHcrxEL2);
4987 .fault(
EL2, faultDebugEL2)
4991 .fault(
EL2, faultCpacrEL2)
5002 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
5003 | (IESB ? 0 : 0x200000)
5004 | (EnDA ? 0 : 0x8000000)
5005 | (EnIB ? 0 : 0x40000000)
5006 | (EnIA ? 0 : 0x80000000))
5024 .allPrivileges().exceptUserMode()
5025 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::ttbr0EL1>)
5026 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::ttbr0EL1>)
5033 .allPrivileges().exceptUserMode()
5034 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::ttbr1EL1>)
5035 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::ttbr1EL1>)
5042 .allPrivileges().exceptUserMode()
5043 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::tcrEL1>)
5044 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::tcrEL1>)
5051 .allPrivileges().exceptUserMode()
5052 .faultRead(
EL1, faultTcr2EL1<true, &HCR::trvm>)
5053 .faultWrite(
EL1, faultTcr2EL1<false, &HCR::tvm>)
5054 .fault(
EL2, faultTcr2EL2);
5056 .fault(
EL2, faultTcr2VheEL2)
5057 .fault(
EL3, faultTcr2VheEL3)
5069 .fault(
EL2, faultTcr2EL2);
5088 .allPrivileges().exceptUserMode()
5095 .allPrivileges().exceptUserMode();
5101 .allPrivileges().exceptUserMode()
5102 .fault(
EL1, faultSpEL0)
5103 .fault(
EL2, faultSpEL0)
5104 .fault(
EL3, faultSpEL0);
5106 .allPrivileges().exceptUserMode();
5108 .allPrivileges().exceptUserMode().writes(0);
5110 .allPrivileges(release->has(ArmExtension::FEAT_PAN))
5113 .allPrivileges().exceptUserMode();
5118 .fault(
EL0, faultDaif);
5121 .fault(
EL0, faultFpcrEL0)
5122 .fault(
EL1, faultFpcrEL1)
5123 .fault(
EL2, faultFpcrEL2)
5124 .fault(
EL3, faultFpcrEL3);
5127 .fault(
EL0, faultFpcrEL0)
5128 .fault(
EL1, faultFpcrEL1)
5129 .fault(
EL2, faultFpcrEL2)
5130 .fault(
EL3, faultFpcrEL3);
5158 .allPrivileges().exceptUserMode()
5159 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::afsr0EL1>)
5160 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::afsr0EL1>)
5167 .allPrivileges().exceptUserMode()
5168 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::afsr1EL1>)
5169 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::afsr1EL1>)
5176 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::esrEL1>)
5177 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::esrEL1>)
5178 .allPrivileges().exceptUserMode();
5196 .fault(
EL2, faultFpcrEL2)
5197 .fault(
EL3, faultFpcrEL3)
5206 .allPrivileges().exceptUserMode()
5207 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::farEL1>)
5208 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::farEL1>)
5224 .faultWrite(
EL1, faultPouIsEL1<&HFGITR::icialluis>)
5225 .writes(1).exceptUserMode();
5227 .allPrivileges().exceptUserMode()
5231 .faultWrite(
EL1, faultPouEL1<&HFGITR::iciallu>)
5232 .writes(1).exceptUserMode();
5234 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tpc, &HFGITR::dcivac>)
5235 .writes(1).exceptUserMode();
5238 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dcisw>)
5239 .writes(1).exceptUserMode();
5241 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e1r>)
5242 .writes(1).exceptUserMode();
5244 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e1w>)
5245 .writes(1).exceptUserMode();
5247 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e0r>)
5248 .writes(1).exceptUserMode();
5250 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::at, &HFGITR::ats1e0w>)
5251 .writes(1).exceptUserMode();
5254 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dccsw>)
5255 .writes(1).exceptUserMode();
5258 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tsw, &HFGITR::dccisw>)
5259 .writes(1).exceptUserMode();
5262 .faultWrite(
EL0, faultDczvaEL0)
5263 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tdz, &HFGITR::dczva>);
5265 .faultWrite(
EL0, faultPouEL0)
5266 .faultWrite(
EL1, faultPouEL1<&HFGITR::icivau>)
5269 .faultWrite(
EL0, faultCvacEL0)
5270 .faultWrite(
EL1, faultHcrEL1<&HCR::tpc>)
5273 .faultWrite(
EL0, faultPouEL0)
5274 .faultWrite(
EL1, faultPouEL1<&HFGITR::dccvau>)
5277 .faultWrite(
EL0, faultCvacEL0)
5278 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::tpc, &HFGITR::dccivac>)
5281 .monNonSecureWrite().hypWrite();
5283 .monNonSecureWrite().hypWrite();
5285 .hypWrite().monSecureWrite().monNonSecureWrite();
5287 .hypWrite().monSecureWrite().monNonSecureWrite();
5289 .hypWrite().monSecureWrite().monNonSecureWrite();
5291 .hypWrite().monSecureWrite().monNonSecureWrite();
5293 .monSecureWrite().monNonSecureWrite();
5295 .monSecureWrite().monNonSecureWrite();
5297 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbivmalle1os>)
5298 .writes(1).exceptUserMode();
5300 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbivae1os>)
5301 .writes(1).exceptUserMode();
5303 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbiaside1os>)
5304 .writes(1).exceptUserMode();
5306 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbivaae1os>)
5307 .writes(1).exceptUserMode();
5309 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbivale1os>)
5310 .writes(1).exceptUserMode();
5312 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbivaale1os>)
5313 .writes(1).exceptUserMode();
5315 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbivmalle1is>)
5316 .writes(1).exceptUserMode();
5318 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbivae1is>)
5319 .writes(1).exceptUserMode();
5321 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbiaside1is>)
5322 .writes(1).exceptUserMode();
5324 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbivaae1is>)
5325 .writes(1).exceptUserMode();
5327 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbivale1is>)
5328 .writes(1).exceptUserMode();
5330 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbivaale1is>)
5331 .writes(1).exceptUserMode();
5333 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivmalle1>)
5334 .writes(1).exceptUserMode();
5336 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivae1>)
5337 .writes(1).exceptUserMode();
5339 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbiaside1>)
5340 .writes(1).exceptUserMode();
5342 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivaae1>)
5343 .writes(1).exceptUserMode();
5345 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivale1>)
5346 .writes(1).exceptUserMode();
5348 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbivaale1>)
5349 .writes(1).exceptUserMode();
5351 .monWrite().hypWrite();
5353 .monWrite().hypWrite();
5355 .monWrite().hypWrite();
5357 .monWrite().hypWrite();
5359 .monWrite().hypWrite();
5361 .monWrite().hypWrite();
5363 .monWrite().hypWrite();
5365 .monWrite().hypWrite();
5367 .monWrite().hypWrite();
5369 .monWrite().hypWrite();
5371 .monWrite().hypWrite();
5373 .monWrite().hypWrite();
5375 .monWrite().hypWrite();
5377 .monWrite().hypWrite();
5379 .monWrite().hypWrite();
5381 .monWrite().hypWrite();
5383 .monWrite().hypWrite();
5385 .monWrite().hypWrite();
5387 .monWrite().hypWrite();
5389 .monWrite().hypWrite();
5391 .monWrite().hypWrite();
5393 .monSecureWrite().monNonSecureWrite();
5395 .monSecureWrite().monNonSecureWrite();
5397 .monSecureWrite().monNonSecureWrite();
5399 .monSecureWrite().monNonSecureWrite();
5401 .monSecureWrite().monNonSecureWrite();
5403 .monSecureWrite().monNonSecureWrite();
5405 .monSecureWrite().monNonSecureWrite();
5407 .monSecureWrite().monNonSecureWrite();
5409 .monSecureWrite().monNonSecureWrite();
5412 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvae1>)
5413 .writes(1).exceptUserMode();
5415 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvaae1>)
5416 .writes(1).exceptUserMode();
5418 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvale1>)
5419 .writes(1).exceptUserMode();
5421 .faultWrite(
EL1, faultHcrFgtInstEL1<&HCR::ttlb, &HFGITR::tlbirvaale1>)
5422 .writes(1).exceptUserMode();
5424 .hypWrite().monWrite();
5426 .hypWrite().monWrite();
5428 .hypWrite().monWrite();
5430 .hypWrite().monWrite();
5436 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbirvae1is>)
5437 .writes(1).exceptUserMode();
5439 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbirvaae1is>)
5440 .writes(1).exceptUserMode();
5442 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbirvale1is>)
5443 .writes(1).exceptUserMode();
5445 .faultWrite(
EL1, faultTlbiIsEL1<&HFGITR::tlbirvaale1is>)
5446 .writes(1).exceptUserMode();
5448 .hypWrite().monWrite();
5450 .hypWrite().monWrite();
5452 .hypWrite().monWrite();
5454 .hypWrite().monWrite();
5460 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbirvae1os>)
5461 .writes(1).exceptUserMode();
5463 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbirvaae1os>)
5464 .writes(1).exceptUserMode();
5466 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbirvale1os>)
5467 .writes(1).exceptUserMode();
5469 .faultWrite(
EL1, faultTlbiOsEL1<&HFGITR::tlbirvaale1os>)
5470 .writes(1).exceptUserMode();
5472 .hypWrite().monWrite();
5474 .hypWrite().monWrite();
5476 .hypWrite().monWrite();
5478 .hypWrite().monWrite();
5484 .allPrivileges().exceptUserMode()
5487 .allPrivileges().exceptUserMode()
5525 .allPrivileges().userNonSecureWrite(0).userSecureWrite(0)
5531 .allPrivileges().exceptUserMode()
5532 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::mairEL1>)
5533 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::mairEL1>)
5540 .allPrivileges().exceptUserMode()
5541 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::amairEL1>)
5542 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::amairEL1>)
5559 .allPrivileges().exceptUserMode();
5561 .allPrivileges().exceptUserMode();
5563 .allPrivileges().exceptUserMode()
5564 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::vbarEL1>)
5565 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::vbarEL1>)
5576 .allPrivileges().exceptUserMode().writes(0);
5594 .allPrivileges().exceptUserMode()
5595 .faultRead(
EL1, faultHcrFgtEL1<true, &HCR::trvm, &HFGTR::contextidrEL1>)
5596 .faultWrite(
EL1, faultHcrFgtEL1<false, &HCR::tvm, &HFGTR::contextidrEL1>)
5603 .allPrivileges().exceptUserMode()
5604 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::tpidrEL1>)
5605 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::tpidrEL1>)
5609 .faultRead(
EL0, faultFgtEL0<true, &HFGTR::tpidrEL0>)
5610 .faultWrite(
EL0, faultFgtEL0<false, &HFGTR::tpidrEL0>)
5611 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::tpidrEL0>)
5612 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::tpidrEL0>)
5615 .allPrivileges().userNonSecureWrite(0).userSecureWrite(0)
5616 .faultRead(
EL0, faultFgtEL0<true, &HFGTR::tpidrroEL0>)
5617 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::tpidrroEL0>)
5618 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::tpidrroEL0>)
5628 .faultRead(
EL0, faultGenericTimerEL0)
5630 .privSecureWrite(aarch32EL3)
5634 .faultRead(
EL0, faultCntpctEL0)
5635 .faultRead(
EL1, faultCntpctEL1)
5640 .faultRead(
EL0, faultCntvctEL0)
5641 .faultRead(
EL1, faultCntvctEL1)
5646 .fault(
EL0, faultCntpCtlEL0)
5647 .fault(
EL1, faultCntpCtlEL1)
5648 .res0(0xfffffffffffffff8)
5652 .fault(
EL0, faultCntpCtlEL0)
5653 .fault(
EL1, faultCntpCtlEL1)
5657 .fault(
EL0, faultCntpCtlEL0)
5658 .fault(
EL1, faultCntpCtlEL1)
5659 .res0(0xffffffff00000000)
5663 .fault(
EL0, faultCntvCtlEL0)
5664 .fault(
EL1, faultCntvCtlEL1)
5665 .res0(0xfffffffffffffff8)
5669 .fault(
EL0, faultCntvCtlEL0)
5670 .fault(
EL1, faultCntvCtlEL1)
5674 .fault(
EL0, faultCntvCtlEL0)
5675 .fault(
EL1, faultCntvCtlEL1)
5676 .res0(0xffffffff00000000)
5681 .res0(0xfffffffffffffff8)
5690 .res0(0xffffffff00000000)
5695 .res0(0xfffffffffffffff8)
5704 .res0(0xffffffff00000000)
5709 .res0(0xfffffffffffdfc00)
5714 .res0(0xfffffffffffdfc00)
5719 .fault(
EL1, faultCntpsCtlEL1)
5720 .res0(0xfffffffffffffff8);
5724 .fault(
EL1, faultCntpsCtlEL1);
5728 .fault(
EL1, faultCntpsCtlEL1)
5729 .res0(0xffffffff00000000);
5733 .res0(0xfffffffffffc0000)
5738 .res0(0xfffffffffffffff8)
5747 .res0(0xffffffff00000000)
5750 .mon(sel2_implemented)
5751 .hypSecure(sel2_implemented)
5752 .res0(0xfffffffffffffff8);
5754 .mon(sel2_implemented)
5755 .hypSecure(sel2_implemented);
5757 .mon(sel2_implemented)
5758 .hypSecure(sel2_implemented)
5759 .res0(0xffffffff00000000);
5761 .mon(vhe_implemented)
5763 .res0(0xfffffffffffffff8);
5765 .mon(vhe_implemented)
5766 .hyp(vhe_implemented);
5768 .mon(vhe_implemented)
5769 .hyp(vhe_implemented)
5770 .res0(0xffffffff00000000);
5772 .mon(vhe_implemented && sel2_implemented)
5773 .hypSecure(vhe_implemented && sel2_implemented)
5774 .res0(0xfffffffffffffff8);
5776 .mon(vhe_implemented && sel2_implemented)
5777 .hypSecure(vhe_implemented && sel2_implemented);
5779 .mon(vhe_implemented && sel2_implemented)
5780 .hypSecure(vhe_implemented && sel2_implemented)
5781 .res0(0xffffffff00000000);
5825 .allPrivileges().exceptUserMode();
5827 .allPrivileges().exceptUserMode();
5829 .allPrivileges().exceptUserMode();
5831 .allPrivileges().exceptUserMode();
5833 .allPrivileges().exceptUserMode();
5835 .allPrivileges().exceptUserMode();
5837 .allPrivileges().exceptUserMode();
5839 .allPrivileges().exceptUserMode();
5841 .allPrivileges().exceptUserMode();
5843 .allPrivileges().exceptUserMode();
5845 .allPrivileges().exceptUserMode();
5847 .allPrivileges().exceptUserMode();
5849 .allPrivileges().exceptUserMode();
5852 .fault(faultUnimplemented);
5854 .allPrivileges().exceptUserMode().writes(0);
5861 .allPrivileges().exceptUserMode()
5864 .allPrivileges().exceptUserMode().writes(0)
5867 .allPrivileges().exceptUserMode().reads(0)
5870 .allPrivileges().exceptUserMode().writes(0)
5874 .allPrivileges().exceptUserMode()
5877 .allPrivileges().exceptUserMode()
5880 .allPrivileges().exceptUserMode()
5883 .allPrivileges().exceptUserMode()
5886 .allPrivileges().exceptUserMode()
5893 .allPrivileges().exceptUserMode()
5897 .allPrivileges().exceptUserMode()
5904 .allPrivileges().exceptUserMode()
5908 .allPrivileges().exceptUserMode()
5915 .allPrivileges().exceptUserMode()
5919 .allPrivileges().exceptUserMode()
5926 .allPrivileges().exceptUserMode()
5930 .allPrivileges().exceptUserMode()
5934 .allPrivileges().exceptUserMode().reads(0)
5937 .allPrivileges().exceptUserMode().writes(0)
5940 .allPrivileges().exceptUserMode().reads(0)
5941 .faultWrite(
EL1, faultIccSgiEL1)
5942 .faultWrite(
EL2, faultIccSgiEL2)
5945 .allPrivileges().exceptUserMode().reads(0)
5946 .faultWrite(
EL1, faultIccSgiEL1)
5947 .faultWrite(
EL2, faultIccSgiEL2)
5950 .allPrivileges().exceptUserMode().reads(0)
5951 .faultWrite(
EL1, faultIccSgiEL1)
5952 .faultWrite(
EL2, faultIccSgiEL2)
5955 .allPrivileges().exceptUserMode().writes(0)
5959 .allPrivileges().exceptUserMode().reads(0)
5962 .allPrivileges().exceptUserMode().writes(0)
5970 .allPrivileges().exceptUserMode()
5975 .secure().exceptUserMode()
5983 .allPrivileges().exceptUserMode()
5988 .secure().exceptUserMode()
5996 .allPrivileges().exceptUserMode()
6001 .secure().exceptUserMode()
6005 .allPrivileges().exceptUserMode()
6006 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::iccIgrpEnEL1>)
6007 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::iccIgrpEnEL1>)
6011 .faultRead(
EL1, faultFgtEL1<true, &HFGTR::iccIgrpEnEL1>)
6012 .faultWrite(
EL1, faultFgtEL1<false, &HFGTR::iccIgrpEnEL1>)
6017 .allPrivileges().exceptUserMode()
6022 .secure().exceptUserMode()
6065 .hyp().mon().writes(0)
6068 .hyp().mon().writes(0)
6071 .hyp().mon().writes(0)
6074 .hyp().mon().writes(0)
6130 .allPrivileges().exceptUserMode();
6132 .allPrivileges().exceptUserMode();
6134 .allPrivileges().exceptUserMode();
6136 .allPrivileges().exceptUserMode();
6138 .allPrivileges().exceptUserMode();
6140 .allPrivileges().exceptUserMode();
6142 .allPrivileges().exceptUserMode();
6144 .allPrivileges().exceptUserMode();
6146 .allPrivileges().exceptUserMode();
6148 .allPrivileges().exceptUserMode();
6150 .allPrivileges().exceptUserMode();
6152 .allPrivileges().exceptUserMode();
6154 .allPrivileges().exceptUserMode();
6156 .allPrivileges().exceptUserMode();
6158 .allPrivileges().exceptUserMode();
6160 .allPrivileges().exceptUserMode();
6162 .allPrivileges().exceptUserMode().reads(0);
6164 .allPrivileges().exceptUserMode();
6166 .allPrivileges().exceptUserMode();
6168 .allPrivileges().exceptUserMode();
6170 .allPrivileges().exceptUserMode();
6172 .allPrivileges().exceptUserMode();
6174 .allPrivileges().exceptUserMode();
6176 .allPrivileges().exceptUserMode();
6178 .allPrivileges().exceptUserMode().reads(0);
6180 .allPrivileges().exceptUserMode().reads(0);
6182 .allPrivileges().exceptUserMode().reads(0);
6184 .allPrivileges().exceptUserMode().writes(0);
6186 .allPrivileges().exceptUserMode().writes(0);
6190 .allPrivileges().exceptUserMode().writes(0);
6192 .allPrivileges().exceptUserMode().writes(0);
6194 .allPrivileges().exceptUserMode();
6196 .allPrivileges().exceptUserMode();
6198 .allPrivileges().exceptUserMode();
6200 .allPrivileges().exceptUserMode();
6208 .allPrivileges().exceptUserMode();
6210 .allPrivileges().exceptUserMode().writes(0);
6212 .allPrivileges().exceptUserMode().reads(0);
6214 .allPrivileges().exceptUserMode().reads(0);
6216 .allPrivileges().exceptUserMode();
6218 .allPrivileges().exceptUserMode();
6220 .allPrivileges().exceptUserMode();
6241 .hyp().mon().writes(0);
6243 .hyp().mon().writes(0);
6245 .hyp().mon().writes(0);
6247 .hyp().mon().writes(0);
6318 AA64ZFR0 zfr0_el1 = 0;
6319 zfr0_el1.f32mm = release->has(ArmExtension::FEAT_F32MM) ? 1 : 0;
6320 zfr0_el1.f64mm = release->has(ArmExtension::FEAT_F64MM) ? 1 : 0;
6321 zfr0_el1.i8mm = release->has(ArmExtension::FEAT_I8MM) ? 1 : 0;
6324 .faultRead(
EL0, faultIdst)
6325 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
6326 .allPrivileges().exceptUserMode().writes(0);
6329 .fault(
EL3, faultZcrEL3)
6333 .fault(
EL2, faultZcrEL2)
6334 .fault(
EL3, faultZcrEL3)
6342 .fault(
EL1, faultZcrEL1)
6343 .fault(
EL2, faultZcrEL2)
6344 .fault(
EL3, faultZcrEL3)
6345 .allPrivileges().exceptUserMode();
6350 AA64SMFR0 smfr0_el1 = 0;
6351 smfr0_el1.f32f32 = 0x1;
6355 smfr0_el1.b16f32 = 0x1;
6356 smfr0_el1.f16f32 = 0x1;
6357 smfr0_el1.i8i32 = 0xF;
6358 smfr0_el1.f64f64 = 0x1;
6359 smfr0_el1.i16i64 = 0xF;
6360 smfr0_el1.smEver = 0;
6361 smfr0_el1.fa64 = 0x1;
6364 .faultRead(
EL0, faultIdst)
6365 .faultRead(
EL1, faultHcrEL1<&HCR::tid3>)
6366 .allPrivileges().writes(0);
6374 .fault(
EL0, faultSmenEL0)
6375 .fault(
EL1, faultSmenEL1)
6376 .fault(
EL2, faultTsmSmen)
6377 .fault(
EL3, faultEsm)
6381 SMIDR smidr_el1 = 0;
6382 smidr_el1.affinity = 0;
6384 smidr_el1.implementer = 0x41;
6387 .faultRead(
EL0, faultIdst)
6388 .faultRead(
EL1, faultHcrEL1<&HCR::tid1>)
6389 .allPrivileges().writes(0);
6392 .fault(
EL1, faultEsm)
6393 .fault(
EL2, faultEsm)
6394 .fault(
EL3, faultEsm)
6395 .allPrivileges().exceptUserMode();
6397 .fault(
EL2, faultEsm)
6398 .fault(
EL3, faultEsm)
6409 smcr_el3.len = smeVL - 1;
6412 .fault(
EL3, faultEsm)
6423 smcr_el2.len = smeVL - 1;
6426 .fault(
EL2, faultTsmSmen)
6427 .fault(
EL3, faultEsm)
6430 .allPrivileges().exceptUserMode();
6440 smcr_el1.len = smeVL - 1;
6443 .fault(
EL1, faultSmenEL1)
6444 .fault(
EL2, faultTsmSmen)
6445 .fault(
EL3, faultEsm)
6446 .allPrivileges().exceptUserMode();
6451 .faultRead(
EL0, faultRng)
6452 .faultRead(
EL1, faultRng)
6453 .faultRead(
EL2, faultRng)
6454 .faultRead(
EL3, faultRng)
6456 .allPrivileges().writes(0);
6458 .faultRead(
EL0, faultRng)
6459 .faultRead(
EL1, faultRng)
6460 .faultRead(
EL2, faultRng)
6461 .faultRead(
EL3, faultRng)
6463 .allPrivileges().writes(0);
6467 .fault(
EL2, faultFgtCtrlRegs)
6468 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6470 .fault(
EL2, faultFgtCtrlRegs)
6471 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6473 .fault(
EL2, faultFgtCtrlRegs)
6474 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6476 .fault(
EL2, faultFgtCtrlRegs)
6477 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6479 .fault(
EL2, faultFgtCtrlRegs)
6480 .hyp().mon(release->has(ArmExtension::FEAT_FGT));
6486 .allPrivileges().exceptUserMode().writes(0);
6489 .fault(
EL1, faultImpdefUnimplEL1)
6490 .fault(
EL2, faultUnimplemented)
6491 .fault(
EL3, faultUnimplemented)
6492 .warnNotFail(impdefAsNop);
6497 .fault(faultUnimplemented);
6500 .fault(faultUnimplemented);
6503 .fault(faultUnimplemented);
6506 .fault(faultUnimplemented);
6509 .fault(faultUnimplemented);
6512 .fault(faultUnimplemented);
6515 .fault(faultUnimplemented);
6518 .fault(faultUnimplemented);
6521 .fault(faultUnimplemented);
6524 .fault(faultUnimplemented);
6527 .fault(faultUnimplemented);
6531 .reset(
p.mpamidr_el1)
6533 .faultRead(
EL1, faultMpamIdrEL1)
6534 .faultRead(
EL2, faultMpamEL2)
6535 .allPrivileges().exceptUserMode().writes(0);
6538 .fault(
EL1, faultMpam0EL1)
6539 .fault(
EL2, faultMpamEL2)
6540 .priv().hyp().mon();
6543 .fault(
EL1, faultMpam1EL1)
6544 .fault(
EL2, faultMpamEL2)
6545 .priv().hyp().mon();
6548 .fault(
EL2, faultMpam12EL2)
6553 .fault(
EL2, faultMpamEL2)
6557 .fault(
EL2, faultMpamEL2)
6560 .fault(
EL2, faultMpamEL2)
6563 .fault(
EL2, faultMpamEL2)
6566 .fault(
EL2, faultMpamEL2)
6569 .fault(
EL2, faultMpamEL2)
6572 .fault(
EL2, faultMpamEL2)
6575 .fault(
EL2, faultMpamEL2)
6578 .fault(
EL2, faultMpamEL2)
6581 .fault(
EL2, faultMpamEL2)
6585 .fault(
EL2, faultMpamEL2)
6592 .fault(
EL1, faultMpamsmEL1)
6593 .fault(
EL2, faultMpamEL2)
6594 .allPrivileges().exceptUserMode();
6606 assert(idxToMiscRegNum.empty());
6607 for (
const auto& [key,
val] : miscRegNumToIdx) {
6608 idxToMiscRegNum.insert({
val, key});
Fault undefined(bool disabled=false) const
const MiscRegLUTEntryInitializer InitReg(uint32_t reg)
void initializeMiscRegMetadata()
const ArmRelease * release
This could be either a FS or a SE release.
Metadata table accessible via the value of the register.
chain userNonSecureWrite(bool v=true) const
chain userSecureWrite(bool v=true) const
chain exceptUserMode() const
chain warnNotFail(bool v=true) const
chain mapsTo(uint32_t l, uint32_t u=0) const
chain fault(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
chain userSecureRead(bool v=true) const
chain reads(bool v) const
chain highest(ArmSystem *const sys) const
chain secure(bool v=true) const
chain mutex(bool v=true) const
chain raz(uint64_t mask=(uint64_t) -1) const
chain monSecure(bool v=true) const
chain privSecure(bool v=true) const
chain nonSecure(bool v=true) const
chain monNonSecureWrite(bool v=true) const
chain reset(uint64_t res_val) const
chain monNonSecureRead(bool v=true) const
chain unverifiable(bool v=true) const
chain banked(bool v=true) const
chain res0(uint64_t mask) const
chain bankedChild(bool v=true) const
chain hypWrite(bool v=true) const
chain writes(bool v) const
chain allPrivileges(bool v=true) const
chain monSecureRead(bool v=true) const
chain privSecureWrite(bool v=true) const
chain res1(uint64_t mask) const
chain faultRead(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
chain monNonSecure(bool v=true) const
chain monSecureWrite(bool v=true) const
chain mon(bool v=true) const
chain unimplemented() const
chain privNonSecureWrite(bool v=true) const
chain unserialize(bool v=true) const
chain faultWrite(ExceptionLevel el, MiscRegLUTEntry::FaultCB cb) const
chain hyp(bool v=true) const
bool has(ArmExtension ext) const
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8)
ArmISA::ExceptionLevel highestEL() const
Returns the highest implemented exception level.
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
This class is implementing the Base class for a generic AArch64 instruction which is making use of sy...
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual BaseISA * getIsaPtr() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
#define panic(...)
This implements a cprintf based panic() function.
const Params & params() const
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
static CPSR resetCPSR(ArmSystem *system)
int unflattenResultMiscReg[NUM_MISCREGS]
If the reg is a child reg of a banked set, then the parent is the last banked one in the list.
Bitfield< 7, 4 > asidbits
bool AArch32isUndefinedGenericTimer(MiscRegIndex reg, ThreadContext *tc)
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
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.
MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, unsigned crn, unsigned crm, unsigned op2)
MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
Fault checkFaultAccessAArch64SysReg(MiscRegIndex reg, CPSR cpsr, ThreadContext *tc, const MiscRegOp64 &inst)
bool isSecureBelowEL3(ThreadContext *tc)
bool fgtEnabled(ThreadContext *tc)
bool EL2Enabled(ThreadContext *tc)
void preUnflattenMiscReg()
bool isHcrxEL2Enabled(ThreadContext *tc)
@ MISCREG_ID_AA64PFR0_EL1
@ MISCREG_ICC_BPR1_EL1_NS
@ MISCREG_ICC_IGRPEN1_EL1_NS
@ MISCREG_ICC_IGRPEN1_EL3
@ MISCREG_ID_AA64ZFR0_EL1
@ MISCREG_ICC_IGRPEN1_EL1_S
@ MISCREG_TLBI_IPAS2LE1IS
@ MISCREG_TLBI_VMALLS12E1OS
@ MISCREG_ID_AA64DFR0_EL1
@ MISCREG_ICC_AP1R3_EL1_NS
@ MISCREG_ICC_AP1R0_EL1_S
@ MISCREG_ICC_AP1R1_EL1_S
@ MISCREG_ID_AA64DFR1_EL1
@ MISCREG_ID_AA64ISAR1_EL1
@ MISCREG_ID_AA64MMFR1_EL1
@ MISCREG_TLBI_VMALLS12E1
@ MISCREG_ICC_AP1R3_EL1_S
@ MISCREG_TLBI_VMALLS12E1IS
@ MISCREG_ID_AA64MMFR3_EL1
@ MISCREG_CNTHPS_CVAL_EL2
@ MISCREG_CNTHPS_TVAL_EL2
@ MISCREG_ICC_AP1R1_EL1_NS
@ MISCREG_ID_AA64MMFR0_EL1
@ MISCREG_ICC_CTLR_EL1_NS
@ MISCREG_TLBI_RIPAS2E1IS
@ MISCREG_CNTHVS_TVAL_EL2
@ MISCREG_TLBI_RIPAS2LE1IS
@ MISCREG_CNTHVS_CVAL_EL2
@ MISCREG_ID_AA64MMFR2_EL1
@ MISCREG_DBGCLAIMSET_EL1
@ MISCREG_TLBI_RIPAS2E1OS
@ MISCREG_ICC_AP1R0_EL1_NS
@ MISCREG_ICC_AP1R2_EL1_S
@ MISCREG_ICC_IGRPEN0_EL1
@ MISCREG_TLBI_RIPAS2LE1OS
@ MISCREG_ICC_AP1R2_EL1_NS
@ MISCREG_DBGCLAIMCLR_EL1
@ MISCREG_ID_AA64AFR1_EL1
@ MISCREG_ICC_IGRPEN1_EL1
@ MISCREG_TLBI_IPAS2LE1OS
@ MISCREG_ID_AA64AFR0_EL1
@ MISCREG_ID_AA64ISAR0_EL1
@ MISCREG_ID_AA64SMFR0_EL1
@ MISCREG_CONTEXTIDR_EL12
@ MISCREG_DBGAUTHSTATUS_EL1
@ MISCREG_PMXEVTYPER_PMCCFILTR
@ MISCREG_ID_AA64PFR1_EL1
std::optional< MiscRegNum64 > encodeAArch64SysReg(MiscRegIndex misc_reg)
MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
bool condGenericTimerSystemAccessTrapEL1(const MiscRegIndex misc_reg, ThreadContext *tc)
int unflattenMiscReg(int reg)
int snsBankedIndex(MiscRegIndex reg, ThreadContext *tc)
std::tuple< bool, bool > canWriteCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr, ThreadContext *tc)
Check for permission to write coprocessor registers.
bool HaveExt(ThreadContext *tc, ArmExtension ext)
Returns true if the provided ThreadContext supports the ArmExtension passed as a second argument.
int snsBankedIndex64(MiscRegIndex reg, ThreadContext *tc)
MiscRegIndex decodeCP15Reg64(unsigned crm, unsigned opc1)
std::vector< struct MiscRegLUTEntry > lookUpMiscReg(NUM_MISCREGS)
static Fault defaultFaultE2H_EL2(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
std::tuple< bool, bool > canReadCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr, ThreadContext *tc)
Check for permission to read coprocessor registers.
static Fault defaultFaultE2H_EL3(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
constexpr decltype(nullptr) NoFault
static Fault defaultFault(const MiscRegLUTEntry &entry, ThreadContext *tc, const MiscRegOp64 &inst)
std::array< FaultCB, EL3+1 > faultRead
std::bitset< NUM_MISCREG_INFOS > info
std::array< FaultCB, EL3+1 > faultWrite
Fault checkFault(ThreadContext *tc, const MiscRegOp64 &inst, ExceptionLevel el)