gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
miscregs.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2009 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  * Authors: Gabe Black
41  * Giacomo Gabrielli
42  */
43 #ifndef __ARCH_ARM_MISCREGS_HH__
44 #define __ARCH_ARM_MISCREGS_HH__
45 
46 #include <bitset>
47 #include <tuple>
48 
50 #include "base/compiler.hh"
51 
52 class ThreadContext;
53 
54 
55 namespace ArmISA
56 {
57  enum MiscRegIndex {
73 
74  // Helper registers
90 
91  // AArch32 CP14 registers (debug/trace/ThumbEE/Jazelle control)
137  MISCREG_TEECR, // not in ARM DDI 0487A.b+
139  MISCREG_TEEHBR, // not in ARM DDI 0487A.b+
142 
143  // AArch32 CP15 registers (system control)
385 
386  // AArch64 registers (Op0=2)
425  MISCREG_TEECR32_EL1, // not in ARM DDI 0487A.b+
426  MISCREG_TEEHBR32_EL1, // not in ARM DDI 0487A.b+
427 
428  // AArch64 registers (Op0=1,3)
669 
670  // Introduced in ARMv8.1
675 
677 
678  //PAuth Key Regsiters
689 
690  // GICv3, CPU interface
737 
738  // GICv3, CPU interface, virtualization
769 
812 
859 
906 
907  // SVE
913 
914  // NUM_PHYS_MISCREGS specifies the number of actual physical
915  // registers, not considering the following pseudo-registers
916  // (dummy registers), like UNKNOWN, CP15_UNIMPL, MISCREG_IMPDEF_UNIMPL.
917  // Checkpointing should use this physical index when
918  // saving/restoring register values.
920 
921  // Dummy registers
927 
928  // Implementation defined register: this represent
929  // a pool of unimplemented registers whose access can throw
930  // either UNDEFINED or hypervisor trap exception.
932 
933  // RAS extension (unimplemented)
945 
946  // PSTATE
948 
949  // Total number of Misc Registers: Physical + Dummy
951  };
952 
953  enum MiscRegInfo {
955  MISCREG_UNVERIFIABLE, // Does the value change on every read (e.g. a
956  // arch generic counter)
957  MISCREG_WARN_NOT_FAIL, // If MISCREG_IMPLEMENTED is deasserted, it
958  // tells whether the instruction should raise a
959  // warning or fail
960  MISCREG_MUTEX, // True if the register corresponds to a pair of
961  // mutually exclusive registers
962  MISCREG_BANKED, // True if the register is banked between the two
963  // security states, and this is the parent node of the
964  // two banked registers
965  MISCREG_BANKED64, // True if the register is banked between the two
966  // security states, and this is the parent node of
967  // the two banked registers. Used in AA64 only.
968  MISCREG_BANKED_CHILD, // The entry is one of the child registers that
969  // forms a banked set of regs (along with the
970  // other child regs)
971 
972  // Access permissions
973  // User mode
978  // Privileged modes other than hypervisor or monitor
983  // Hypervisor mode
986  // Hypervisor mode, HCR_EL2.E2H == 1
989  // Monitor mode, SCR.NS == 0
992  // Monitor mode, SCR.NS == 1
995  // Monitor mode, HCR_EL2.E2H == 1
998 
1000  };
1001 
1002  extern std::bitset<NUM_MISCREG_INFOS> miscRegInfo[NUM_MISCREGS];
1003 
1004  // Decodes 32-bit CP14 registers accessible through MCR/MRC instructions
1005  MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1,
1006  unsigned crm, unsigned opc2);
1007  MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1,
1008  unsigned crn, unsigned crm,
1009  unsigned op2);
1010  // Whether a particular AArch64 system register is -always- read only.
1011  bool aarch64SysRegReadOnly(MiscRegIndex miscReg);
1012 
1013  // Decodes 32-bit CP15 registers accessible through MCR/MRC instructions
1014  MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1,
1015  unsigned crm, unsigned opc2);
1016 
1017  // Decodes 64-bit CP15 registers accessible through MCRR/MRRC instructions
1018  MiscRegIndex decodeCP15Reg64(unsigned crm, unsigned opc1);
1019 
1020 
1021  const char * const miscRegName[] = {
1022  "cpsr",
1023  "spsr",
1024  "spsr_fiq",
1025  "spsr_irq",
1026  "spsr_svc",
1027  "spsr_mon",
1028  "spsr_abt",
1029  "spsr_hyp",
1030  "spsr_und",
1031  "elr_hyp",
1032  "fpsid",
1033  "fpscr",
1034  "mvfr1",
1035  "mvfr0",
1036  "fpexc",
1037 
1038  // Helper registers
1039  "cpsr_mode",
1040  "cpsr_q",
1041  "fpscr_exc",
1042  "fpscr_qc",
1043  "lockaddr",
1044  "lockflag",
1045  "prrr_mair0",
1046  "prrr_mair0_ns",
1047  "prrr_mair0_s",
1048  "nmrr_mair1",
1049  "nmrr_mair1_ns",
1050  "nmrr_mair1_s",
1051  "pmxevtyper_pmccfiltr",
1052  "sctlr_rst",
1053  "sev_mailbox",
1054 
1055  // AArch32 CP14 registers
1056  "dbgdidr",
1057  "dbgdscrint",
1058  "dbgdccint",
1059  "dbgdtrtxint",
1060  "dbgdtrrxint",
1061  "dbgwfar",
1062  "dbgvcr",
1063  "dbgdtrrxext",
1064  "dbgdscrext",
1065  "dbgdtrtxext",
1066  "dbgoseccr",
1067  "dbgbvr0",
1068  "dbgbvr1",
1069  "dbgbvr2",
1070  "dbgbvr3",
1071  "dbgbvr4",
1072  "dbgbvr5",
1073  "dbgbcr0",
1074  "dbgbcr1",
1075  "dbgbcr2",
1076  "dbgbcr3",
1077  "dbgbcr4",
1078  "dbgbcr5",
1079  "dbgwvr0",
1080  "dbgwvr1",
1081  "dbgwvr2",
1082  "dbgwvr3",
1083  "dbgwcr0",
1084  "dbgwcr1",
1085  "dbgwcr2",
1086  "dbgwcr3",
1087  "dbgdrar",
1088  "dbgbxvr4",
1089  "dbgbxvr5",
1090  "dbgoslar",
1091  "dbgoslsr",
1092  "dbgosdlr",
1093  "dbgprcr",
1094  "dbgdsar",
1095  "dbgclaimset",
1096  "dbgclaimclr",
1097  "dbgauthstatus",
1098  "dbgdevid2",
1099  "dbgdevid1",
1100  "dbgdevid0",
1101  "teecr",
1102  "jidr",
1103  "teehbr",
1104  "joscr",
1105  "jmcr",
1106 
1107  // AArch32 CP15 registers
1108  "midr",
1109  "ctr",
1110  "tcmtr",
1111  "tlbtr",
1112  "mpidr",
1113  "revidr",
1114  "id_pfr0",
1115  "id_pfr1",
1116  "id_dfr0",
1117  "id_afr0",
1118  "id_mmfr0",
1119  "id_mmfr1",
1120  "id_mmfr2",
1121  "id_mmfr3",
1122  "id_isar0",
1123  "id_isar1",
1124  "id_isar2",
1125  "id_isar3",
1126  "id_isar4",
1127  "id_isar5",
1128  "ccsidr",
1129  "clidr",
1130  "aidr",
1131  "csselr",
1132  "csselr_ns",
1133  "csselr_s",
1134  "vpidr",
1135  "vmpidr",
1136  "sctlr",
1137  "sctlr_ns",
1138  "sctlr_s",
1139  "actlr",
1140  "actlr_ns",
1141  "actlr_s",
1142  "cpacr",
1143  "scr",
1144  "sder",
1145  "nsacr",
1146  "hsctlr",
1147  "hactlr",
1148  "hcr",
1149  "hcr2",
1150  "hdcr",
1151  "hcptr",
1152  "hstr",
1153  "hacr",
1154  "ttbr0",
1155  "ttbr0_ns",
1156  "ttbr0_s",
1157  "ttbr1",
1158  "ttbr1_ns",
1159  "ttbr1_s",
1160  "ttbcr",
1161  "ttbcr_ns",
1162  "ttbcr_s",
1163  "htcr",
1164  "vtcr",
1165  "dacr",
1166  "dacr_ns",
1167  "dacr_s",
1168  "dfsr",
1169  "dfsr_ns",
1170  "dfsr_s",
1171  "ifsr",
1172  "ifsr_ns",
1173  "ifsr_s",
1174  "adfsr",
1175  "adfsr_ns",
1176  "adfsr_s",
1177  "aifsr",
1178  "aifsr_ns",
1179  "aifsr_s",
1180  "hadfsr",
1181  "haifsr",
1182  "hsr",
1183  "dfar",
1184  "dfar_ns",
1185  "dfar_s",
1186  "ifar",
1187  "ifar_ns",
1188  "ifar_s",
1189  "hdfar",
1190  "hifar",
1191  "hpfar",
1192  "icialluis",
1193  "bpiallis",
1194  "par",
1195  "par_ns",
1196  "par_s",
1197  "iciallu",
1198  "icimvau",
1199  "cp15isb",
1200  "bpiall",
1201  "bpimva",
1202  "dcimvac",
1203  "dcisw",
1204  "ats1cpr",
1205  "ats1cpw",
1206  "ats1cur",
1207  "ats1cuw",
1208  "ats12nsopr",
1209  "ats12nsopw",
1210  "ats12nsour",
1211  "ats12nsouw",
1212  "dccmvac",
1213  "dccsw",
1214  "cp15dsb",
1215  "cp15dmb",
1216  "dccmvau",
1217  "dccimvac",
1218  "dccisw",
1219  "ats1hr",
1220  "ats1hw",
1221  "tlbiallis",
1222  "tlbimvais",
1223  "tlbiasidis",
1224  "tlbimvaais",
1225  "tlbimvalis",
1226  "tlbimvaalis",
1227  "itlbiall",
1228  "itlbimva",
1229  "itlbiasid",
1230  "dtlbiall",
1231  "dtlbimva",
1232  "dtlbiasid",
1233  "tlbiall",
1234  "tlbimva",
1235  "tlbiasid",
1236  "tlbimvaa",
1237  "tlbimval",
1238  "tlbimvaal",
1239  "tlbiipas2is",
1240  "tlbiipas2lis",
1241  "tlbiallhis",
1242  "tlbimvahis",
1243  "tlbiallnsnhis",
1244  "tlbimvalhis",
1245  "tlbiipas2",
1246  "tlbiipas2l",
1247  "tlbiallh",
1248  "tlbimvah",
1249  "tlbiallnsnh",
1250  "tlbimvalh",
1251  "pmcr",
1252  "pmcntenset",
1253  "pmcntenclr",
1254  "pmovsr",
1255  "pmswinc",
1256  "pmselr",
1257  "pmceid0",
1258  "pmceid1",
1259  "pmccntr",
1260  "pmxevtyper",
1261  "pmccfiltr",
1262  "pmxevcntr",
1263  "pmuserenr",
1264  "pmintenset",
1265  "pmintenclr",
1266  "pmovsset",
1267  "l2ctlr",
1268  "l2ectlr",
1269  "prrr",
1270  "prrr_ns",
1271  "prrr_s",
1272  "mair0",
1273  "mair0_ns",
1274  "mair0_s",
1275  "nmrr",
1276  "nmrr_ns",
1277  "nmrr_s",
1278  "mair1",
1279  "mair1_ns",
1280  "mair1_s",
1281  "amair0",
1282  "amair0_ns",
1283  "amair0_s",
1284  "amair1",
1285  "amair1_ns",
1286  "amair1_s",
1287  "hmair0",
1288  "hmair1",
1289  "hamair0",
1290  "hamair1",
1291  "vbar",
1292  "vbar_ns",
1293  "vbar_s",
1294  "mvbar",
1295  "rmr",
1296  "isr",
1297  "hvbar",
1298  "fcseidr",
1299  "contextidr",
1300  "contextidr_ns",
1301  "contextidr_s",
1302  "tpidrurw",
1303  "tpidrurw_ns",
1304  "tpidrurw_s",
1305  "tpidruro",
1306  "tpidruro_ns",
1307  "tpidruro_s",
1308  "tpidrprw",
1309  "tpidrprw_ns",
1310  "tpidrprw_s",
1311  "htpidr",
1312  "cntfrq",
1313  "cntkctl",
1314  "cntp_tval",
1315  "cntp_tval_ns",
1316  "cntp_tval_s",
1317  "cntp_ctl",
1318  "cntp_ctl_ns",
1319  "cntp_ctl_s",
1320  "cntv_tval",
1321  "cntv_ctl",
1322  "cnthctl",
1323  "cnthp_tval",
1324  "cnthp_ctl",
1325  "il1data0",
1326  "il1data1",
1327  "il1data2",
1328  "il1data3",
1329  "dl1data0",
1330  "dl1data1",
1331  "dl1data2",
1332  "dl1data3",
1333  "dl1data4",
1334  "ramindex",
1335  "l2actlr",
1336  "cbar",
1337  "httbr",
1338  "vttbr",
1339  "cntpct",
1340  "cntvct",
1341  "cntp_cval",
1342  "cntp_cval_ns",
1343  "cntp_cval_s",
1344  "cntv_cval",
1345  "cntvoff",
1346  "cnthp_cval",
1347  "cpumerrsr",
1348  "l2merrsr",
1349 
1350  // AArch64 registers (Op0=2)
1351  "mdccint_el1",
1352  "osdtrrx_el1",
1353  "mdscr_el1",
1354  "osdtrtx_el1",
1355  "oseccr_el1",
1356  "dbgbvr0_el1",
1357  "dbgbvr1_el1",
1358  "dbgbvr2_el1",
1359  "dbgbvr3_el1",
1360  "dbgbvr4_el1",
1361  "dbgbvr5_el1",
1362  "dbgbcr0_el1",
1363  "dbgbcr1_el1",
1364  "dbgbcr2_el1",
1365  "dbgbcr3_el1",
1366  "dbgbcr4_el1",
1367  "dbgbcr5_el1",
1368  "dbgwvr0_el1",
1369  "dbgwvr1_el1",
1370  "dbgwvr2_el1",
1371  "dbgwvr3_el1",
1372  "dbgwcr0_el1",
1373  "dbgwcr1_el1",
1374  "dbgwcr2_el1",
1375  "dbgwcr3_el1",
1376  "mdccsr_el0",
1377  "mddtr_el0",
1378  "mddtrtx_el0",
1379  "mddtrrx_el0",
1380  "dbgvcr32_el2",
1381  "mdrar_el1",
1382  "oslar_el1",
1383  "oslsr_el1",
1384  "osdlr_el1",
1385  "dbgprcr_el1",
1386  "dbgclaimset_el1",
1387  "dbgclaimclr_el1",
1388  "dbgauthstatus_el1",
1389  "teecr32_el1",
1390  "teehbr32_el1",
1391 
1392  // AArch64 registers (Op0=1,3)
1393  "midr_el1",
1394  "mpidr_el1",
1395  "revidr_el1",
1396  "id_pfr0_el1",
1397  "id_pfr1_el1",
1398  "id_dfr0_el1",
1399  "id_afr0_el1",
1400  "id_mmfr0_el1",
1401  "id_mmfr1_el1",
1402  "id_mmfr2_el1",
1403  "id_mmfr3_el1",
1404  "id_isar0_el1",
1405  "id_isar1_el1",
1406  "id_isar2_el1",
1407  "id_isar3_el1",
1408  "id_isar4_el1",
1409  "id_isar5_el1",
1410  "mvfr0_el1",
1411  "mvfr1_el1",
1412  "mvfr2_el1",
1413  "id_aa64pfr0_el1",
1414  "id_aa64pfr1_el1",
1415  "id_aa64dfr0_el1",
1416  "id_aa64dfr1_el1",
1417  "id_aa64afr0_el1",
1418  "id_aa64afr1_el1",
1419  "id_aa64isar0_el1",
1420  "id_aa64isar1_el1",
1421  "id_aa64mmfr0_el1",
1422  "id_aa64mmfr1_el1",
1423  "ccsidr_el1",
1424  "clidr_el1",
1425  "aidr_el1",
1426  "csselr_el1",
1427  "ctr_el0",
1428  "dczid_el0",
1429  "vpidr_el2",
1430  "vmpidr_el2",
1431  "sctlr_el1",
1432  "actlr_el1",
1433  "cpacr_el1",
1434  "sctlr_el2",
1435  "actlr_el2",
1436  "hcr_el2",
1437  "mdcr_el2",
1438  "cptr_el2",
1439  "hstr_el2",
1440  "hacr_el2",
1441  "sctlr_el3",
1442  "actlr_el3",
1443  "scr_el3",
1444  "sder32_el3",
1445  "cptr_el3",
1446  "mdcr_el3",
1447  "ttbr0_el1",
1448  "ttbr1_el1",
1449  "tcr_el1",
1450  "ttbr0_el2",
1451  "tcr_el2",
1452  "vttbr_el2",
1453  "vtcr_el2",
1454  "ttbr0_el3",
1455  "tcr_el3",
1456  "dacr32_el2",
1457  "spsr_el1",
1458  "elr_el1",
1459  "sp_el0",
1460  "spsel",
1461  "currentel",
1462  "nzcv",
1463  "daif",
1464  "fpcr",
1465  "fpsr",
1466  "dspsr_el0",
1467  "dlr_el0",
1468  "spsr_el2",
1469  "elr_el2",
1470  "sp_el1",
1471  "spsr_irq_aa64",
1472  "spsr_abt_aa64",
1473  "spsr_und_aa64",
1474  "spsr_fiq_aa64",
1475  "spsr_el3",
1476  "elr_el3",
1477  "sp_el2",
1478  "afsr0_el1",
1479  "afsr1_el1",
1480  "esr_el1",
1481  "ifsr32_el2",
1482  "afsr0_el2",
1483  "afsr1_el2",
1484  "esr_el2",
1485  "fpexc32_el2",
1486  "afsr0_el3",
1487  "afsr1_el3",
1488  "esr_el3",
1489  "far_el1",
1490  "far_el2",
1491  "hpfar_el2",
1492  "far_el3",
1493  "ic_ialluis",
1494  "par_el1",
1495  "ic_iallu",
1496  "dc_ivac_xt",
1497  "dc_isw_xt",
1498  "at_s1e1r_xt",
1499  "at_s1e1w_xt",
1500  "at_s1e0r_xt",
1501  "at_s1e0w_xt",
1502  "dc_csw_xt",
1503  "dc_cisw_xt",
1504  "dc_zva_xt",
1505  "ic_ivau_xt",
1506  "dc_cvac_xt",
1507  "dc_cvau_xt",
1508  "dc_civac_xt",
1509  "at_s1e2r_xt",
1510  "at_s1e2w_xt",
1511  "at_s12e1r_xt",
1512  "at_s12e1w_xt",
1513  "at_s12e0r_xt",
1514  "at_s12e0w_xt",
1515  "at_s1e3r_xt",
1516  "at_s1e3w_xt",
1517  "tlbi_vmalle1is",
1518  "tlbi_vae1is_xt",
1519  "tlbi_aside1is_xt",
1520  "tlbi_vaae1is_xt",
1521  "tlbi_vale1is_xt",
1522  "tlbi_vaale1is_xt",
1523  "tlbi_vmalle1",
1524  "tlbi_vae1_xt",
1525  "tlbi_aside1_xt",
1526  "tlbi_vaae1_xt",
1527  "tlbi_vale1_xt",
1528  "tlbi_vaale1_xt",
1529  "tlbi_ipas2e1is_xt",
1530  "tlbi_ipas2le1is_xt",
1531  "tlbi_alle2is",
1532  "tlbi_vae2is_xt",
1533  "tlbi_alle1is",
1534  "tlbi_vale2is_xt",
1535  "tlbi_vmalls12e1is",
1536  "tlbi_ipas2e1_xt",
1537  "tlbi_ipas2le1_xt",
1538  "tlbi_alle2",
1539  "tlbi_vae2_xt",
1540  "tlbi_alle1",
1541  "tlbi_vale2_xt",
1542  "tlbi_vmalls12e1",
1543  "tlbi_alle3is",
1544  "tlbi_vae3is_xt",
1545  "tlbi_vale3is_xt",
1546  "tlbi_alle3",
1547  "tlbi_vae3_xt",
1548  "tlbi_vale3_xt",
1549  "pmintenset_el1",
1550  "pmintenclr_el1",
1551  "pmcr_el0",
1552  "pmcntenset_el0",
1553  "pmcntenclr_el0",
1554  "pmovsclr_el0",
1555  "pmswinc_el0",
1556  "pmselr_el0",
1557  "pmceid0_el0",
1558  "pmceid1_el0",
1559  "pmccntr_el0",
1560  "pmxevtyper_el0",
1561  "pmccfiltr_el0",
1562  "pmxevcntr_el0",
1563  "pmuserenr_el0",
1564  "pmovsset_el0",
1565  "mair_el1",
1566  "amair_el1",
1567  "mair_el2",
1568  "amair_el2",
1569  "mair_el3",
1570  "amair_el3",
1571  "l2ctlr_el1",
1572  "l2ectlr_el1",
1573  "vbar_el1",
1574  "rvbar_el1",
1575  "isr_el1",
1576  "vbar_el2",
1577  "rvbar_el2",
1578  "vbar_el3",
1579  "rvbar_el3",
1580  "rmr_el3",
1581  "contextidr_el1",
1582  "tpidr_el1",
1583  "tpidr_el0",
1584  "tpidrro_el0",
1585  "tpidr_el2",
1586  "tpidr_el3",
1587  "cntkctl_el1",
1588  "cntfrq_el0",
1589  "cntpct_el0",
1590  "cntvct_el0",
1591  "cntp_tval_el0",
1592  "cntp_ctl_el0",
1593  "cntp_cval_el0",
1594  "cntv_tval_el0",
1595  "cntv_ctl_el0",
1596  "cntv_cval_el0",
1597  "pmevcntr0_el0",
1598  "pmevcntr1_el0",
1599  "pmevcntr2_el0",
1600  "pmevcntr3_el0",
1601  "pmevcntr4_el0",
1602  "pmevcntr5_el0",
1603  "pmevtyper0_el0",
1604  "pmevtyper1_el0",
1605  "pmevtyper2_el0",
1606  "pmevtyper3_el0",
1607  "pmevtyper4_el0",
1608  "pmevtyper5_el0",
1609  "cntvoff_el2",
1610  "cnthctl_el2",
1611  "cnthp_tval_el2",
1612  "cnthp_ctl_el2",
1613  "cnthp_cval_el2",
1614  "cntps_tval_el1",
1615  "cntps_ctl_el1",
1616  "cntps_cval_el1",
1617  "il1data0_el1",
1618  "il1data1_el1",
1619  "il1data2_el1",
1620  "il1data3_el1",
1621  "dl1data0_el1",
1622  "dl1data1_el1",
1623  "dl1data2_el1",
1624  "dl1data3_el1",
1625  "dl1data4_el1",
1626  "l2actlr_el1",
1627  "cpuactlr_el1",
1628  "cpuectlr_el1",
1629  "cpumerrsr_el1",
1630  "l2merrsr_el1",
1631  "cbar_el1",
1632  "contextidr_el2",
1633 
1634  "ttbr1_el2",
1635  "cnthv_ctl_el2",
1636  "cnthv_cval_el2",
1637  "cnthv_tval_el2",
1638  "id_aa64mmfr2_el1",
1639 
1640  "apdakeyhi_el1",
1641  "apdakeylo_el1",
1642  "apdbkeyhi_el1",
1643  "apdbkeylo_el1",
1644  "apgakeyhi_el1",
1645  "apgakeylo_el1",
1646  "apiakeyhi_el1",
1647  "apiakeylo_el1",
1648  "apibkeyhi_el1",
1649  "apibkeylo_el1",
1650  // GICv3, CPU interface
1651  "icc_pmr_el1",
1652  "icc_iar0_el1",
1653  "icc_eoir0_el1",
1654  "icc_hppir0_el1",
1655  "icc_bpr0_el1",
1656  "icc_ap0r0_el1",
1657  "icc_ap0r1_el1",
1658  "icc_ap0r2_el1",
1659  "icc_ap0r3_el1",
1660  "icc_ap1r0_el1",
1661  "icc_ap1r0_el1_ns",
1662  "icc_ap1r0_el1_s",
1663  "icc_ap1r1_el1",
1664  "icc_ap1r1_el1_ns",
1665  "icc_ap1r1_el1_s",
1666  "icc_ap1r2_el1",
1667  "icc_ap1r2_el1_ns",
1668  "icc_ap1r2_el1_s",
1669  "icc_ap1r3_el1",
1670  "icc_ap1r3_el1_ns",
1671  "icc_ap1r3_el1_s",
1672  "icc_dir_el1",
1673  "icc_rpr_el1",
1674  "icc_sgi1r_el1",
1675  "icc_asgi1r_el1",
1676  "icc_sgi0r_el1",
1677  "icc_iar1_el1",
1678  "icc_eoir1_el1",
1679  "icc_hppir1_el1",
1680  "icc_bpr1_el1",
1681  "icc_bpr1_el1_ns",
1682  "icc_bpr1_el1_s",
1683  "icc_ctlr_el1",
1684  "icc_ctlr_el1_ns",
1685  "icc_ctlr_el1_s",
1686  "icc_sre_el1",
1687  "icc_sre_el1_ns",
1688  "icc_sre_el1_s",
1689  "icc_igrpen0_el1",
1690  "icc_igrpen1_el1",
1691  "icc_igrpen1_el1_ns",
1692  "icc_igrpen1_el1_s",
1693  "icc_sre_el2",
1694  "icc_ctlr_el3",
1695  "icc_sre_el3",
1696  "icc_igrpen1_el3",
1697 
1698  // GICv3, CPU interface, virtualization
1699  "ich_ap0r0_el2",
1700  "ich_ap0r1_el2",
1701  "ich_ap0r2_el2",
1702  "ich_ap0r3_el2",
1703  "ich_ap1r0_el2",
1704  "ich_ap1r1_el2",
1705  "ich_ap1r2_el2",
1706  "ich_ap1r3_el2",
1707  "ich_hcr_el2",
1708  "ich_vtr_el2",
1709  "ich_misr_el2",
1710  "ich_eisr_el2",
1711  "ich_elrsr_el2",
1712  "ich_vmcr_el2",
1713  "ich_lr0_el2",
1714  "ich_lr1_el2",
1715  "ich_lr2_el2",
1716  "ich_lr3_el2",
1717  "ich_lr4_el2",
1718  "ich_lr5_el2",
1719  "ich_lr6_el2",
1720  "ich_lr7_el2",
1721  "ich_lr8_el2",
1722  "ich_lr9_el2",
1723  "ich_lr10_el2",
1724  "ich_lr11_el2",
1725  "ich_lr12_el2",
1726  "ich_lr13_el2",
1727  "ich_lr14_el2",
1728  "ich_lr15_el2",
1729 
1730  "icv_pmr_el1",
1731  "icv_iar0_el1",
1732  "icv_eoir0_el1",
1733  "icv_hppir0_el1",
1734  "icv_bpr0_el1",
1735  "icv_ap0r0_el1",
1736  "icv_ap0r1_el1",
1737  "icv_ap0r2_el1",
1738  "icv_ap0r3_el1",
1739  "icv_ap1r0_el1",
1740  "icv_ap1r0_el1_ns",
1741  "icv_ap1r0_el1_s",
1742  "icv_ap1r1_el1",
1743  "icv_ap1r1_el1_ns",
1744  "icv_ap1r1_el1_s",
1745  "icv_ap1r2_el1",
1746  "icv_ap1r2_el1_ns",
1747  "icv_ap1r2_el1_s",
1748  "icv_ap1r3_el1",
1749  "icv_ap1r3_el1_ns",
1750  "icv_ap1r3_el1_s",
1751  "icv_dir_el1",
1752  "icv_rpr_el1",
1753  "icv_sgi1r_el1",
1754  "icv_asgi1r_el1",
1755  "icv_sgi0r_el1",
1756  "icv_iar1_el1",
1757  "icv_eoir1_el1",
1758  "icv_hppir1_el1",
1759  "icv_bpr1_el1",
1760  "icv_bpr1_el1_ns",
1761  "icv_bpr1_el1_s",
1762  "icv_ctlr_el1",
1763  "icv_ctlr_el1_ns",
1764  "icv_ctlr_el1_s",
1765  "icv_sre_el1",
1766  "icv_sre_el1_ns",
1767  "icv_sre_el1_s",
1768  "icv_igrpen0_el1",
1769  "icv_igrpen1_el1",
1770  "icv_igrpen1_el1_ns",
1771  "icv_igrpen1_el1_s",
1772 
1773  "icc_ap0r0",
1774  "icc_ap0r1",
1775  "icc_ap0r2",
1776  "icc_ap0r3",
1777  "icc_ap1r0",
1778  "icc_ap1r0_ns",
1779  "icc_ap1r0_s",
1780  "icc_ap1r1",
1781  "icc_ap1r1_ns",
1782  "icc_ap1r1_s",
1783  "icc_ap1r2",
1784  "icc_ap1r2_ns",
1785  "icc_ap1r2_s",
1786  "icc_ap1r3",
1787  "icc_ap1r3_ns",
1788  "icc_ap1r3_s",
1789  "icc_asgi1r",
1790  "icc_bpr0",
1791  "icc_bpr1",
1792  "icc_bpr1_ns",
1793  "icc_bpr1_s",
1794  "icc_ctlr",
1795  "icc_ctlr_ns",
1796  "icc_ctlr_s",
1797  "icc_dir",
1798  "icc_eoir0",
1799  "icc_eoir1",
1800  "icc_hppir0",
1801  "icc_hppir1",
1802  "icc_hsre",
1803  "icc_iar0",
1804  "icc_iar1",
1805  "icc_igrpen0",
1806  "icc_igrpen1",
1807  "icc_igrpen1_ns",
1808  "icc_igrpen1_s",
1809  "icc_mctlr",
1810  "icc_mgrpen1",
1811  "icc_msre",
1812  "icc_pmr",
1813  "icc_rpr",
1814  "icc_sgi0r",
1815  "icc_sgi1r",
1816  "icc_sre",
1817  "icc_sre_ns",
1818  "icc_sre_s",
1819 
1820  "ich_ap0r0",
1821  "ich_ap0r1",
1822  "ich_ap0r2",
1823  "ich_ap0r3",
1824  "ich_ap1r0",
1825  "ich_ap1r1",
1826  "ich_ap1r2",
1827  "ich_ap1r3",
1828  "ich_hcr",
1829  "ich_vtr",
1830  "ich_misr",
1831  "ich_eisr",
1832  "ich_elrsr",
1833  "ich_vmcr",
1834  "ich_lr0",
1835  "ich_lr1",
1836  "ich_lr2",
1837  "ich_lr3",
1838  "ich_lr4",
1839  "ich_lr5",
1840  "ich_lr6",
1841  "ich_lr7",
1842  "ich_lr8",
1843  "ich_lr9",
1844  "ich_lr10",
1845  "ich_lr11",
1846  "ich_lr12",
1847  "ich_lr13",
1848  "ich_lr14",
1849  "ich_lr15",
1850  "ich_lrc0",
1851  "ich_lrc1",
1852  "ich_lrc2",
1853  "ich_lrc3",
1854  "ich_lrc4",
1855  "ich_lrc5",
1856  "ich_lrc6",
1857  "ich_lrc7",
1858  "ich_lrc8",
1859  "ich_lrc9",
1860  "ich_lrc10",
1861  "ich_lrc11",
1862  "ich_lrc12",
1863  "ich_lrc13",
1864  "ich_lrc14",
1865  "ich_lrc15",
1866 
1867  "id_aa64zfr0_el1",
1868  "zcr_el3",
1869  "zcr_el2",
1870  "zcr_el12",
1871  "zcr_el1",
1872 
1873  "num_phys_regs",
1874 
1875  // Dummy registers
1876  "nop",
1877  "raz",
1878  "cp14_unimpl",
1879  "cp15_unimpl",
1880  "unknown",
1881  "impl_defined",
1882  "erridr_el1",
1883  "errselr_el1",
1884  "erxfr_el1",
1885  "erxctlr_el1",
1886  "erxstatus_el1",
1887  "erxaddr_el1",
1888  "erxmisc0_el1",
1889  "erxmisc1_el1",
1890  "disr_el1",
1891  "vsesr_el2",
1892  "vdisr_el2",
1893 
1894  // PSTATE
1895  "pan",
1896  };
1897 
1898  static_assert(sizeof(miscRegName) / sizeof(*miscRegName) == NUM_MISCREGS,
1899  "The miscRegName array and NUM_MISCREGS are inconsistent.");
1900 
1901  // This mask selects bits of the CPSR that actually go in the CondCodes
1902  // integer register to allow renaming.
1903  static const uint32_t CondCodesMask = 0xF00F0000;
1904  static const uint32_t CpsrMaskQ = 0x08000000;
1905 
1906  // APSR (Application Program Status Register Mask). It is the user level
1907  // alias for the CPSR. The APSR is a subset of the CPSR. Although
1908  // bits[15:0] are UNKNOWN on reads, it is permitted that, on a read of
1909  // APSR:
1910  // Bit[9] returns the value of CPSR.E.
1911  // Bits[8:6] return the value of CPSR.{A,I, F}, the mask bits.
1912  static const uint32_t ApsrMask = CpsrMaskQ | CondCodesMask | 0x000001D0;
1913 
1914  // CPSR (Current Program Status Register Mask).
1915  static const uint32_t CpsrMask = ApsrMask | 0x00F003DF;
1916 
1917  // This mask selects bits of the FPSCR that actually go in the FpCondCodes
1918  // integer register to allow renaming.
1919  static const uint32_t FpCondCodesMask = 0xF0000000;
1920  // This mask selects the cumulative FP exception flags of the FPSCR.
1921  static const uint32_t FpscrExcMask = 0x0000009F;
1922  // This mask selects the cumulative saturation flag of the FPSCR.
1923  static const uint32_t FpscrQcMask = 0x08000000;
1924 
1938  std::tuple<bool, bool> canReadCoprocReg(MiscRegIndex reg, SCR scr,
1939  CPSR cpsr);
1940 
1954  std::tuple<bool, bool> canWriteCoprocReg(MiscRegIndex reg, SCR scr,
1955  CPSR cpsr);
1956 
1957  // Checks read access permissions to AArch64 system registers
1958  bool canReadAArch64SysReg(MiscRegIndex reg, HCR hcr, SCR scr, CPSR cpsr,
1959  ThreadContext *tc);
1960 
1961  // Checks write access permissions to AArch64 system registers
1962  bool canWriteAArch64SysReg(MiscRegIndex reg, HCR hcr, SCR scr, CPSR cpsr,
1963  ThreadContext *tc);
1964 
1965  // Uses just the scr.ns bit to pre flatten the misc regs. This is useful
1966  // for MCR/MRC instructions
1967  int
1969 
1970  // Flattens a misc reg index using the specified security state. This is
1971  // used for opperations (eg address translations) where the security
1972  // state of the register access may differ from the current state of the
1973  // processor
1974  int
1976 
1977  int
1979 
1980  // Takes a misc reg index and returns the root reg if its one of a set of
1981  // banked registers
1982  void
1984 
1985  int
1986  unflattenMiscReg(int reg);
1987 
1988 }
1989 
1990 #endif // __ARCH_ARM_MISCREGS_HH__
int snsBankedIndex64(MiscRegIndex reg, ThreadContext *tc)
Definition: miscregs.cc:1081
MiscRegIndex
Definition: miscregs.hh:57
bitset< NUM_MISCREG_INFOS > miscRegInfo[NUM_MISCREGS]
Definition: miscregs.cc:2888
Bitfield< 5, 3 > reg
Definition: types.hh:89
void preUnflattenMiscReg()
Definition: miscregs.cc:1099
Definition: ccregs.hh:42
const char *const miscRegName[]
Definition: miscregs.hh:1021
ThreadContext is the external interface to all thread state for anything outside of the CPU...
MiscRegIndex decodeCP15Reg64(unsigned crm, unsigned opc1)
Definition: miscregs.cc:932
Bitfield< 0 > ns
static const uint32_t CpsrMask
Definition: miscregs.hh:1915
int unflattenMiscReg(int reg)
Definition: miscregs.cc:1115
MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, unsigned crn, unsigned crm, unsigned op2)
Definition: miscregs.cc:1211
static const uint32_t ApsrMask
Definition: miscregs.hh:1912
static const uint32_t CpsrMaskQ
Definition: miscregs.hh:1904
bool canReadAArch64SysReg(MiscRegIndex reg, HCR hcr, SCR scr, CPSR cpsr, ThreadContext *tc)
Definition: miscregs.cc:1121
std::tuple< bool, bool > canReadCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr)
Check for permission to read coprocessor registers.
Definition: miscregs.cc:991
MiscRegInfo
Definition: miscregs.hh:953
std::tuple< bool, bool > canWriteCoprocReg(MiscRegIndex reg, SCR scr, CPSR cpsr)
Check for permission to write coprocessor registers.
Definition: miscregs.cc:1027
static const uint32_t CondCodesMask
Definition: miscregs.hh:1903
int snsBankedIndex(MiscRegIndex reg, ThreadContext *tc)
Definition: miscregs.cc:1063
Bitfield< 7, 5 > opc2
Definition: types.hh:116
bool aarch64SysRegReadOnly(MiscRegIndex miscReg)
static const uint32_t FpscrExcMask
Definition: miscregs.hh:1921
MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
Definition: miscregs.cc:132
MiscRegIndex decodeCP14Reg(unsigned crn, unsigned opc1, unsigned crm, unsigned opc2)
Definition: miscregs.cc:55
static const uint32_t FpCondCodesMask
Definition: miscregs.hh:1919
static const uint32_t FpscrQcMask
Definition: miscregs.hh:1923
bool canWriteAArch64SysReg(MiscRegIndex reg, HCR hcr, SCR scr, CPSR cpsr, ThreadContext *tc)
Definition: miscregs.cc:1163

Generated on Fri Feb 28 2020 16:26:57 for gem5 by doxygen 1.8.13