Changeset 58283 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Oct 16, 2015 3:20:38 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIM.cpp
r58248 r58283 89 89 */ 90 90 AssertCompile(sizeof(pVM->gim.s) <= sizeof(pVM->gim.padding)); 91 AssertCompile(sizeof(pVM->aCpus[0].gim.s) <= sizeof(pVM->aCpus[0].gim.padding)); 92 91 93 92 94 /* -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r58251 r58283 113 113 */ 114 114 rc = CFGMR3ValidateConfig(pCfgHv, "/HyperV/", 115 "VendorID", 115 "VendorID" 116 "|VSInterface", 116 117 "" /* pszValidNodes */, "GIM/HyperV" /* pszWho */, 0 /* uInstance */); 117 118 if (RT_FAILURE(rc)) … … 132 133 } 133 134 134 pHv->fIsInterfaceVs = true; 135 if (pHv->fIsVendorMsHv) 136 { 137 /** @cfgm{/GIM/HyperV/VSInterface, bool, true} 138 * The Microsoft virtualization service interface (debugging). */ 139 rc = CFGMR3QueryBoolDef(pCfgHv, "VSInterface", &pHv->fIsInterfaceVs, true); 140 AssertLogRelRCReturn(rc, rc); 141 } 142 else 143 Assert(pHv->fIsInterfaceVs == false); 135 144 136 145 /* … … 169 178 | GIM_HV_HINT_RELAX_TIME_CHECKS; 170 179 171 /* Expose more if we're posing as Microsoft. */172 if ( pHv->fIsVendorMsHv173 /*&& !pHv->fIsInterfaceVs*/)180 /* Expose more if we're posing as Microsoft. We can, if needed, force MSR-based Hv 181 debugging by not exposing these bits while exposing the VS interface.*/ 182 if (pHv->fIsVendorMsHv) 174 183 { 175 184 pHv->uMiscFeat |= GIM_HV_MISC_FEAT_GUEST_DEBUGGING … … 331 340 if (pHv->uMiscFeat & GIM_HV_MISC_FEAT_GUEST_CRASH_MSRS) 332 341 pHv->uCrashCtl = MSR_GIM_HV_CRASH_CTL_NOTIFY_BIT; 333 334 /* 335 * Setup guest-host hypercall based debugging support. 336 */ 337 if (pHv->uMiscFeat & GIM_HV_MISC_FEAT_GUEST_DEBUGGING) 338 { 339 rc = gimR3HvInitHypercallSupport(pVM); 340 AssertLogRelRCReturn(rc, rc); 341 } 342 for (VMCPUID i = 0; i < pVM->cCpus; i++) 343 pVM->aCpus[i].gim.s.u.HvCpu.uSint2Msr = MSR_GIM_HV_SINT_MASKED_BIT; 344 345 /* 346 * Setup hypercall support. 347 */ 348 rc = gimR3HvInitHypercallSupport(pVM); 349 AssertLogRelRCReturn(rc, rc); 342 350 343 351 return VINF_SUCCESS; … … 406 414 { 407 415 gimR3HvReset(pVM); 408 409 PGIMHV pHv = &pVM->gim.s.u.Hv; 410 if (pHv->uMiscFeat & GIM_HV_MISC_FEAT_GUEST_DEBUGGING) 411 gimR3HvTermHypercallSupport(pVM); 416 gimR3HvTermHypercallSupport(pVM); 412 417 return VINF_SUCCESS; 413 418 } … … 463 468 464 469 /* 465 * Reset MSRs (Careful! Don't reset non-zero MSRs).470 * Reset MSRs. 466 471 */ 467 472 pHv->u64GuestOsIdMsr = 0; … … 477 482 pHv->uDebugSendBufferMsr = 0; 478 483 pHv->uDebugRecvBufferMsr = 0; 484 for (VMCPUID i = 0; i < pVM->cCpus; i++) 485 { 486 PVMCPU pVCpu = &pVM->aCpus[i]; 487 pVCpu->gim.s.u.HvCpu.uSint2Msr = MSR_GIM_HV_SINT_MASKED_BIT; 488 pVCpu->gim.s.u.HvCpu.uSimpMsr = 0; 489 } 479 490 } 480 491 … … 1209 1220 * @returns VBox status code. 1210 1221 * @param pVM The cross context VM structure. 1211 * @param GCPhysOut Where to write the hypercall output parameters after1212 * performing the hypercall.1213 1222 * @param prcHv Where to store the result of the hypercall operation. 1214 1223 * 1215 1224 * @thread EMT. 1216 1225 */ 1217 VMMR3_INT_DECL(int) gimR3HvHypercallPostDebugData(PVM pVM, RTGCPHYS GCPhysOut,int *prcHv)1226 VMMR3_INT_DECL(int) gimR3HvHypercallPostDebugData(PVM pVM, int *prcHv) 1218 1227 { 1219 1228 AssertPtr(pVM); … … 1265 1274 * Update the guest memory with result. 1266 1275 */ 1267 int rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysOut, pHv->pbHypercallOut, sizeof(GIMHVDEBUGPOSTOUT));1276 int rc = PGMPhysSimpleWriteGCPhys(pVM, pHv->GCPhysHypercallOut, pHv->pbHypercallOut, sizeof(GIMHVDEBUGPOSTOUT)); 1268 1277 if (RT_FAILURE(rc)) 1269 1278 { … … 1282 1291 * @returns VBox status code. 1283 1292 * @param pVM The cross context VM structure. 1284 * @param GCPhysOut Where to write the hypercall output parameters after1285 * performing the hypercall.1286 1293 * @param prcHv Where to store the result of the hypercall operation. 1287 1294 * 1288 1295 * @thread EMT. 1289 1296 */ 1290 VMMR3_INT_DECL(int) gimR3HvHypercallRetrieveDebugData(PVM pVM, RTGCPHYS GCPhysOut,int *prcHv)1297 VMMR3_INT_DECL(int) gimR3HvHypercallRetrieveDebugData(PVM pVM, int *prcHv) 1291 1298 { 1292 1299 AssertPtr(pVM); … … 1345 1352 * Update the guest memory with result. 1346 1353 */ 1347 int rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysOut, pHv->pbHypercallOut, sizeof(GIMHVDEBUGRETRIEVEOUT) + *pcbReallyRead); 1354 int rc = PGMPhysSimpleWriteGCPhys(pVM, pHv->GCPhysHypercallOut, pHv->pbHypercallOut, 1355 sizeof(GIMHVDEBUGRETRIEVEOUT) + *pcbReallyRead); 1348 1356 if (RT_FAILURE(rc)) 1349 1357 {
Note:
See TracChangeset
for help on using the changeset viewer.