Changeset 79995 in vbox
- Timestamp:
- Jul 26, 2019 10:04:11 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r79165 r79995 1201 1201 1202 1202 #ifdef VBOX_BUGREF_9217 1203 /** Structure version number (TBD). */1204 uint32_t uStructVersion;1205 1203 /** Size of the VM structure. */ 1206 1204 uint32_t cbSelf; 1207 1205 /** Size of the VMCPU structure. */ 1208 1206 uint32_t cbVCpu; 1207 /** Structure version number (TBD). */ 1208 uint32_t uStructVersion; 1209 1209 #else 1210 1210 /** Size of the VM structure including the VMCPU array. */ 1211 1211 uint32_t cbSelf; 1212 #endif 1213 1214 #ifdef VBOX_WITH_RAW_MODE 1215 /** Offset to the VMCPU array starting from beginning of this structure, 1216 * for raw-mode assembly code. */ 1217 uint32_t offVMCPU; 1218 #else 1219 uint32_t u32Unused; 1220 #endif 1221 1222 /** 1223 * VMMSwitcher assembly entry point returning to host context. 1224 * 1225 * Depending on how the host handles the rc status given in @a eax, this may 1226 * return and let the caller resume whatever it was doing prior to the call. 1227 * 1228 * @param eax The return code, register. 1229 * @remark Assume interrupts disabled. 1230 * @remark This method pointer lives here because TRPM needs it. 1231 */ 1232 RTRCPTR pfnVMMRCToHostAsm/*(int32_t eax)*/; 1233 1234 /** 1235 * VMMSwitcher assembly entry point returning to host context without saving the 1236 * raw-mode context (hyper) registers. 1237 * 1238 * Unlike pfnVMMRC2HCAsm, this will not return to the caller. Instead it 1239 * expects the caller to save a RC context in CPUM where one might return if the 1240 * return code indicate that this is possible. 1241 * 1242 * This method pointer lives here because TRPM needs it. 1243 * 1244 * @param eax The return code, register. 1245 * @remark Assume interrupts disabled. 1246 * @remark This method pointer lives here because TRPM needs it. 1247 */ 1248 RTRCPTR pfnVMMRCToHostAsmNoReturn/*(int32_t eax)*/; 1212 uint32_t uUnused0; 1213 uint32_t uUnused1; 1214 #endif 1249 1215 1250 1216 /** @name Various items that are frequently accessed. … … 1298 1264 /** @name Debugging 1299 1265 * @{ */ 1300 /** Raw-mode Context VM Pointer. */1301 RCPTRTYPE(RTTRACEBUF) hTraceBufRC;1302 1266 /** Ring-3 Host Context VM Pointer. */ 1303 1267 R3PTRTYPE(RTTRACEBUF) hTraceBufR3; … … 1306 1270 /** @} */ 1307 1271 1308 #if HC_ARCH_BITS == 32 1309 /** Alignment padding. */ 1310 uint32_t uPadding2; 1311 #endif 1312 1313 /** @name Switcher statistics (remove) 1314 * @{ */ 1315 /** Profiling the total time from Qemu to GC. */ 1316 STAMPROFILEADV StatTotalQemuToGC; 1317 /** Profiling the total time from GC to Qemu. */ 1318 STAMPROFILEADV StatTotalGCToQemu; 1319 /** Profiling the total time spent in GC. */ 1320 STAMPROFILEADV StatTotalInGC; 1321 /** Profiling the total time spent not in Qemu. */ 1322 STAMPROFILEADV StatTotalInQemu; 1323 /** Profiling the VMMSwitcher code for going to GC. */ 1324 STAMPROFILEADV StatSwitcherToGC; 1325 /** Profiling the VMMSwitcher code for going to HC. */ 1326 STAMPROFILEADV StatSwitcherToHC; 1327 STAMPROFILEADV StatSwitcherSaveRegs; 1328 STAMPROFILEADV StatSwitcherSysEnter; 1329 STAMPROFILEADV StatSwitcherDebug; 1330 STAMPROFILEADV StatSwitcherCR0; 1331 STAMPROFILEADV StatSwitcherCR4; 1332 STAMPROFILEADV StatSwitcherJmpCR3; 1333 STAMPROFILEADV StatSwitcherRstrRegs; 1334 STAMPROFILEADV StatSwitcherLgdt; 1335 STAMPROFILEADV StatSwitcherLidt; 1336 STAMPROFILEADV StatSwitcherLldt; 1337 STAMPROFILEADV StatSwitcherTSS; 1338 /** @} */ 1339 1340 /** Padding - the unions must be aligned on a 64 bytes boundary and the unions 1341 * must start at the same offset on both 64-bit and 32-bit hosts. */ 1342 #ifdef VBOX_BUGREF_9217 1343 uint8_t abAlignment3[(HC_ARCH_BITS == 32 ? 24 : 0) + 32]; 1344 #else 1345 uint8_t abAlignment3[(HC_ARCH_BITS == 32 ? 24 : 0) + 40]; 1346 #endif 1272 /** Padding - the unions must be aligned on a 64 bytes boundary. */ 1273 uint8_t abAlignment3[24]; 1347 1274 1348 1275 /** CPUM part. */ … … 1520 1447 } ftm; 1521 1448 1522 #ifdef VBOX_WITH_RAW_MODE1523 /** PATM part. */1524 union1525 {1526 # ifdef VMM_INCLUDED_SRC_include_PATMInternal_h1527 struct PATM s;1528 # endif1529 uint8_t padding[768]; /* multiple of 64 */1530 } patm;1531 1532 /** CSAM part. */1533 union1534 {1535 # ifdef VMM_INCLUDED_SRC_include_CSAMInternal_h1536 struct CSAM s;1537 # endif1538 uint8_t padding[1088]; /* multiple of 64 */1539 } csam;1540 #endif1541 1542 1449 #ifdef VBOX_WITH_REM 1543 1450 /** REM part. */ … … 1589 1496 #ifdef VBOX_BUGREF_9217 1590 1497 /** Padding for aligning the structure size on a page boundrary. */ 1591 # if defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE) 1592 uint8_t abAlignment2[3670 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT]; 1593 # elif defined(VBOX_WITH_REM) && !defined(VBOX_WITH_RAW_MODE) 1594 uint8_t abAlignment2[1430 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT]; 1595 # elif !defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE) 1596 uint8_t abAlignment2[3926 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT]; 1498 # ifdef VBOX_WITH_REM 1499 uint8_t abAlignment2[2134 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT]; 1597 1500 # else 1598 uint8_t abAlignment2[ 1686- sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];1501 uint8_t abAlignment2[2390 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT]; 1599 1502 # endif 1600 1503 #else 1601 1504 /** Padding for aligning the cpu array on a page boundary. */ 1602 # if defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE) 1603 uint8_t abAlignment2[3670]; 1604 # elif defined(VBOX_WITH_REM) && !defined(VBOX_WITH_RAW_MODE) 1605 uint8_t abAlignment2[1430]; 1606 # elif !defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE) 1607 uint8_t abAlignment2[3926]; 1505 # ifdef VBOX_WITH_REM 1506 uint8_t abAlignment2[2134]; 1608 1507 # else 1609 uint8_t abAlignment2[ 1686];1508 uint8_t abAlignment2[2390]; 1610 1509 # endif 1611 1510 #endif -
trunk/include/VBox/vmm/vm.mac
r78433 r79995 101 101 .uCpuExecutionCap resd 1 102 102 .cbSelf resd 1 103 %ifdef VBOX_WITH_RAW_MODE 104 .offVMCPU resd 1 103 %ifdef VBOX_BUGREF_9217 104 .cbVCpu resd 1 105 .uStructVersion resd 1 105 106 %else 106 .u32Unused resd 1 107 .uUnused0 resd 1 108 .uUnused1 resd 1 107 109 %endif 108 .pfnVMMRCToHostAsm resd 1109 .pfnVMMRCToHostAsmNoReturn resd 1110 110 .bMainExecutionEngine resb 1 111 111 .fRecompileUser resb 1 … … 121 121 .uPadding1 resb 2 122 122 123 .hTraceBufRC RTRCPTR_RES 1124 123 .hTraceBufR3 RTR3PTR_RES 1 125 124 .hTraceBufR0 RTR0PTR_RES 1 126 127 alignb 8128 129 .StatTotalQemuToGC resb STAMPROFILEADV_size130 .StatTotalGCToQemu resb STAMPROFILEADV_size131 .StatTotalInGC resb STAMPROFILEADV_size132 .StatTotalInQemu resb STAMPROFILEADV_size133 .StatSwitcherToGC resb STAMPROFILEADV_size134 .StatSwitcherToHC resb STAMPROFILEADV_size135 .StatSwitcherSaveRegs resb STAMPROFILEADV_size136 .StatSwitcherSysEnter resb STAMPROFILEADV_size137 .StatSwitcherDebug resb STAMPROFILEADV_size138 .StatSwitcherCR0 resb STAMPROFILEADV_size139 .StatSwitcherCR4 resb STAMPROFILEADV_size140 .StatSwitcherJmpCR3 resb STAMPROFILEADV_size141 .StatSwitcherRstrRegs resb STAMPROFILEADV_size142 .StatSwitcherLgdt resb STAMPROFILEADV_size143 .StatSwitcherLidt resb STAMPROFILEADV_size144 .StatSwitcherLldt resb STAMPROFILEADV_size145 .StatSwitcherTSS resb STAMPROFILEADV_size146 147 %ifndef HC_ARCH_BITS148 %error "Missing HC_ARCH_BITS"149 %endif150 %if HC_ARCH_BITS == 32151 .abAlignment3 resb 16152 %else153 ; .abAlignment3 resb 16154 %endif155 125 156 126 alignb 64 … … 170 140 .ssm resb 128 171 141 .ftm resb 512 172 %ifdef VBOX_WITH_RAW_MODE173 .patm resb 768174 .csam resb 1088175 %endif176 142 %ifdef VBOX_WITH_REM 177 143 .rem resb 0x11100 -
trunk/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp
r76553 r79995 128 128 pVM->hTraceBufR3 = hTraceBuf; 129 129 pVM->hTraceBufR0 = MMHyperCCToR0(pVM, hTraceBuf); 130 pVM->hTraceBufRC = MMHyperCCToRC(pVM, hTraceBuf);131 130 return VINF_SUCCESS; 132 131 } … … 146 145 Assert(NIL_RTTRACEBUF == (RTTRACEBUF)NULL); 147 146 pVM->hTraceBufR3 = NIL_RTTRACEBUF; 148 pVM->hTraceBufRC = NIL_RTRCPTR;149 147 pVM->hTraceBufR0 = NIL_RTR0PTR; 150 148 … … 218 216 void dbgfR3TraceRelocate(PVM pVM) 219 217 { 220 if (pVM->hTraceBufR3 != NIL_RTTRACEBUF) 221 pVM->hTraceBufRC = MMHyperCCToRC(pVM, pVM->hTraceBufR3); 218 RT_NOREF(pVM); 222 219 } 223 220 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r78431 r79995 864 864 * Register statistics. 865 865 */ 866 STAM_REG(pVM, &pVM->StatTotalInGC, STAMTYPE_PROFILE_ADV, "/PROF/VM/InGC", STAMUNIT_TICKS_PER_CALL, "Profiling the total time spent in GC.");867 STAM_REG(pVM, &pVM->StatSwitcherToGC, STAMTYPE_PROFILE_ADV, "/PROF/VM/SwitchToGC", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");868 STAM_REG(pVM, &pVM->StatSwitcherToHC, STAMTYPE_PROFILE_ADV, "/PROF/VM/SwitchToHC", STAMUNIT_TICKS_PER_CALL, "Profiling switching to HC.");869 STAM_REG(pVM, &pVM->StatSwitcherSaveRegs, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/SaveRegs", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");870 STAM_REG(pVM, &pVM->StatSwitcherSysEnter, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/SysEnter", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");871 STAM_REG(pVM, &pVM->StatSwitcherDebug, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Debug", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");872 STAM_REG(pVM, &pVM->StatSwitcherCR0, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/CR0", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");873 STAM_REG(pVM, &pVM->StatSwitcherCR4, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/CR4", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");874 STAM_REG(pVM, &pVM->StatSwitcherLgdt, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lgdt", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");875 STAM_REG(pVM, &pVM->StatSwitcherLidt, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lidt", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");876 STAM_REG(pVM, &pVM->StatSwitcherLldt, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lldt", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");877 STAM_REG(pVM, &pVM->StatSwitcherTSS, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/TSS", STAMUNIT_TICKS_PER_CALL, "Profiling switching to GC.");878 STAM_REG(pVM, &pVM->StatSwitcherJmpCR3, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/JmpCR3", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");879 STAM_REG(pVM, &pVM->StatSwitcherRstrRegs, STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/RstrRegs", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");880 881 866 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 882 867 { -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r79718 r79995 1438 1438 GEN_CHECK_OFF(VM, uCpuExecutionCap); 1439 1439 GEN_CHECK_OFF(VM, cbSelf); 1440 GEN_CHECK_OFF(VM, pfnVMMRCToHostAsm);1441 GEN_CHECK_OFF(VM, pfnVMMRCToHostAsmNoReturn);1442 1440 GEN_CHECK_OFF(VM, bMainExecutionEngine); 1443 1441 GEN_CHECK_OFF(VM, fRecompileUser); … … 1448 1446 GEN_CHECK_OFF(VM, fFaultTolerantMaster); 1449 1447 GEN_CHECK_OFF(VM, fUseLargePages); 1450 GEN_CHECK_OFF(VM, hTraceBufRC);1451 1448 GEN_CHECK_OFF(VM, hTraceBufR3); 1452 1449 GEN_CHECK_OFF(VM, hTraceBufR0); 1453 GEN_CHECK_OFF(VM, StatTotalQemuToGC);1454 GEN_CHECK_OFF(VM, StatTotalGCToQemu);1455 GEN_CHECK_OFF(VM, StatTotalInGC);1456 GEN_CHECK_OFF(VM, StatTotalInQemu);1457 GEN_CHECK_OFF(VM, StatSwitcherToGC);1458 GEN_CHECK_OFF(VM, StatSwitcherToHC);1459 GEN_CHECK_OFF(VM, StatSwitcherSaveRegs);1460 GEN_CHECK_OFF(VM, StatSwitcherSysEnter);1461 GEN_CHECK_OFF(VM, StatSwitcherDebug);1462 GEN_CHECK_OFF(VM, StatSwitcherCR0);1463 GEN_CHECK_OFF(VM, StatSwitcherCR4);1464 GEN_CHECK_OFF(VM, StatSwitcherJmpCR3);1465 GEN_CHECK_OFF(VM, StatSwitcherRstrRegs);1466 GEN_CHECK_OFF(VM, StatSwitcherLgdt);1467 GEN_CHECK_OFF(VM, StatSwitcherLidt);1468 GEN_CHECK_OFF(VM, StatSwitcherLldt);1469 GEN_CHECK_OFF(VM, StatSwitcherTSS);1470 1450 GEN_CHECK_OFF(VM, cpum); 1471 1451 GEN_CHECK_OFF(VM, vmm); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r78220 r79995 271 271 } 272 272 PRINT_OFFSET(VM, selm.s.TssTrap08); 273 #if 0 // irrelevant now, remove later. 273 274 if ((RT_UOFFSETOF(VM, selm.s.TssTrap08) & PAGE_OFFSET_MASK) > PAGE_SIZE - sizeof(pVM->selm.s.TssTrap08)) 274 275 { … … 276 277 rc++; 277 278 } 279 #endif 278 280 CHECK_MEMBER_ALIGNMENT(VM, trpm.s.aIdt, 16); 279 281 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0], PAGE_SIZE); … … 299 301 CHECK_MEMBER_ALIGNMENT(VM, vmm.s.u64LastYield, 8); 300 302 CHECK_MEMBER_ALIGNMENT(VM, vmm.s.StatRunRC, 8); 301 CHECK_MEMBER_ALIGNMENT(VM, StatTotalQemuToGC, 8);302 303 #ifdef VBOX_WITH_REM 303 304 CHECK_MEMBER_ALIGNMENT(VM, rem.s.uPendingExcptCR2, 8);
Note:
See TracChangeset
for help on using the changeset viewer.