331 warn(
"CP14 unimplemented crn[%d], opc1[%d], crm[%d], opc2[%d]",
332 crn, opc1, crm,
opc2);
417 if (crm == 0 &&
opc2 == 0) {
442 }
else if (crm == 1) {
451 }
else if (crm == 3) {
455 }
else if (opc1 == 4) {
461 }
else if (crm == 1) {
480 if (opc1 == 0 && crm == 0) {
489 }
else if (opc1 == 4) {
490 if (crm == 0 &&
opc2 == 2)
492 else if (crm == 1 &&
opc2 == 2)
497 if (opc1 == 0 && crm == 0 &&
opc2 == 0) {
502 if (opc1 == 0 && crm == 6 &&
opc2 == 0) {
511 }
else if (
opc2 == 1) {
514 }
else if (crm == 1) {
517 }
else if (
opc2 == 1) {
521 }
else if (opc1 == 4) {
527 }
else if (crm == 2 &&
opc2 == 0) {
533 if (opc1 == 0 && crm == 0) {
540 }
else if (opc1 == 4 && crm == 0) {
595 }
else if (
opc2 == 2) {
644 }
else if (
opc2 == 2) {
649 }
else if (opc1 == 4 && crm == 8) {
712 }
else if (opc1 == 4) {
720 }
else if (crm == 3) {
731 }
else if (crm == 4) {
738 }
else if (crm == 7) {
812 }
else if (opc1 == 1) {
831 }
else if (crm == 2) {
835 }
else if (
opc2 == 1) {
839 }
else if (crm == 3) {
842 }
else if (
opc2 == 1) {
846 }
else if (opc1 == 4) {
853 }
else if (crm == 3) {
886 }
else if (
opc2 == 1) {
889 }
else if (crm == 1) {
893 }
else if (crm == 8) {
912 }
else if (crm == 9) {
923 }
else if (crm == 11) {
930 }
else if (crm == 12) {
950 }
else if (opc1 == 4) {
951 if (crm == 0 &&
opc2 == 0) {
953 }
else if (crm == 8) {
964 }
else if (crm == 9) {
977 }
else if (crm == 11) {
992 }
else if (crm == 12) {
1011 }
else if (crm == 13) {
1030 }
else if (crm == 14) {
1049 }
else if (crm == 15) {
1069 }
else if (opc1 == 6) {
1098 }
else if (opc1 == 4) {
1099 if (crm == 0 &&
opc2 == 2)
1127 }
else if (opc1 == 4) {
1128 if (crm == 1 &&
opc2 == 0) {
1130 }
else if (crm == 2) {
1205 std::tuple<bool, bool>
1208 bool secure = !scr.ns;
1209 bool canRead =
false;
1210 bool undefined =
false;
1212 switch (cpsr.mode) {
1248 return std::make_tuple(canRead, undefined);
1251 std::tuple<bool, bool>
1254 bool secure = !scr.ns;
1255 bool canWrite =
false;
1256 bool undefined =
false;
1258 switch (cpsr.mode) {
1294 return std::make_tuple(canWrite, undefined);
1303 if (trap_cond && (!
EL2Enabled(tc) || !hcr.tge))
1319 int reg_as_int =
static_cast<int>(
reg);
1332 return isa->snsBankedIndex64(
reg, scr.ns);
1378 if (highest_el ==
EL2 || highest_el ==
EL3)
1383 if (highest_el ==
EL3)
1410 panic(
"Invalid exception level");
1446 panic(
"Invalid exception level");
1452 unsigned crn,
unsigned crm,
3401 static bool completed =
false;
3419 bool LSMAOE =
false;
3422 bool nTLSMD =
false;
3492 .privSecure(!aarch32EL3)
3502 .privSecure(!aarch32EL3)
3674 .allPrivileges().monSecureWrite(0).monNonSecureWrite(0);
3722 .allPrivileges().monSecureWrite(0).monNonSecureWrite(0);
3731 .allPrivileges().monSecureWrite(0).monNonSecureWrite(0);
3734 .allPrivileges().monSecureWrite(0).monNonSecureWrite(0);
3737 .allPrivileges().monSecureWrite(0).monNonSecureWrite(0);
3766 .allPrivileges().exceptUserMode().writes(0);
3809 .privSecure(!aarch32EL3)
3810 .nonSecure().exceptUserMode();
3813 .secure().exceptUserMode();
3815 .
hyp().monNonSecure();
3817 .
hyp().monNonSecure();
3823 .res1(0x00400800 | (SPAN ? 0 : 0x800000)
3824 | (LSMAOE ? 0 : 0x10)
3825 | (nTLSMD ? 0 : 0x8));
3828 .privSecure(!aarch32EL3)
3829 .nonSecure().exceptUserMode();
3832 .secure().exceptUserMode();
3837 .privSecure(!aarch32EL3)
3838 .nonSecure().exceptUserMode();
3841 .secure().exceptUserMode();
3847 .
mon().secure().exceptUserMode()
3853 .
allPrivileges().hypWrite(0).privNonSecureWrite(0).exceptUserMode();
3855 .
hyp().monNonSecure()
3856 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
3857 | (IESB ? 0 : 0x200000)
3858 | (EnDA ? 0 : 0x8000000)
3859 | (EnIB ? 0 : 0x40000000)
3860 | (EnIA ? 0 : 0x80000000))
3863 .
hyp().monNonSecure();
3865 .
hyp().monNonSecure()
3868 .
hyp().monNonSecure()
3871 .
hyp().monNonSecure();
3873 .
hyp().monNonSecure();
3875 .
hyp().monNonSecure();
3879 .hyp().monNonSecure();
3884 .privSecure(!aarch32EL3)
3885 .nonSecure().exceptUserMode();
3888 .secure().exceptUserMode();
3893 .privSecure(!aarch32EL3)
3894 .nonSecure().exceptUserMode();
3897 .secure().exceptUserMode();
3902 .privSecure(!aarch32EL3)
3903 .nonSecure().exceptUserMode();
3906 .secure().exceptUserMode();
3908 .
hyp().monNonSecure();
3910 .
hyp().monNonSecure();
3915 .privSecure(!aarch32EL3)
3916 .nonSecure().exceptUserMode();
3919 .secure().exceptUserMode();
3924 .privSecure(!aarch32EL3)
3925 .nonSecure().exceptUserMode();
3928 .secure().exceptUserMode();
3933 .privSecure(!aarch32EL3)
3934 .nonSecure().exceptUserMode();
3937 .secure().exceptUserMode();
3946 .privSecure(!aarch32EL3)
3947 .nonSecure().exceptUserMode();
3952 .secure().exceptUserMode();
3961 .privSecure(!aarch32EL3)
3962 .nonSecure().exceptUserMode();
3967 .secure().exceptUserMode();
3969 .
hyp().monNonSecure();
3971 .
hyp().monNonSecure();
3973 .
hyp().monNonSecure();
3978 .privSecure(!aarch32EL3)
3979 .nonSecure().exceptUserMode();
3982 .secure().exceptUserMode();
3987 .privSecure(!aarch32EL3)
3988 .nonSecure().exceptUserMode();
3991 .secure().exceptUserMode();
3993 .
hyp().monNonSecure();
3995 .
hyp().monNonSecure();
3997 .
hyp().monNonSecure();
4001 .writes(1).exceptUserMode();
4005 .writes(1).exceptUserMode();
4010 .privSecure(!aarch32EL3)
4011 .nonSecure().exceptUserMode();
4014 .secure().exceptUserMode();
4016 .
writes(1).exceptUserMode();
4020 .writes(1).exceptUserMode();
4026 .writes(1).exceptUserMode();
4030 .writes(1).exceptUserMode();
4034 .writes(1).exceptUserMode();
4038 .writes(1).exceptUserMode();
4040 .
writes(1).exceptUserMode();
4042 .
writes(1).exceptUserMode();
4044 .
writes(1).exceptUserMode();
4046 .
writes(1).exceptUserMode();
4056 .
writes(1).exceptUserMode();
4060 .writes(1).exceptUserMode();
4068 .writes(1).exceptUserMode();
4072 .writes(1).exceptUserMode();
4076 .writes(1).exceptUserMode();
4082 .
writes(1).exceptUserMode();
4084 .
writes(1).exceptUserMode();
4086 .
writes(1).exceptUserMode();
4088 .
writes(1).exceptUserMode();
4090 .
writes(1).exceptUserMode();
4092 .
writes(1).exceptUserMode();
4094 .
writes(1).exceptUserMode();
4096 .
writes(1).exceptUserMode();
4098 .
writes(1).exceptUserMode();
4100 .
writes(1).exceptUserMode();
4102 .
writes(1).exceptUserMode();
4104 .
writes(1).exceptUserMode();
4106 .
writes(1).exceptUserMode();
4108 .
writes(1).exceptUserMode();
4110 .
writes(1).exceptUserMode();
4112 .
writes(1).exceptUserMode();
4114 .
writes(1).exceptUserMode();
4116 .
writes(1).exceptUserMode();
4178 .allPrivileges().exceptUserMode();
4183 .privSecure(!aarch32EL3)
4184 .nonSecure().exceptUserMode();
4187 .secure().exceptUserMode();
4192 .privSecure(!aarch32EL3)
4193 .nonSecure().exceptUserMode();
4196 .secure().exceptUserMode();
4201 .privSecure(!aarch32EL3)
4202 .nonSecure().exceptUserMode();
4205 .secure().exceptUserMode();
4210 .privSecure(!aarch32EL3)
4211 .nonSecure().exceptUserMode();
4214 .secure().exceptUserMode();
4219 .privSecure(!aarch32EL3)
4220 .nonSecure().exceptUserMode();
4223 .secure().exceptUserMode();
4228 .privSecure(!aarch32EL3)
4229 .nonSecure().exceptUserMode();
4232 .secure().exceptUserMode();
4234 .
hyp().monNonSecure();
4236 .
hyp().monNonSecure();
4240 .hyp().monNonSecure();
4244 .hyp().monNonSecure();
4249 .privSecure(!aarch32EL3)
4250 .nonSecure().exceptUserMode();
4253 .secure().exceptUserMode();
4261 .mon().secure().exceptUserMode();
4265 .
hyp().monNonSecure()
4270 .allPrivileges().exceptUserMode();
4275 .privSecure(!aarch32EL3)
4276 .nonSecure().exceptUserMode();
4279 .secure().exceptUserMode();
4285 .privSecure(!aarch32EL3)
4295 .userNonSecureWrite(0).userSecureRead(1)
4296 .privSecure(!aarch32EL3)
4300 .secure().userSecureWrite(0);
4305 .nonSecure().exceptUserMode()
4306 .privSecure(!aarch32EL3);
4309 .secure().exceptUserMode();
4311 .
hyp().monNonSecure();
4316 .privSecureWrite(aarch32EL3);
4328 .privSecure(!aarch32EL3)
4333 .privSecure(aarch32EL3)
4340 .privSecure(!aarch32EL3);
4344 .privSecure(aarch32EL3);
4350 .privSecure(!aarch32EL3);
4354 .privSecure(aarch32EL3);
4386 .allPrivileges().exceptUserMode();
4389 .allPrivileges().exceptUserMode();
4392 .allPrivileges().exceptUserMode();
4395 .allPrivileges().exceptUserMode();
4398 .allPrivileges().exceptUserMode();
4401 .allPrivileges().exceptUserMode();
4404 .allPrivileges().exceptUserMode();
4407 .allPrivileges().exceptUserMode();
4410 .allPrivileges().exceptUserMode();
4413 .writes(1).exceptUserMode();
4416 .allPrivileges().exceptUserMode();
4419 .allPrivileges().exceptUserMode().writes(0);
4421 .
hyp().monNonSecure();
4423 .
hyp().monNonSecure();
4426 .allPrivileges().exceptUserMode();
4430 .allPrivileges().exceptUserMode();
4805 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4806 | (IESB ? 0 : 0x200000)
4807 | (EnDA ? 0 : 0x8000000)
4808 | (EnIB ? 0 : 0x40000000)
4809 | (EnIA ? 0 : 0x80000000))
4810 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4811 | (nTLSMD ? 0 : 0x8000000)
4812 | (LSMAOE ? 0 : 0x10000000))
4816 .res0( 0x20440 | (EnDB ? 0 : 0x2000)
4817 | (IESB ? 0 : 0x200000)
4818 | (EnDA ? 0 : 0x8000000)
4819 | (EnIB ? 0 : 0x40000000)
4820 | (EnIA ? 0 : 0x80000000))
4821 .res1(0x500800 | (SPAN ? 0 : 0x800000)
4822 | (nTLSMD ? 0 : 0x8000000)
4823 | (LSMAOE ? 0 : 0x10000000))
4836 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
4837 | (IESB ? 0 : 0x200000)
4838 | (EnDA ? 0 : 0x8000000)
4839 | (EnIB ? 0 : 0x40000000)
4840 | (EnIA ? 0 : 0x80000000))
4863 .res0(0x0512c7c0 | (EnDB ? 0 : 0x2000)
4864 | (IESB ? 0 : 0x200000)
4865 | (EnDA ? 0 : 0x8000000)
4866 | (EnIB ? 0 : 0x40000000)
4867 | (EnIA ? 0 : 0x80000000))
5032 .writes(1).exceptUserMode();
5038 .writes(1).exceptUserMode();
5041 .writes(1).exceptUserMode();
5044 .writes(1).exceptUserMode();
5046 .
writes(1).exceptUserMode();
5048 .
writes(1).exceptUserMode();
5050 .
writes(1).exceptUserMode();
5052 .
writes(1).exceptUserMode();
5055 .writes(1).exceptUserMode();
5058 .writes(1).exceptUserMode();
5061 .writes(1).userSecureWrite(0);
5078 .
hypWrite().monSecureWrite().monNonSecureWrite();
5080 .
hypWrite().monSecureWrite().monNonSecureWrite();
5082 .
hypWrite().monSecureWrite().monNonSecureWrite();
5084 .
hypWrite().monSecureWrite().monNonSecureWrite();
5090 .
writes(1).exceptUserMode();
5092 .
writes(1).exceptUserMode();
5094 .
writes(1).exceptUserMode();
5096 .
writes(1).exceptUserMode();
5098 .
writes(1).exceptUserMode();
5100 .
writes(1).exceptUserMode();
5102 .
writes(1).exceptUserMode();
5104 .
writes(1).exceptUserMode();
5106 .
writes(1).exceptUserMode();
5108 .
writes(1).exceptUserMode();
5110 .
writes(1).exceptUserMode();
5112 .
writes(1).exceptUserMode();
5114 .
hypWrite().monSecureWrite().monNonSecureWrite();
5116 .
hypWrite().monSecureWrite().monNonSecureWrite();
5122 .
hypWrite().monSecureWrite().monNonSecureWrite();
5126 .
hypWrite().monSecureWrite().monNonSecureWrite();
5128 .
hypWrite().monSecureWrite().monNonSecureWrite();
5130 .
hypWrite().monSecureWrite().monNonSecureWrite();
5136 .
hypWrite().monSecureWrite().monNonSecureWrite();
5140 .
hypWrite().monSecureWrite().monNonSecureWrite();
5241 .
mon().hyp().writes(0);
5272 .privSecureWrite(aarch32EL3)
5284 .res0(0xfffffffffffffff8)
5291 .res0(0xffffffff00000000)
5295 .res0(0xfffffffffffffff8)
5302 .res0(0xffffffff00000000)
5307 .res0(0xfffffffffffffff8)
5316 .res0(0xffffffff00000000)
5321 .res0(0xfffffffffffffff8)
5330 .res0(0xffffffff00000000)
5335 .res0(0xfffffffffffdfc00)
5340 .res0(0xfffffffffffdfc00)
5345 .res0(0xfffffffffffffff8);
5352 .res0(0xffffffff00000000);
5356 .res0(0xfffffffffffc0000)
5361 .res0(0xfffffffffffffff8)
5370 .res0(0xffffffff00000000)
5375 .res0(0xfffffffffffffff8)
5380 .res0(0xfffffffffffffff8)
5385 .res0(0xfffffffffffffff8)
5390 .res0(0xfffffffffffffff8);
5397 .res0(0xffffffff00000000);
5401 .res0(0xfffffffffffffff8)
5406 .res0(0xfffffffffffffff8)
5411 .res0(0xfffffffffffffff8)
5484 .allPrivileges().exceptUserMode();
5493 .allPrivileges().exceptUserMode()
5506 .allPrivileges().exceptUserMode()
5525 .allPrivileges().exceptUserMode()
5529 .allPrivileges().exceptUserMode()
5536 .allPrivileges().exceptUserMode()
5540 .allPrivileges().exceptUserMode()
5547 .allPrivileges().exceptUserMode()
5551 .allPrivileges().exceptUserMode()
5558 .allPrivileges().exceptUserMode()
5562 .allPrivileges().exceptUserMode()
5566 .allPrivileges().exceptUserMode().reads(0)
5585 .allPrivileges().exceptUserMode().reads(0)
5596 .allPrivileges().exceptUserMode()
5601 .secure().exceptUserMode()
5609 .allPrivileges().exceptUserMode()
5614 .secure().exceptUserMode()
5622 .allPrivileges().exceptUserMode()
5627 .secure().exceptUserMode()
5631 .allPrivileges().exceptUserMode()
5639 .allPrivileges().exceptUserMode()
5644 .secure().exceptUserMode()
5693 .
hyp().mon().writes(0)
5696 .
hyp().mon().writes(0)
5699 .
hyp().mon().writes(0)
5702 .
hyp().mon().writes(0)
5709 .allPrivileges().exceptUserMode();
5712 .allPrivileges().exceptUserMode();
5715 .allPrivileges().exceptUserMode();
5718 .allPrivileges().exceptUserMode();
5721 .allPrivileges().exceptUserMode();
5724 .allPrivileges().exceptUserMode();
5727 .allPrivileges().exceptUserMode();
5730 .allPrivileges().exceptUserMode();
5733 .allPrivileges().exceptUserMode();
5736 .allPrivileges().exceptUserMode();
5739 .allPrivileges().exceptUserMode();
5742 .allPrivileges().exceptUserMode();
5745 .allPrivileges().exceptUserMode();
5748 .allPrivileges().exceptUserMode();
5751 .allPrivileges().exceptUserMode();
5754 .allPrivileges().exceptUserMode();
5869 .
hyp().mon().writes(0);
5871 .
hyp().mon().writes(0);
5873 .
hyp().mon().writes(0);
5875 .
hyp().mon().writes(0);