Changeset 80334 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 17, 2019 12:43:24 AM (5 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r80274 r80334 1131 1131 #ifdef IN_RING0 1132 1132 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1133 /** @todo improve and secure this translation */1134 # ifdef VBOX_BUGREF_92171135 1133 return nemR0WinImportState(pVCpu->pGVM, pVCpu, &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/); 1136 # else1137 PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf);1138 AssertReturn(pGVM, VERR_INVALID_VMCPU_HANDLE);1139 VMCPUID idCpu = pVCpu->idCpu;1140 ASMCompilerBarrier();1141 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_VMCPU_HANDLE);1142 1143 return nemR0WinImportState(pGVM, &pGVM->aCpus[idCpu], &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/);1144 # endif1145 1134 # else 1146 1135 RT_NOREF(pVCpu, fWhat); … … 1202 1191 #else /* IN_RING0 */ 1203 1192 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1204 # ifdef VBOX_BUGREF_92171205 1193 int rc = nemR0WinQueryCpuTick(pVCpu->pGVM, pVCpu, pcTicks, puAux); 1206 # else1207 /** @todo improve and secure this translation */1208 PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf);1209 AssertReturn(pGVM, VERR_INVALID_VMCPU_HANDLE);1210 VMCPUID idCpu = pVCpu->idCpu;1211 ASMCompilerBarrier();1212 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_VMCPU_HANDLE);1213 int rc = nemR0WinQueryCpuTick(pGVM, &pGVM->aCpus[idCpu], pcTicks, puAux);1214 # endif1215 1194 if (RT_SUCCESS(rc) && puAux && !(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX)) 1216 1195 *puAux = CPUMGetGuestTscAux(pVCpu); … … 1238 1217 #ifdef IN_RING0 1239 1218 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1240 # ifdef VBOX_BUGREF_92171241 1219 return nemR0WinResumeCpuTickOnAll(pVM, pVCpu, uPausedTscValue); 1242 # else1243 /** @todo improve and secure this translation */1244 PGVM pGVM = GVMMR0ByHandle(pVM->hSelf);1245 AssertReturn(pGVM, VERR_INVALID_VMCPU_HANDLE);1246 VMCPUID idCpu = pVCpu->idCpu;1247 ASMCompilerBarrier();1248 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_VMCPU_HANDLE);1249 1250 return nemR0WinResumeCpuTickOnAll(pGVM, &pGVM->aCpus[idCpu], uPausedTscValue);1251 # endif1252 1220 # else 1253 1221 RT_NOREF(pVM, pVCpu, uPausedTscValue); -
trunk/src/VBox/VMM/VMMR0/EMR0.cpp
r80333 r80334 39 39 * @param pVM The cross context VM structure. 40 40 */ 41 #ifdef VBOX_BUGREF_921742 41 VMMR0_INT_DECL(int) EMR0InitVM(PGVM pGVM) 43 #else44 VMMR0_INT_DECL(int) EMR0InitVM(PGVM pGVM, PVMCC pVM)45 #endif46 42 { 47 43 /* 48 44 * Override ring-0 exit optimizations settings. 49 45 */ 50 #ifdef VBOX_BUGREF_921751 46 PVMCPUCC pVCpu0 = &pGVM->aCpus[0]; 52 #else53 PVMCPUCC pVCpu0 = VMCC_GET_CPU_0(pVM);54 #endif55 56 47 bool fEnabledR0 = pVCpu0->em.s.fExitOptimizationEnabled 57 48 && pVCpu0->em.s.fExitOptimizationEnabledR0 … … 62 53 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) 63 54 { 64 #ifdef VBOX_BUGREF_921765 55 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 66 #else67 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu);68 #endif69 56 pVCpu->em.s.fExitOptimizationEnabledR0 = fEnabledR0; 70 57 pVCpu->em.s.fExitOptimizationEnabledR0PreemptDisabled = fEnabledR0PreemptDisabled; -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r80333 r80334 1225 1225 GMMR0DECL(void) GMMR0CleanupVM(PGVM pGVM) 1226 1226 { 1227 #ifdef VBOX_BUGREF_92171228 1227 LogFlow(("GMMR0CleanupVM: pGVM=%p:{.hSelf=%#x}\n", pGVM, pGVM->hSelf)); 1229 #else1230 LogFlow(("GMMR0CleanupVM: pGVM=%p:{.pVM=%p, .hSelf=%#x}\n", pGVM, pGVM->pVM, pGVM->hSelf));1231 #endif1232 1228 1233 1229 PGMM pGMM; … … 5141 5137 pGblMod->szName, pGblMod->szVersion, pGblMod->Core.Key, pGblMod->cbModule)); 5142 5138 5143 # ifdef VBOX_BUGREF_92175144 5139 int rc = PGMR0SharedModuleCheck(pArgs->pGVM, pArgs->pGVM, pArgs->idCpu, pGblMod, pRecVM->aRegionsGCPtrs); 5145 #else5146 int rc = PGMR0SharedModuleCheck(pArgs->pGVM->pVM, pArgs->pGVM, pArgs->idCpu, pGblMod, pRecVM->aRegionsGCPtrs);5147 # endif5148 5140 if (RT_FAILURE(rc)) 5149 5141 return rc; -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r80319 r80334 359 359 * Internal Functions * 360 360 *********************************************************************************************************************************/ 361 #ifdef VBOX_BUGREF_9217362 361 static void gvmmR0InitPerVMData(PGVM pGVM, int16_t hSelf, VMCPUID cCpus, PSUPDRVSESSION pSession); 363 #else364 static void gvmmR0InitPerVMData(PGVM pGVM);365 #endif366 362 static DECLCALLBACK(void) gvmmR0HandleObjDestructor(void *pvObj, void *pvGVMM, void *pvHandle); 367 363 static int gvmmR0ByGVMandVM(PGVM pGVM, PVMCC pVM, PGVMM *ppGVMM, bool fTakeUsedLock); … … 891 887 if (RT_SUCCESS(rc)) 892 888 { 893 #ifdef VBOX_BUGREF_9217894 889 /* 895 890 * Allocate memory for the VM structure (combined VM + GVM). … … 1029 1024 } 1030 1025 1031 #else1032 /*1033 * Allocate the global VM structure (GVM) and initialize it.1034 */1035 PGVM pGVM = (PGVM)RTMemAllocZ(RT_UOFFSETOF_DYN(GVM, aCpus[cCpus]));1036 if (pGVM)1037 {1038 pGVM->u32Magic = GVM_MAGIC;1039 pGVM->hSelf = iHandle;1040 pGVM->pVM = NULL;1041 pGVM->cCpus = cCpus;1042 pGVM->pSession = pSession;1043 1044 gvmmR0InitPerVMData(pGVM);1045 GMMR0InitPerVMData(pGVM);1046 1047 /*1048 * Allocate the shared VM structure and associated page array.1049 */1050 const uint32_t cbVM = RT_UOFFSETOF_DYN(VM, aCpus[cCpus]);1051 const uint32_t cPages = RT_ALIGN_32(cbVM, PAGE_SIZE) >> PAGE_SHIFT;1052 rc = RTR0MemObjAllocLow(&pGVM->gvmm.s.VMMemObj, cPages << PAGE_SHIFT, false /* fExecutable */);1053 if (RT_SUCCESS(rc))1054 {1055 PVMCC pVM = (PVMCC)RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj); AssertPtr(pVM);1056 memset(pVM, 0, cPages << PAGE_SHIFT);1057 pVM->enmVMState = VMSTATE_CREATING;1058 pVM->pVMR0 = pVM;1059 pVM->pSession = pSession;1060 pVM->hSelf = iHandle;1061 pVM->cbSelf = cbVM;1062 pVM->cCpus = cCpus;1063 pVM->uCpuExecutionCap = 100; /* default is no cap. */1064 AssertCompileMemberAlignment(VM, cpum, 64);1065 AssertCompileMemberAlignment(VM, tm, 64);1066 AssertCompileMemberAlignment(VM, aCpus, PAGE_SIZE);1067 1068 rc = RTR0MemObjAllocPage(&pGVM->gvmm.s.VMPagesMemObj, cPages * sizeof(SUPPAGE), false /* fExecutable */);1069 if (RT_SUCCESS(rc))1070 {1071 PSUPPAGE paPages = (PSUPPAGE)RTR0MemObjAddress(pGVM->gvmm.s.VMPagesMemObj); AssertPtr(paPages);1072 for (uint32_t iPage = 0; iPage < cPages; iPage++)1073 {1074 paPages[iPage].uReserved = 0;1075 paPages[iPage].Phys = RTR0MemObjGetPagePhysAddr(pGVM->gvmm.s.VMMemObj, iPage);1076 Assert(paPages[iPage].Phys != NIL_RTHCPHYS);1077 }1078 1079 /*1080 * Map them into ring-3.1081 */1082 rc = RTR0MemObjMapUser(&pGVM->gvmm.s.VMMapObj, pGVM->gvmm.s.VMMemObj, (RTR3PTR)-1, 0,1083 RTMEM_PROT_READ | RTMEM_PROT_WRITE, NIL_RTR0PROCESS);1084 if (RT_SUCCESS(rc))1085 {1086 PVMR3 pVMR3 = RTR0MemObjAddressR3(pGVM->gvmm.s.VMMapObj);1087 AssertPtr((void *)pVMR3);1088 pVM->pVMR3 = pVMR3;1089 1090 /* Initialize all the VM pointers. */1091 for (VMCPUID i = 0; i < cCpus; i++)1092 {1093 pVM->aCpus[i].idCpu = i;1094 pVM->aCpus[i].pVMR0 = pVM;1095 pVM->aCpus[i].pVMR3 = pVMR3;1096 pVM->aCpus[i].idHostCpu = NIL_RTCPUID;1097 pVM->aCpus[i].hNativeThreadR0 = NIL_RTNATIVETHREAD;1098 pVM->apCpusR3[i] = pVMR3 + RT_UOFFSETOF_DYN(VM, aCpus[i]);1099 pVM->apCpusR0[i] = &pVM->aCpus[i];1100 }1101 1102 rc = RTR0MemObjMapUser(&pGVM->gvmm.s.VMPagesMapObj, pGVM->gvmm.s.VMPagesMemObj, (RTR3PTR)-1,1103 0 /* uAlignment */, RTMEM_PROT_READ | RTMEM_PROT_WRITE,1104 NIL_RTR0PROCESS);1105 if (RT_SUCCESS(rc))1106 {1107 pVM->paVMPagesR3 = RTR0MemObjAddressR3(pGVM->gvmm.s.VMPagesMapObj);1108 AssertPtr((void *)pVM->paVMPagesR3);1109 1110 /* complete the handle - take the UsedLock sem just to be careful. */1111 rc = GVMMR0_USED_EXCLUSIVE_LOCK(pGVMM);1112 AssertRC(rc);1113 1114 pHandle->pVM = pVM;1115 pHandle->pGVM = pGVM;1116 pHandle->hEMT0 = hEMT0;1117 pHandle->ProcId = ProcId;1118 pGVM->pVM = pVM;1119 pGVM->pVMR3 = pVMR3;1120 pGVM->aCpus[0].hEMT = hEMT0;1121 pVM->aCpus[0].hNativeThreadR0 = hEMT0;1122 pGVMM->cEMTs += cCpus;1123 1124 for (VMCPUID i = 0; i < cCpus; i++)1125 {1126 pGVM->aCpus[i].pVCpu = &pVM->aCpus[i];1127 pGVM->aCpus[i].pVM = pVM;1128 }1129 1130 /* Associate it with the session and create the context hook for EMT0. */1131 rc = SUPR0SetSessionVM(pSession, pGVM, pVM);1132 if (RT_SUCCESS(rc))1133 {1134 rc = VMMR0ThreadCtxHookCreateForEmt(&pVM->aCpus[0]);1135 if (RT_SUCCESS(rc))1136 {1137 /*1138 * Done!1139 */1140 VBOXVMM_R0_GVMM_VM_CREATED(pGVM, pVM, ProcId, (void *)hEMT0, cCpus);1141 1142 GVMMR0_USED_EXCLUSIVE_UNLOCK(pGVMM);1143 gvmmR0CreateDestroyUnlock(pGVMM);1144 1145 CPUMR0RegisterVCpuThread(&pVM->aCpus[0]);1146 1147 *ppVM = pVM;1148 Log(("GVMMR0CreateVM: pVM=%p pVMR3=%p pGVM=%p hGVM=%d\n", pVM, pVMR3, pGVM, iHandle));1149 return VINF_SUCCESS;1150 }1151 1152 SUPR0SetSessionVM(pSession, NULL, NULL);1153 }1154 GVMMR0_USED_EXCLUSIVE_UNLOCK(pGVMM);1155 }1156 1157 RTR0MemObjFree(pGVM->gvmm.s.VMMapObj, false /* fFreeMappings */);1158 pGVM->gvmm.s.VMMapObj = NIL_RTR0MEMOBJ;1159 }1160 RTR0MemObjFree(pGVM->gvmm.s.VMPagesMemObj, false /* fFreeMappings */);1161 pGVM->gvmm.s.VMPagesMemObj = NIL_RTR0MEMOBJ;1162 }1163 RTR0MemObjFree(pGVM->gvmm.s.VMMemObj, false /* fFreeMappings */);1164 pGVM->gvmm.s.VMMemObj = NIL_RTR0MEMOBJ;1165 }1166 }1167 #endif1168 1026 } 1169 1027 /* else: The user wasn't permitted to create this VM. */ … … 1196 1054 1197 1055 1198 #ifdef VBOX_BUGREF_92171199 1056 /** 1200 1057 * Initializes the per VM data belonging to GVMM. … … 1203 1060 */ 1204 1061 static void gvmmR0InitPerVMData(PGVM pGVM, int16_t hSelf, VMCPUID cCpus, PSUPDRVSESSION pSession) 1205 #else1206 /**1207 * Initializes the per VM data belonging to GVMM.1208 *1209 * @param pGVM Pointer to the global VM structure.1210 */1211 static void gvmmR0InitPerVMData(PGVM pGVM)1212 #endif1213 1062 { 1214 1063 AssertCompile(RT_SIZEOFMEMB(GVM,gvmm.s) <= RT_SIZEOFMEMB(GVM,gvmm.padding)); 1215 1064 AssertCompile(RT_SIZEOFMEMB(GVMCPU,gvmm.s) <= RT_SIZEOFMEMB(GVMCPU,gvmm.padding)); 1216 #ifdef VBOX_BUGREF_92171217 1065 AssertCompileMemberAlignment(VM, cpum, 64); 1218 1066 AssertCompileMemberAlignment(VM, tm, 64); … … 1235 1083 pGVM->cbSelf = sizeof(VM); 1236 1084 pGVM->cbVCpu = sizeof(VMCPU); 1237 #endif1238 1085 1239 1086 /* GVMM: */ … … 1251 1098 { 1252 1099 pGVM->aCpus[i].idCpu = i; 1253 #ifdef VBOX_BUGREF_92171254 1100 pGVM->aCpus[i].idCpuUnsafe = i; 1255 #endif1256 1101 pGVM->aCpus[i].gvmm.s.HaltEventMulti = NIL_RTSEMEVENTMULTI; 1257 #ifdef VBOX_BUGREF_92171258 1102 pGVM->aCpus[i].gvmm.s.VMCpuMapObj = NIL_RTR0MEMOBJ; 1259 #endif1260 1103 pGVM->aCpus[i].hEMT = NIL_RTNATIVETHREAD; 1261 1104 pGVM->aCpus[i].pGVM = pGVM; 1262 #ifndef VBOX_BUGREF_92171263 pGVM->aCpus[i].pVCpu = NULL;1264 pGVM->aCpus[i].pVM = NULL;1265 #endif1266 #ifdef VBOX_BUGREF_92171267 1105 pGVM->aCpus[i].idHostCpu = NIL_RTCPUID; 1268 1106 pGVM->aCpus[i].iHostCpuSet = UINT32_MAX; … … 1271 1109 pGVM->aCpus[i].enmState = VMCPUSTATE_STOPPED; 1272 1110 pGVM->aCpus[i].pVCpuR0ForVtg = &pGVM->aCpus[i]; 1273 #endif1274 1111 } 1275 1112 } … … 1368 1205 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 1369 1206 AssertReturn(!((uintptr_t)pVM & PAGE_OFFSET_MASK), VERR_INVALID_POINTER); 1370 #ifdef VBOX_BUGREF_92171371 1207 AssertReturn(pGVM == pVM, VERR_INVALID_POINTER); 1372 #else1373 AssertReturn(pGVM->pVM == pVM, VERR_INVALID_POINTER);1374 #endif1375 1208 AssertMsgReturn(pVM->enmVMState >= VMSTATE_CREATING && pVM->enmVMState <= VMSTATE_TERMINATED, ("%d\n", pVM->enmVMState), 1376 1209 VERR_WRONG_ORDER); … … 1450 1283 { 1451 1284 if ( pGVM->gvmm.s.VMMemObj != NIL_RTR0MEMOBJ 1452 #ifdef VBOX_BUGREF_9217 1453 && RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj) == pGVM 1454 #else 1455 && RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj) == pGVM->pVM 1456 #endif 1457 ) 1285 && RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj) == pGVM) 1458 1286 { 1459 1287 LogFlow(("gvmmR0CleanupVM: Calling VMMR0TermVM\n")); 1460 #ifdef VBOX_BUGREF_92171461 1288 VMMR0TermVM(pGVM, pGVM, NIL_VMCPUID); 1462 #else1463 VMMR0TermVM(pGVM, pGVM->pVM, NIL_VMCPUID);1464 #endif1465 1289 } 1466 1290 else 1467 #ifdef VBOX_BUGREF_92171468 1291 AssertMsgFailed(("gvmmR0CleanupVM: VMMemObj=%p pGVM=%p\n", pGVM->gvmm.s.VMMemObj, pGVM)); 1469 #else1470 AssertMsgFailed(("gvmmR0CleanupVM: VMMemObj=%p pVM=%p\n", pGVM->gvmm.s.VMMemObj, pGVM->pVM));1471 #endif1472 1292 } 1473 1293 … … 1484 1304 * solution for not deregistering hooks everytime we're leaving HMR0 1485 1305 * context. */ 1486 #ifdef VBOX_BUGREF_92171487 1306 VMMR0ThreadCtxHookDestroyForEmt(&pGVM->aCpus[idCpu]); 1488 #else1489 VMMR0ThreadCtxHookDestroyForEmt(&pGVM->pVM->aCpus[idCpu]);1490 #endif1491 1307 } 1492 1308 } … … 1614 1430 } 1615 1431 1616 #ifndef VBOX_BUGREF_92171617 if (pGVM->gvmm.s.VMMemObj != NIL_RTR0MEMOBJ)1618 {1619 rc = RTR0MemObjFree(pGVM->gvmm.s.VMMemObj, false /* fFreeMappings */); AssertRC(rc);1620 pGVM->gvmm.s.VMMemObj = NIL_RTR0MEMOBJ;1621 }1622 #endif1623 1624 1432 for (VMCPUID i = 0; i < pGVM->cCpus; i++) 1625 1433 { … … 1629 1437 pGVM->aCpus[i].gvmm.s.HaltEventMulti = NIL_RTSEMEVENTMULTI; 1630 1438 } 1631 #ifdef VBOX_BUGREF_92171632 1439 if (pGVM->aCpus[i].gvmm.s.VMCpuMapObj != NIL_RTR0MEMOBJ) 1633 1440 { … … 1635 1442 pGVM->aCpus[i].gvmm.s.VMCpuMapObj = NIL_RTR0MEMOBJ; 1636 1443 } 1637 #endif1638 1444 } 1639 1445 1640 1446 /* the GVM structure itself. */ 1641 1447 pGVM->u32Magic |= UINT32_C(0x80000000); 1642 #ifdef VBOX_BUGREF_92171643 1448 Assert(pGVM->gvmm.s.VMMemObj != NIL_RTR0MEMOBJ); 1644 1449 rc = RTR0MemObjFree(pGVM->gvmm.s.VMMemObj, true /*fFreeMappings*/); AssertRC(rc); 1645 #else1646 RTMemFree(pGVM);1647 #endif1648 1450 pGVM = NULL; 1649 1451 … … 1698 1500 if (pGVM->aCpus[idCpu].hEMT == NIL_RTNATIVETHREAD) 1699 1501 { 1700 #ifdef VBOX_BUGREF_92171701 1502 Assert(pGVM->aCpus[idCpu].hNativeThreadR0 == NIL_RTNATIVETHREAD); 1702 #else1703 Assert(pVM->aCpus[idCpu].hNativeThreadR0 == NIL_RTNATIVETHREAD);1704 #endif1705 1503 1706 1504 /* A thread may only be one EMT. */ … … 1713 1511 * Do the assignment, then try setup the hook. Undo if that fails. 1714 1512 */ 1715 #ifdef VBOX_BUGREF_92171716 1513 pGVM->aCpus[idCpu].hNativeThreadR0 = pGVM->aCpus[idCpu].hEMT = RTThreadNativeSelf(); 1717 1514 … … 1721 1518 else 1722 1519 pGVM->aCpus[idCpu].hNativeThreadR0 = pGVM->aCpus[idCpu].hEMT = NIL_RTNATIVETHREAD; 1723 #else1724 pVM->aCpus[idCpu].hNativeThreadR0 = pGVM->aCpus[idCpu].hEMT = RTThreadNativeSelf();1725 1726 rc = VMMR0ThreadCtxHookCreateForEmt(&pVM->aCpus[idCpu]);1727 if (RT_SUCCESS(rc))1728 CPUMR0RegisterVCpuThread(&pVM->aCpus[idCpu]);1729 else1730 pVM->aCpus[idCpu].hNativeThreadR0 = pGVM->aCpus[idCpu].hEMT = NIL_RTNATIVETHREAD;1731 #endif1732 1520 } 1733 1521 } … … 1777 1565 * Do per-EMT cleanups. 1778 1566 */ 1779 #ifdef VBOX_BUGREF_92171780 1567 VMMR0ThreadCtxHookDestroyForEmt(&pGVM->aCpus[idCpu]); 1781 #else1782 VMMR0ThreadCtxHookDestroyForEmt(&pVM->aCpus[idCpu]);1783 #endif1784 1568 1785 1569 /* … … 1789 1573 AssertCompile(~(RTNATIVETHREAD)1 != NIL_RTNATIVETHREAD); 1790 1574 pGVM->aCpus[idCpu].hEMT = ~(RTNATIVETHREAD)1; 1791 #ifdef VBOX_BUGREF_92171792 1575 pGVM->aCpus[idCpu].hNativeThreadR0 = NIL_RTNATIVETHREAD; 1793 #else1794 pVM->aCpus[idCpu].hNativeThreadR0 = NIL_RTNATIVETHREAD;1795 #endif1796 1576 } 1797 1577 … … 1827 1607 PGVM pGVM = pHandle->pGVM; 1828 1608 AssertPtrReturn(pGVM, NULL); 1829 #ifdef VBOX_BUGREF_92171830 1609 AssertReturn(pGVM == pHandle->pVM, NULL); 1831 #else1832 AssertReturn(pGVM->pVM == pHandle->pVM, NULL);1833 #endif1834 1610 1835 1611 return pHandle->pGVM; … … 1888 1664 1889 1665 pGVM = pHandle->pGVM; 1890 #ifdef VBOX_BUGREF_92171891 1666 if (RT_UNLIKELY( pHandle->pVM != pVM 1892 1667 || pHandle->ProcId != ProcId … … 1894 1669 || !VALID_PTR(pGVM) 1895 1670 || pGVM != pVM)) 1896 #else1897 if (RT_UNLIKELY( pHandle->pVM != pVM1898 || pHandle->ProcId != ProcId1899 || !VALID_PTR(pHandle->pvObj)1900 || !VALID_PTR(pGVM)1901 || pGVM->pVM != pVM))1902 #endif1903 1671 { 1904 1672 GVMMR0_USED_SHARED_UNLOCK(pGVMM); … … 1918 1686 if (RT_UNLIKELY(!VALID_PTR(pGVM))) 1919 1687 return VERR_INVALID_HANDLE; 1920 #ifdef VBOX_BUGREF_92171921 1688 if (RT_UNLIKELY(pGVM != pVM)) 1922 #else1923 if (RT_UNLIKELY(pGVM->pVM != pVM))1924 #endif1925 1689 return VERR_INVALID_HANDLE; 1926 1690 } … … 1967 1731 PGVM pGVM = pHandle->pGVM; 1968 1732 AssertPtrReturn(pGVM, NULL); 1969 #ifdef VBOX_BUGREF_92171970 1733 AssertReturn(pGVM == pVM, NULL); 1971 #else1972 AssertReturn(pGVM->pVM == pVM, NULL);1973 #endif1974 1734 1975 1735 return pGVM; … … 2006 1766 && ((uintptr_t)pVM & PAGE_OFFSET_MASK) == 0)) 2007 1767 { 2008 #ifdef VBOX_BUGREF_92172009 1768 if (RT_LIKELY(pGVM == pVM)) 2010 #else2011 if (RT_LIKELY(pGVM->pVM == pVM))2012 #endif2013 1769 { 2014 1770 /* … … 2038 1794 * Some more VM data consistency checks. 2039 1795 */ 2040 #ifdef VBOX_BUGREF_92172041 1796 if (RT_LIKELY( pVM->cCpus == pGVM->cCpus 2042 1797 && pVM->hSelf == hGVM … … 2045 1800 && pVM->pSelf == pVM 2046 1801 )) 2047 #else2048 if (RT_LIKELY( pVM->cCpus == pGVM->cCpus2049 && pVM->hSelf == hGVM2050 && pVM->enmVMState >= VMSTATE_CREATING2051 && pVM->enmVMState <= VMSTATE_TERMINATED2052 && pVM->pVMR0 == pVM2053 ))2054 #endif2055 1802 { 2056 1803 *ppGVMM = pGVMM; … … 2098 1845 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 2099 1846 AssertReturn(((uintptr_t)pVM & PAGE_OFFSET_MASK) == 0, VERR_INVALID_POINTER); 2100 #ifdef VBOX_BUGREF_92172101 1847 AssertReturn(pGVM == pVM, VERR_INVALID_VM_HANDLE); 2102 #else2103 AssertReturn(pGVM->pVM == pVM, VERR_INVALID_VM_HANDLE);2104 #endif2105 2106 1848 2107 1849 /* … … 2136 1878 AssertReturn(pVM->cCpus == pGVM->cCpus, VERR_INCONSISTENT_VM_HANDLE); 2137 1879 AssertReturn(pVM->hSelf == hGVM, VERR_INCONSISTENT_VM_HANDLE); 2138 #ifndef VBOX_BUGREF_92172139 AssertReturn(pVM->pVMR0 == pVM, VERR_INCONSISTENT_VM_HANDLE);2140 #endif2141 1880 AssertReturn( pVM->enmVMState >= VMSTATE_CREATING 2142 1881 && pVM->enmVMState <= VMSTATE_TERMINATED, VERR_INCONSISTENT_VM_HANDLE); … … 2783 2522 { 2784 2523 if (idCpu < pGVM->cCpus) 2785 #ifdef VBOX_BUGREF_92172786 2524 rc = gvmmR0SchedPokeOne(pGVM, &pGVM->aCpus[idCpu]); 2787 #else2788 rc = gvmmR0SchedPokeOne(pGVM, &pVM->aCpus[idCpu]);2789 #endif2790 2525 else 2791 2526 rc = VERR_INVALID_CPU_ID; … … 2841 2576 { 2842 2577 if (idCpu < pGVM->cCpus) 2843 #ifdef VBOX_BUGREF_92172844 2578 rc = gvmmR0SchedPokeOne(pGVM, &pGVM->aCpus[idCpu]); 2845 #else2846 rc = gvmmR0SchedPokeOne(pGVM, &pVM->aCpus[idCpu]);2847 #endif2848 2579 else 2849 2580 rc = VERR_INVALID_CPU_ID; … … 2895 2626 else if (VMCPUSET_IS_PRESENT(pPokeSet, idCpu)) 2896 2627 { 2897 #ifdef VBOX_BUGREF_92172898 2628 gvmmR0SchedPokeOne(pGVM, &pGVM->aCpus[idCpu]); 2899 #else2900 gvmmR0SchedPokeOne(pGVM, &pVM->aCpus[idCpu]);2901 #endif2902 2629 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2903 2630 } -
trunk/src/VBox/VMM/VMMR0/GVMMR0Internal.h
r78431 r80334 34 34 /** The event semaphore the EMT thread is blocking on. */ 35 35 RTSEMEVENTMULTI HaltEventMulti; 36 #ifdef VBOX_BUGREF_921737 36 /** The ring-3 mapping of the VMCPU structure. */ 38 37 RTR0MEMOBJ VMCpuMapObj; 39 #endif40 38 /** The APIC ID of the CPU that EMT was scheduled on the last time we checked. */ 41 39 uint8_t iCpuEmt; -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r80274 r80334 259 259 */ 260 260 VMCPU_ASSERT_EMT(pVCpu); 261 # ifdef VBOX_BUGREF_9217262 261 if (pvInput) 263 262 AssertReturn(((uintptr_t)pvInput + cbInput) - (uintptr_t)pVCpu <= sizeof(*pVCpu), VERR_INVALID_PARAMETER); 264 263 if (pvOutput) 265 264 AssertReturn(((uintptr_t)pvOutput + cbOutput) - (uintptr_t)pVCpu <= sizeof(*pVCpu), VERR_INVALID_PARAMETER); 266 # else267 PVMCC pVM = pGVM->pVM;268 size_t const cbVM = RT_UOFFSETOF_DYN(VM, aCpus[pGVM->cCpus]);269 if (pvInput)270 AssertReturn(((uintptr_t)pvInput + cbInput) - (uintptr_t)pVM <= cbVM, VERR_INVALID_PARAMETER);271 if (pvOutput)272 AssertReturn(((uintptr_t)pvOutput + cbOutput) - (uintptr_t)pVM <= cbVM, VERR_INVALID_PARAMETER);273 # endif274 265 #endif 275 266 … … 277 268 int rc = SUPR0IoCtlPerform(pGVM->nemr0.s.pIoCtlCtx, uFunction, 278 269 pvInput, 279 #ifdef VBOX_BUGREF_9217280 270 pvInput ? (uintptr_t)pvInput + pVCpu->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 281 #else282 pvInput ? (uintptr_t)pvInput + pGVM->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR,283 #endif284 271 cbInput, 285 272 pvOutput, 286 #ifdef VBOX_BUGREF_9217287 273 pvOutput ? (uintptr_t)pvOutput + pVCpu->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 288 #else289 pvOutput ? (uintptr_t)pvOutput + pGVM->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR,290 #endif291 274 cbOutput, 292 275 &rcNt); 293 276 if (RT_SUCCESS(rc) || !NT_SUCCESS((NTSTATUS)rcNt)) 294 277 return (NTSTATUS)rcNt; 295 #ifndef VBOX_BUGREF_9217296 RT_NOREF(pVCpu);297 #endif298 278 return STATUS_UNSUCCESSFUL; 299 279 } … … 363 343 rc = SUPR0IoCtlSetupForHandle(pGVM->pSession, pVM->nem.s.hPartitionDevice, 0, &pGVM->nemr0.s.pIoCtlCtx); 364 344 AssertLogRelRCReturn(rc, rc); 365 #ifdef VBOX_BUGREF_9217366 345 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) 367 346 { … … 369 348 pGVCpu->nemr0.s.offRing3ConversionDelta = (uintptr_t)pGVM->aCpus[idCpu].pVCpuR3 - (uintptr_t)pGVCpu; 370 349 } 371 #else372 pGVM->nemr0.s.offRing3ConversionDelta = (uintptr_t)pVM->pVMR3 - (uintptr_t)pGVM->pVM;373 #endif374 350 375 351 /* 376 352 * Get the partition ID. 377 353 */ 378 #ifdef VBOX_BUGREF_9217379 354 PVMCPUCC pVCpu0 = &pGVM->aCpus[0]; 380 #else381 PVMCPUCC pVCpu0 = &pGVM->pVM->aCpus[0];382 #endif383 355 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu0, pGVM->nemr0.s.IoCtlGetHvPartitionId.uFunction, NULL, 0, 384 356 &pVCpu0->nem.s.uIoCtlBuf.idPartition, sizeof(pVCpu0->nem.s.uIoCtlBuf.idPartition)); … … 650 622 NEM_TMPL_STATIC int nemR0WinExportState(PGVM pGVM, PGVMCPU pGVCpu, PCPUMCTX pCtx) 651 623 { 652 #ifdef VBOX_BUGREF_9217653 624 PVMCPUCC pVCpu = pGVCpu; 654 #else655 PVMCPUCC pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu];656 #endif657 625 HV_INPUT_SET_VP_REGISTERS *pInput = (HV_INPUT_SET_VP_REGISTERS *)pGVCpu->nemr0.s.HypercallData.pbPage; 658 626 AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3); … … 1376 1344 AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3); 1377 1345 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); 1378 #ifdef VBOX_BUGREF_92171379 1346 Assert(pCtx == &pGVCpu->cpum.GstCtx); 1380 #else1381 Assert(pCtx == &pGVCpu->pVCpu->cpum.GstCtx);1382 #endif1383 1347 1384 1348 fWhat &= pCtx->fExtrn; … … 1548 1512 1549 1513 # ifdef LOG_ENABLED 1550 # ifdef VBOX_BUGREF_92171551 1514 const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pGVM); 1552 # else1553 const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pGVM->pVM);1554 # endif1555 1515 # endif 1556 1516 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) … … 1616 1576 * Copy information to the CPUM context. 1617 1577 */ 1618 # ifdef VBOX_BUGREF_92171619 1578 PVMCPUCC pVCpu = pGVCpu; 1620 # else1621 PVMCPUCC pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu];1622 # endif1623 1579 iReg = 0; 1624 1580 … … 2490 2446 #ifdef NEM_WIN_WITH_RING0_RUNLOOP 2491 2447 if (pGVM->nemr0.s.fMayUseRing0Runloop) 2492 # ifdef VBOX_BUGREF_92172493 2448 return nemHCWinRunGC(pGVM, &pGVM->aCpus[idCpu], pGVM, &pGVM->aCpus[idCpu]); 2494 # else2495 {2496 PVMCC pVM = pGVM->pVM;2497 return nemHCWinRunGC(pVM, &pVM->aCpus[idCpu], pGVM, &pGVM->aCpus[idCpu]);2498 }2499 # endif2500 2449 return VERR_NEM_RING3_ONLY; 2501 2450 #else -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r80333 r80334 458 458 { 459 459 PDMDEV_ASSERT_DEVINS(pDevIns); 460 #ifdef VBOX_BUGREF_9217 461 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 460 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 462 461 PVMCPUCC pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */ 463 #else464 PVMCC pVM = pDevIns->Internal.s.pVMR0;465 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); /* for PIC we always deliver to CPU 0, MP use APIC */466 #endif467 462 /** @todo r=ramshankar: Propagating rcRZ and make all callers handle it? */ 468 463 APICLocalInterrupt(pVCpu, 0 /* u8Pin */, 1 /* u8Level */, VINF_SUCCESS /* rcRZ */); … … 474 469 { 475 470 PDMDEV_ASSERT_DEVINS(pDevIns); 476 #ifdef VBOX_BUGREF_9217 477 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 471 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 478 472 PVMCPUCC pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */ 479 #else480 PVMCC pVM = pDevIns->Internal.s.pVMR0;481 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); /* for PIC we always deliver to CPU 0, MP use APIC */482 #endif483 473 /** @todo r=ramshankar: Propagating rcRZ and make all callers handle it? */ 484 474 APICLocalInterrupt(pVCpu, 0 /* u8Pin */, 0 /* u8Level */, VINF_SUCCESS /* rcRZ */); -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r80333 r80334 78 78 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */ 79 79 AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER); 80 #ifdef VBOX_BUGREF_921781 80 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 82 #else83 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu));84 #endif85 81 86 82 /* … … 205 201 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */ 206 202 AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER); 207 #ifdef VBOX_BUGREF_9217208 203 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 209 #else210 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu));211 #endif212 204 213 205 /* … … 249 241 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID); /* caller already checked this, but just to be sure. */ 250 242 AssertReturn(pGVM->aCpus[idCpu].hEMT == RTThreadNativeSelf(), VERR_NOT_OWNER); 251 #ifdef VBOX_BUGREF_9217252 243 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 253 #else254 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu));255 #endif256 244 Assert(!pVM->pgm.s.cLargeHandyPages); 257 245 -
trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
r80333 r80334 51 51 VMMR0DECL(int) PGMR0SharedModuleCheck(PVMCC pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PCRTGCPTR64 paRegionsGCPtrs) 52 52 { 53 #ifdef VBOX_BUGREF_9217 54 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 55 #else 56 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 57 #endif 53 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 58 54 int rc = VINF_SUCCESS; 59 55 bool fFlushTLBs = false; … … 167 163 168 164 if (fFlushRemTLBs) 169 #ifdef VBOX_BUGREF_9217170 165 for (VMCPUID idCurCpu = 0; idCurCpu < pGVM->cCpus; idCurCpu++) 171 166 CPUMSetChangedFlags(&pGVM->aCpus[idCurCpu], CPUM_CHANGED_GLOBAL_TLB_FLUSH); 172 #else173 for (VMCPUID idCurCpu = 0; idCurCpu < pVM->cCpus; idCurCpu++)174 CPUMSetChangedFlags(VMCC_GET_CPU(pVM, idCurCpu), CPUM_CHANGED_GLOBAL_TLB_FLUSH);175 #endif176 167 177 168 return rc; -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r80333 r80334 395 395 * Register the EMT R0 logger instance for VCPU 0. 396 396 */ 397 #ifdef VBOX_BUGREF_9217398 PVMCPUCC pVCpu = &pGVM->aCpus[0];399 #else400 397 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); 401 #endif402 398 403 399 PVMMR0LOGGER pR0Logger = pVCpu->vmm.s.pR0LoggerR0; … … 475 471 { 476 472 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 477 #ifdef VBOX_BUGREF_9217478 473 rc = EMR0InitVM(pGVM); 479 #else480 rc = EMR0InitVM(pGVM, pVM);481 #endif482 474 if (RT_SUCCESS(rc)) 483 475 { … … 544 536 * Registration of ring 0 loggers. 545 537 */ 546 #ifdef VBOX_BUGREF_9217547 538 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 548 #else549 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu);550 #endif551 539 PVMMR0LOGGER pR0Logger = pVCpu->vmm.s.pR0LoggerR0; 552 540 if ( pR0Logger … … 729 717 static int vmmR0DoHalt(PGVM pGVM, PVMCC pVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu) 730 718 { 731 #ifdef VBOX_BUGREF_9217732 719 Assert(pVCpu == pGVCpu); 733 #else734 Assert(pVCpu == pGVCpu->pVCpu);735 #endif736 720 737 721 /* … … 1309 1293 } 1310 1294 1311 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 1312 #ifdef VBOX_BUGREF_9217 1295 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 1313 1296 PVMCPUCC pVCpu = pGVCpu; 1314 #else1315 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu);1316 #endif1317 1297 RTNATIVETHREAD const hNativeThread = RTThreadNativeSelf(); 1318 1298 if (RT_LIKELY( pGVCpu->hEMT == hNativeThread … … 1632 1612 } 1633 1613 1634 #ifdef VBOX_BUGREF_92171635 1614 if (RT_LIKELY(pGVM == pVM)) 1636 #else1637 if (RT_LIKELY(pGVM->pVM == pVM))1638 #endif1639 1615 { /* likely */ } 1640 1616 else 1641 1617 { 1642 #ifdef VBOX_BUGREF_92171643 1618 SUPR0Printf("vmmR0EntryExWorker: pVM mismatch: got %p, pGVM/pVM=%p\n", pVM, pGVM); 1644 #else1645 SUPR0Printf("vmmR0EntryExWorker: pVM mismatch: got %p, pGVM->pVM=%p\n", pVM, pGVM->pVM);1646 #endif1647 1619 return VERR_INVALID_PARAMETER; 1648 1620 } … … 1656 1628 } 1657 1629 1658 #ifdef VBOX_BUGREF_92171659 1630 if (RT_LIKELY( pVM->enmVMState >= VMSTATE_CREATING 1660 1631 && pVM->enmVMState <= VMSTATE_TERMINATED … … 1662 1633 && pVM->pSession == pSession 1663 1634 && pVM->pSelf == pVM)) 1664 #else1665 if (RT_LIKELY( pVM->enmVMState >= VMSTATE_CREATING1666 && pVM->enmVMState <= VMSTATE_TERMINATED1667 && pVM->cCpus == pGVM->cCpus1668 && pVM->pSession == pSession1669 && pVM->pVMR0 == pVM))1670 #endif1671 1635 { /* likely */ } 1672 1636 else 1673 1637 { 1674 #ifdef VBOX_BUGREF_92171675 1638 SUPR0Printf("vmmR0EntryExWorker: Invalid pVM=%p:{.enmVMState=%d, .cCpus=%#x(==%#x), .pSession=%p(==%p), .pSelf=%p(==%p)}! (op=%d)\n", 1676 1639 pVM, pVM->enmVMState, pVM->cCpus, pGVM->cCpus, pVM->pSession, pSession, pVM->pSelf, pVM, enmOperation); 1677 #else1678 SUPR0Printf("vmmR0EntryExWorker: Invalid pVM=%p:{.enmVMState=%d, .cCpus=%#x(==%#x), .pSession=%p(==%p), .pVMR0=%p(==%p)}! (op=%d)\n",1679 pVM, pVM->enmVMState, pVM->cCpus, pGVM->cCpus, pVM->pSession, pSession, pVM->pVMR0, pVM, enmOperation);1680 #endif1681 1640 return VERR_INVALID_POINTER; 1682 1641 } … … 2294 2253 && idCpu < pGVM->cCpus 2295 2254 && pVM->pSession == pSession 2296 #ifdef VBOX_BUGREF_9217 2297 && pVM->pSelf != NULL 2298 #else 2299 && pVM->pVMR0 != NULL 2300 #endif 2301 ) 2255 && pVM->pSelf != NULL) 2302 2256 { 2303 2257 switch (enmOperation) … … 2313 2267 case VMMR0_DO_VMMR0_TERM: 2314 2268 { 2315 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2316 #ifdef VBOX_BUGREF_9217 2269 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2317 2270 PVMCPUCC pVCpu = pGVCpu; 2318 #else2319 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu);2320 #endif2321 2271 RTNATIVETHREAD hNativeThread = RTThreadNativeSelf(); 2322 2272 if (RT_LIKELY( pGVCpu->hEMT == hNativeThread … … 2408 2358 2409 2359 PVMCC pVM = pR0Logger->pVM; 2410 if ( !VALID_PTR(pVM) 2411 # ifdef VBOX_BUGREF_9217 2412 || pVM->pSelf != pVM 2413 # else 2414 || pVM->pVMR0 != pVM 2415 # endif 2416 ) 2360 if ( !VALID_PTR(pVM) 2361 || pVM->pSelf != pVM) 2417 2362 { 2418 2363 # ifdef DEBUG 2419 # ifdef VBOX_BUGREF_92172420 2364 SUPR0Printf("vmmR0LoggerFlush: pVM=%p! pSelf=%p! pLogger=%p\n", pVM, pVM->pSelf, pLogger); 2421 # else2422 SUPR0Printf("vmmR0LoggerFlush: pVM=%p! pVMR0=%p! pLogger=%p\n", pVM, pVM->pVMR0, pLogger);2423 # endif2424 2365 # endif 2425 2366 return; … … 2510 2451 if (pGVCpu) 2511 2452 { 2512 #ifdef VBOX_BUGREF_92172513 2453 PVMCPUCC pVCpu = pGVCpu; 2514 #else2515 PVMCPUCC pVCpu = pGVCpu->pVCpu;2516 #endif2517 2454 if (RT_VALID_PTR(pVCpu)) 2518 2455 { … … 2521 2458 { 2522 2459 if ( pVmmLogger->fCreated 2523 #ifdef VBOX_BUGREF_9217 2524 && pVmmLogger->pVM == pGVCpu->pGVM 2525 #else 2526 && pVmmLogger->pVM == pGVCpu->pVM 2527 #endif 2528 ) 2460 && pVmmLogger->pVM == pGVCpu->pGVM) 2529 2461 { 2530 2462 if (pVmmLogger->Logger.fFlags & RTLOGFLAGS_DISABLED) -
trunk/src/VBox/VMM/VMMR3/MMHyper.cpp
r80333 r80334 157 157 AssertCompileSizeAlignment(VM, PAGE_SIZE); 158 158 AssertCompileSizeAlignment(VMCPU, PAGE_SIZE); 159 #ifdef VBOX_BUGREF_9217160 159 AssertCompileSizeAlignment(GVM, PAGE_SIZE); 161 160 AssertCompileSizeAlignment(GVMCPU, PAGE_SIZE); 162 161 AssertRelease(pVM->cbSelf == sizeof(VM)); 163 162 AssertRelease(pVM->cbVCpu == sizeof(VMCPU)); 163 /** @todo get rid of this */ 164 164 RTGCPTR GCPtr; 165 165 rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0ForCall, sizeof(VM) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM", &GCPtr); … … 172 172 sizeof(VMCPU) >> PAGE_SHIFT, &pVM->paVMPagesR3[offPages], "VMCPU", &GCPtrIgn); 173 173 } 174 #else175 AssertRelease(pVM->cbSelf >= sizeof(VMCPU));176 RTGCPTR GCPtr;177 rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0,178 RT_ALIGN_Z(pVM->cbSelf, PAGE_SIZE) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM",179 &GCPtr);180 #endif181 174 if (RT_SUCCESS(rc)) 182 175 { … … 894 887 //pHeap->pbHeapRC = 0; // set by mmR3HyperHeapMap() 895 888 pHeap->pVMR3 = pVM; 896 #ifdef VBOX_BUGREF_9217897 889 pHeap->pVMR0 = pVM->pVMR0ForCall; 898 #else899 pHeap->pVMR0 = pVM->pVMR0;900 #endif901 890 pHeap->pVMRC = pVM->pVMRC; 902 891 pHeap->cbHeap = cbAligned - MMYPERHEAP_HDR_SIZE; -
trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp
r80333 r80334 179 179 pCritSect->Core.NativeThreadOwner = NIL_RTNATIVETHREAD; 180 180 pCritSect->pVMR3 = pVM; 181 #ifdef VBOX_BUGREF_9217182 181 pCritSect->pVMR0 = pVM->pVMR0ForCall; 183 #else184 pCritSect->pVMR0 = pVM->pVMR0;185 #endif186 182 pCritSect->pVMRC = pVM->pVMRC; 187 183 pCritSect->pvKey = pvKey; … … 280 276 #endif 281 277 pCritSect->pVMR3 = pVM; 282 #ifdef VBOX_BUGREF_9217283 278 pCritSect->pVMR0 = pVM->pVMR0ForCall; 284 #else285 pCritSect->pVMR0 = pVM->pVMR0;286 #endif287 279 pCritSect->pVMRC = pVM->pVMRC; 288 280 pCritSect->pvKey = pvKey; -
trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp
r80333 r80334 330 330 pDevIns->Internal.s.pDevR3 = paDevs[i].pDev; 331 331 pDevIns->Internal.s.pVMR3 = pVM; 332 #ifdef VBOX_BUGREF_9217333 332 pDevIns->Internal.s.pVMR0 = pVM->pVMR0ForCall; 334 #else335 pDevIns->Internal.s.pVMR0 = pVM->pVMR0;336 #endif337 333 pDevIns->Internal.s.pVMRC = pVM->pVMRC; 338 334 //pDevIns->Internal.s.pLunsR3 = NULL; -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r80333 r80334 722 722 pNew->Internal.s.pDrv = pDrv; 723 723 pNew->Internal.s.pVMR3 = pVM; 724 #ifdef VBOX_BUGREF_9217725 724 pNew->Internal.s.pVMR0 = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0 ? pVM->pVMR0ForCall : NIL_RTR0PTR; 726 #else727 pNew->Internal.s.pVMR0 = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0 ? pVM->pVMR0 : NIL_RTR0PTR;728 #endif729 725 pNew->Internal.s.pVMRC = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC ? pVM->pVMRC : NIL_RTRCPTR; 730 726 //pNew->Internal.s.fDetaching = false; -
trunk/src/VBox/VMM/VMMR3/PDMQueue.cpp
r80333 r80334 88 88 */ 89 89 pQueue->pVMR3 = pVM; 90 #ifdef VBOX_BUGREF_921791 90 pQueue->pVMR0 = fRZEnabled ? pVM->pVMR0ForCall : NIL_RTR0PTR; 92 #else93 pQueue->pVMR0 = fRZEnabled ? pVM->pVMR0 : NIL_RTR0PTR;94 #endif95 91 pQueue->pVMRC = fRZEnabled ? pVM->pVMRC : NIL_RTRCPTR; 96 92 pQueue->pszName = pszName; -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r80333 r80334 239 239 */ 240 240 pPool->pVMR3 = pVM; 241 #ifdef VBOX_BUGREF_9217242 241 pPool->pVMR0 = pVM->pVMR0ForCall; 243 #else244 pPool->pVMR0 = pVM->pVMR0;245 #endif246 242 pPool->cMaxPages = cMaxPages; 247 243 pPool->cCurPages = PGMPOOL_IDX_FIRST; -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r80333 r80334 1150 1150 { 1151 1151 pTimer->pVMRC = pVM->pVMRC; 1152 #ifdef VBOX_BUGREF_92171153 1152 pTimer->pVMR0 = pVM->pVMR0ForCall; /** @todo fix properly */ 1154 #else1155 pTimer->pVMR0 = pVM->pVMR0;1156 #endif1157 1153 } 1158 1154 } … … 1532 1528 pTimer->enmClock = enmClock; 1533 1529 pTimer->pVMR3 = pVM; 1534 #ifdef VBOX_BUGREF_92171535 1530 pTimer->pVMR0 = pVM->pVMR0ForCall; /** @todo fix properly */ 1536 #else1537 pTimer->pVMR0 = pVM->pVMR0;1538 #endif1539 1531 pTimer->pVMRC = pVM->pVMRC; 1540 1532 pTimer->enmState = TMTIMERSTATE_STOPPED; -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r80333 r80334 582 582 PVM pVM = pUVM->pVM = CreateVMReq.pVMR3; 583 583 AssertRelease(VALID_PTR(pVM)); 584 #ifdef VBOX_BUGREF_9217585 584 AssertRelease(pVM->pVMR0ForCall == CreateVMReq.pVMR0); 586 #else587 AssertRelease(pVM->pVMR0 == CreateVMReq.pVMR0);588 #endif589 585 AssertRelease(pVM->pSession == pUVM->vm.s.pSession); 590 586 AssertRelease(pVM->cCpus == cCpus); -
trunk/src/VBox/VMM/include/NEMInternal.h
r80281 r80334 361 361 /** Hypercall input/ouput page. */ 362 362 NEMR0HYPERCALLDATA HypercallData; 363 # ifdef VBOX_BUGREF_9217364 363 /** Delta to add to convert a ring-0 pointer to a ring-3 one. */ 365 364 uintptr_t offRing3ConversionDelta; 366 # endif367 365 # else 368 366 uint32_t uDummy; … … 380 378 /** I/O control context. */ 381 379 PSUPR0IOCTLCTX pIoCtlCtx; 382 # ifndef VBOX_BUGREF_9217383 /** Delta to add to convert a ring-0 pointer to a ring-3 one. */384 uintptr_t offRing3ConversionDelta;385 # endif386 380 /** Info about the VidGetHvPartitionId I/O control interface. */ 387 381 NEMWINIOCTL IoCtlGetHvPartitionId; -
trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
r80284 r80334 57 57 void *pvVM = NULL; 58 58 RTR0PTR pvR0 = NIL_RTR0PTR; 59 #ifdef VBOX_BUGREF_921760 59 SUPPAGE aPages[(sizeof(GVM) + NUM_CPUS * sizeof(GVMCPU)) >> PAGE_SHIFT]; 61 #else62 SUPPAGE aPages[(sizeof(VM) + NUM_CPUS * sizeof(VMCPU)) >> PAGE_SHIFT];63 #endif64 60 rc = SUPR3Init(NULL); 65 61 if (RT_FAILURE(rc)) … … 77 73 PVM pVM = (PVM)pvVM; 78 74 pVM->paVMPagesR3 = aPages; 79 #ifdef VBOX_BUGREF_921780 75 pVM->pVMR0ForCall = pvR0; 81 #else82 pVM->pVMR0 = pvR0;83 #endif84 76 85 77 PUVM pUVM = (PUVM)RTMemPageAllocZ(RT_ALIGN_Z(sizeof(*pUVM), PAGE_SIZE)); … … 94 86 95 87 pVM->cCpus = NUM_CPUS; 96 #ifdef VBOX_BUGREF_921797 88 pVM->cbSelf = sizeof(VM); 98 89 pVM->cbVCpu = sizeof(VMCPU); … … 103 94 pVCpu = (PVMCPU)((uintptr_t)pVCpu + sizeof(GVMCPU)); 104 95 } 105 #else106 pVM->cbSelf = RT_UOFFSETOF_DYN(VM, aCpus[pVM->cCpus]);107 for (VMCPUID idCpu = 0; idCpu < NUM_CPUS; idCpu++)108 pVM->apCpusR3[idCpu] = &pVM->aCpus[idCpu];109 #endif110 96 111 97 rc = STAMR3InitUVM(pUVM); -
trunk/src/VBox/VMM/testcase/tstSSM.cpp
r80282 r80334 652 652 * Allocate and init the VM structure. 653 653 */ 654 #ifdef VBOX_BUGREF_9217655 654 PVM pVM = (PVM)RTMemPageAllocZ(sizeof(VM) + sizeof(VMCPU)); 656 655 rc = pVM ? VINF_SUCCESS : VERR_NO_PAGE_MEMORY; 657 #else658 PVM pVM;659 size_t cbVM = RT_ALIGN_Z(sizeof(*pVM), PAGE_SIZE);660 rc = SUPR3PageAlloc(cbVM >> PAGE_SHIFT, (void **)&pVM);661 #endif662 656 if (RT_SUCCESS(rc)) 663 657 { … … 667 661 pVM->cCpus = 1; 668 662 669 #ifdef VBOX_BUGREF_9217670 663 PVMCPU pVCpu = (PVMCPU)(pVM + 1); 671 #else672 PVMCPU pVCpu = &pVM->aCpus[0];673 #endif674 664 pVCpu->pVMR3 = pVM; 675 665 pVCpu->hNativeThread = RTThreadNativeSelf(); -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r80281 r80334 1419 1419 GEN_CHECK_OFF(VM, pUVM); 1420 1420 GEN_CHECK_OFF(VM, pVMR3); 1421 #ifdef VBOX_BUGREF_92171422 1421 GEN_CHECK_OFF(VM, pVMR0ForCall); 1423 #else1424 GEN_CHECK_OFF(VM, pVMR0);1425 #endif1426 1422 GEN_CHECK_OFF(VM, pVMRC); 1427 #if defined(VBOX_BUGREF_9217) && defined(IN_RING0)1423 #ifdef IN_RING0 1428 1424 GEN_CHECK_OFF(VM, hSelfUnsafe); 1429 1425 GEN_CHECK_OFF(VM, cCpusUnsafe); … … 1463 1459 GEN_CHECK_OFF(VM, cfgm); 1464 1460 GEN_CHECK_OFF(VM, apic); 1465 #ifndef VBOX_BUGREF_92171466 GEN_CHECK_OFF(VM, aCpus);1467 #endif1468 1461 1469 1462 … … 1473 1466 GEN_CHECK_OFF(VMCPU, pUVCpu); 1474 1467 GEN_CHECK_OFF(VMCPU, pVMR3); 1475 #ifndef VBOX_BUGREF_9217 1476 GEN_CHECK_OFF(VMCPU, pVMR0); 1477 #endif 1468 GEN_CHECK_OFF(VMCPU, pVCpuR0ForVtg); 1478 1469 GEN_CHECK_OFF(VMCPU, pVMRC); 1479 1470 GEN_CHECK_OFF(VMCPU, idCpu); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r80281 r80334 254 254 255 255 PVM pVM = NULL; NOREF(pVM); 256 #ifndef VBOX_BUGREF_9217257 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0], PAGE_SIZE);258 CHECK_MEMBER_ALIGNMENT(VM, aCpus[1], PAGE_SIZE);259 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].cpum.s.Host, 64);260 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].cpum.s.Guest, 64);261 CHECK_MEMBER_ALIGNMENT(VM, aCpus[1].cpum.s.Host, 64);262 CHECK_MEMBER_ALIGNMENT(VM, aCpus[1].cpum.s.Guest, 64);263 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].cpum.s.Hyper, 64);264 CHECK_MEMBER_ALIGNMENT(VM, aCpus[1].cpum.s.Hyper, 64);265 # ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI266 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].cpum.s.pvApicBase, 8);267 # endif268 269 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].iem.s.DataTlb, 64);270 CHECK_MEMBER_ALIGNMENT(VM, aCpus[0].iem.s.CodeTlb, 64);271 #endif272 256 273 257 CHECK_MEMBER_ALIGNMENT(VMCPU, vmm.s.u64CallRing3Arg, 8); … … 284 268 285 269 /* the VMCPUs are page aligned TLB hit reasons. */ 286 #ifndef VBOX_BUGREF_9217287 CHECK_MEMBER_ALIGNMENT(VM, aCpus, 4096);288 #endif289 270 CHECK_SIZE_ALIGNMENT(VMCPU, 4096); 290 271
Note:
See TracChangeset
for help on using the changeset viewer.