Changeset 55039 in vbox
- Timestamp:
- Mar 31, 2015 3:01:05 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99325
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GIMAllKvm.cpp
r55037 r55039 352 352 if (Dis.pCurInstr->uOpcode == OP_VMCALL) 353 353 { 354 Assert(cbInstr == 3); /* paranoia. */355 356 354 /* 357 355 * Patch the instruction to so we don't have to spend time disassembling it each time. 358 356 */ 359 static uint8_t s_abHypercall[3]; 360 size_t cbWritten; 361 rc = HMPatchHypercall(pVM, &s_abHypercall, sizeof(s_abHypercall), &cbWritten); 362 AssertRC(rc); 363 364 if (RT_LIKELY(cbWritten == cbInstr)) 365 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, &s_abHypercall, sizeof(s_abHypercall)); 366 if (RT_SUCCESS(rc)) 367 return gimKvmHypercall(pVCpu, pCtx); 357 static uint8_t s_abHypercall[3] = { 0x0F, 0x01, 0x00 }; 358 Assert(sizeof(s_abHypercall) == cbInstr); 359 if (!s_abHypercall[2]) 360 s_abHypercall[2] = ASMIsAmdCpu() ? 0xD9 /* VMMCALL */ : 0xC1 /* VMCALL */; 361 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, &s_abHypercall, sizeof(s_abHypercall)); 362 return VINF_SUCCESS; 368 363 } 369 364 } -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r55037 r55039 5227 5227 if ( pVM->hm.s.fTrapXcptUD 5228 5228 && GIMAreHypercallsEnabled(pVCpu)) 5229 { 5230 int rc = GIMXcptUD(pVCpu, pCtx); 5231 if (RT_SUCCESS(rc)) 5232 { 5233 /* If the exception handler changes anything other than guest general-purpose registers, 5234 we would need to reload the guest changed bits on VM-reentry. */ 5235 hmR0SvmUpdateRip(pVCpu, pCtx, 3); 5236 return VINF_SUCCESS; 5237 } 5238 } 5239 5240 hmR0SvmSetPendingXcptUD(pVCpu); 5229 GIMXcptUD(pVCpu, pCtx); 5230 else 5231 hmR0SvmSetPendingXcptUD(pVCpu); 5232 5241 5233 return VINF_SUCCESS; 5242 5234 }
Note:
See TracChangeset
for help on using the changeset viewer.