Changeset 108924 in vbox for trunk/src/VBox/VMM/testcase
- Timestamp:
- Apr 10, 2025 9:11:29 AM (4 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168430
- Location:
- trunk/src/VBox/VMM/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstPGMAllGst-armv8.cpp
r108920 r108924 235 235 else 236 236 RTTestIFailed("Fatal error: RTTlsSet failed, rc=%Rrc\n", rc); 237 238 return rc; 239 } 240 241 242 static int tstMmuCfgReadS64(RTTEST hTest, RTJSONVAL hObj, const char *pszName, int64_t *pi64Result) 243 { 244 int rc = RTJsonValueQueryIntegerByName(hObj, pszName, pi64Result); 245 if (RT_FAILURE(rc)) 246 RTTestFailed(hTest, "Failed to query \"%s\" with %Rrc", pszName, rc); 247 248 return rc; 249 } 250 251 252 static int tstMmuCfgReadS32(RTTEST hTest, RTJSONVAL hObj, const char *pszName, int32_t *pi32Result) 253 { 254 int64_t i64 = 0; 255 int rc = tstMmuCfgReadS64(hTest, hObj, pszName, &i64); 256 if (RT_SUCCESS(rc)) 257 { 258 if (i64 >= INT32_MIN && i64 <= INT32_MAX) 259 *pi32Result = (int32_t)i64; 260 else 261 RTTestFailed(hTest, "%RI64 for '%s' is out of range for a 32-bit signed integer", i64, pszName); 262 } 237 263 238 264 return rc; … … 964 990 965 991 966 static int tstResultQueryPageFastInit(RTTEST hTest, RTJSONVAL hMemResult, PPGMPTWALKFAST pWalkResult) 967 { 968 int rc = tstResultQueryGCPhys(hTest, hMemResult, "GCPhys", &pWalkResult->GCPhys); 992 static int tstResultQueryPageFastInit(RTTEST hTest, RTJSONVAL hMemResult, PPGMPTWALKFAST pWalkResult, int *prc) 993 { 994 int rc = tstMmuCfgReadS32(hTest, hMemResult, "rc", prc); 995 if (RT_SUCCESS(rc)) 996 rc = tstResultQueryGCPhys(hTest, hMemResult, "GCPhys", &pWalkResult->GCPhys); 969 997 if (RT_SUCCESS(rc)) 970 998 rc = tstResultQueryGCPhysDef(hTest, hMemResult, "GCPhysNested", &pWalkResult->GCPhysNested, 0); … … 1042 1070 static void tstExecuteQueryPageFast(RTTEST hTest, PVM pVM, RTGCPTR GCPtr, uint32_t fFlags, RTJSONVAL hMemResult) 1043 1071 { 1044 PVMCPUCC pVCpu = pVM->apCpusR3[0]; 1045 1046 /** @todo Incorporate EL (for nested virt and EL3 later on). */ 1047 uintptr_t idx = (GCPtr & RT_BIT_64(55)) 1048 ? pVCpu->pgm.s.aidxGuestModeDataTtbr1[1] 1049 : pVCpu->pgm.s.aidxGuestModeDataTtbr0[1]; 1050 1051 PGMPTWALKFAST Walk; PGMPTWALKFAST_ZERO(&Walk); 1052 AssertReleaseReturnVoid(idx < RT_ELEMENTS(g_aPgmGuestModeData)); 1053 AssertReleaseReturnVoid(g_aPgmGuestModeData[idx].pfnQueryPageFast); 1054 int rc = g_aPgmGuestModeData[idx].pfnQueryPageFast(pVCpu, GCPtr, fFlags, &Walk); 1055 if (RT_SUCCESS(rc)) 1056 { 1057 PGMPTWALKFAST WalkResult; PGMPTWALKFAST_ZERO(&WalkResult); 1058 WalkResult.GCPtr = GCPtr; 1059 1060 rc = tstResultQueryPageFastInit(hTest, hMemResult, &WalkResult); 1061 if (RT_SUCCESS(rc)) 1062 { 1063 if (memcmp(&Walk, &WalkResult, sizeof(Walk))) 1064 { 1065 if (Walk.GCPtr != WalkResult.GCPtr) 1066 RTTestFailed(hTest, "Result GCPtr=%RGv != Expected GCPtr=%RGv", Walk.GCPtr, WalkResult.GCPtr); 1067 if (Walk.GCPhys != WalkResult.GCPhys) 1068 RTTestFailed(hTest, "Result GCPhys=%RGp != Expected GCPhys=%RGp", Walk.GCPhys, WalkResult.GCPhys); 1069 if (Walk.GCPhysNested != WalkResult.GCPhysNested) 1070 RTTestFailed(hTest, "Result GCPhysNested=%RGp != Expected GCPhysNested=%RGp", Walk.GCPhysNested, WalkResult.GCPhysNested); 1071 if (Walk.fInfo != WalkResult.fInfo) 1072 RTTestFailed(hTest, "Result fInfo=%#RX32 != Expected fInfo=%#RX32", Walk.fInfo, WalkResult.fInfo); 1073 if (Walk.fFailed != WalkResult.fFailed) 1074 RTTestFailed(hTest, "Result fFailed=%#RX32 != Expected fFailed=%#RX32", Walk.fFailed, WalkResult.fFailed); 1075 if (Walk.fEffective != WalkResult.fEffective) 1076 RTTestFailed(hTest, "Result fEffective=%#RX64 != Expected fEffective=%#RX64", Walk.fEffective, WalkResult.fEffective); 1077 } 1078 } 1079 } 1080 else 1081 RTTestFailed(hTest, "Resolving virtual address %#RX64 to physical address failed with %Rrc", GCPtr, rc); 1072 int rcExpected = VINF_SUCCESS; 1073 PGMPTWALKFAST WalkResult; PGMPTWALKFAST_ZERO(&WalkResult); 1074 WalkResult.GCPtr = GCPtr; 1075 1076 int rc = tstResultQueryPageFastInit(hTest, hMemResult, &WalkResult, &rcExpected); 1077 if (RT_SUCCESS(rc)) 1078 { 1079 PVMCPUCC pVCpu = pVM->apCpusR3[0]; 1080 1081 /** @todo Incorporate EL (for nested virt and EL3 later on). */ 1082 uintptr_t idx = (GCPtr & RT_BIT_64(55)) 1083 ? pVCpu->pgm.s.aidxGuestModeDataTtbr1[1] 1084 : pVCpu->pgm.s.aidxGuestModeDataTtbr0[1]; 1085 1086 PGMPTWALKFAST Walk; PGMPTWALKFAST_ZERO(&Walk); 1087 AssertReleaseReturnVoid(idx < RT_ELEMENTS(g_aPgmGuestModeData)); 1088 AssertReleaseReturnVoid(g_aPgmGuestModeData[idx].pfnQueryPageFast); 1089 rc = g_aPgmGuestModeData[idx].pfnQueryPageFast(pVCpu, GCPtr, fFlags, &Walk); 1090 if (rc != rcExpected) 1091 RTTestFailed(hTest, "Result rc=%Rrc != Expected rc=%Rrc", rc, rcExpected); 1092 1093 if (memcmp(&Walk, &WalkResult, sizeof(Walk))) 1094 { 1095 if (Walk.GCPtr != WalkResult.GCPtr) 1096 RTTestFailed(hTest, "Result GCPtr=%RGv != Expected GCPtr=%RGv", Walk.GCPtr, WalkResult.GCPtr); 1097 if (Walk.GCPhys != WalkResult.GCPhys) 1098 RTTestFailed(hTest, "Result GCPhys=%RGp != Expected GCPhys=%RGp", Walk.GCPhys, WalkResult.GCPhys); 1099 if (Walk.GCPhysNested != WalkResult.GCPhysNested) 1100 RTTestFailed(hTest, "Result GCPhysNested=%RGp != Expected GCPhysNested=%RGp", Walk.GCPhysNested, WalkResult.GCPhysNested); 1101 if (Walk.fInfo != WalkResult.fInfo) 1102 RTTestFailed(hTest, "Result fInfo=%#RX32 != Expected fInfo=%#RX32", Walk.fInfo, WalkResult.fInfo); 1103 if (Walk.fFailed != WalkResult.fFailed) 1104 RTTestFailed(hTest, "Result fFailed=%#RX32 != Expected fFailed=%#RX32", Walk.fFailed, WalkResult.fFailed); 1105 if (Walk.fEffective != WalkResult.fEffective) 1106 RTTestFailed(hTest, "Result fEffective=%#RX64 != Expected fEffective=%#RX64", Walk.fEffective, WalkResult.fEffective); 1107 } 1108 } 1082 1109 } 1083 1110 -
trunk/src/VBox/VMM/testcase/tstPGMAllGst-armv8.json
r108923 r108924 66 66 GCPtr: 0x0, 67 67 Flags: { READ: 1, USER: 1 }, 68 Result: { GCPhys: 0x0000c00000000000, Info: { Succeeded: 1, GiganticPage: 1}, Failed: 0, Effective: { PR: 1, PX: 1, UR: 1, UX: 1} },68 Result: { rc: 0, GCPhys: 0x0000c00000000000, Info: { Succeeded: 1, GiganticPage: 1}, Failed: 0, Effective: { PR: 1, PX: 1, UR: 1, UX: 1} }, 69 69 }, 70 70 { 71 71 GCPtr: 0x0, 72 72 Flags: { EXECUTE: 1, USER: 1 }, 73 Result: { GCPhys: 0x0000c00000000000, Info: { Succeeded: 1, GiganticPage: 1}, Failed: 0, Effective: { PR: 1, PX: 1, UR: 1, UX: 1} },73 Result: { rc: 0, GCPhys: 0x0000c00000000000, Info: { Succeeded: 1, GiganticPage: 1}, Failed: 0, Effective: { PR: 1, PX: 1, UR: 1, UX: 1} }, 74 74 } 75 75 ]
Note:
See TracChangeset
for help on using the changeset viewer.