Changeset 20046 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 26, 2009 3:44:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r20038 r20046 1324 1324 /* Error code present? (redundant) */ 1325 1325 if (pVMCB->ctrl.ExitIntInfo.n.u1ErrorCodeValid) 1326 {1327 1326 pVCpu->hwaccm.s.Event.errCode = pVMCB->ctrl.ExitIntInfo.n.u32ErrorCode; 1328 }1329 1327 else 1330 1328 pVCpu->hwaccm.s.Event.errCode = 0; … … 1475 1473 if ( rc == VINF_SUCCESS 1476 1474 && Cpu.pCurInstr->opcode == OP_MOV 1477 && cbOp >= 5)1475 && (cbOp == 5 || cbOp == 6)) 1478 1476 { 1477 uint8_t szInstr[15]; 1479 1478 if ( (errCode & X86_TRAP_PF_RW) 1480 && Cpu.param1.disp32 == (uint32_t)uFaultAddress) 1479 && Cpu.param1.disp32 == (uint32_t)uFaultAddress 1480 && Cpu.param2.flags == USE_REG_GEN32) 1481 1481 { 1482 /* 0xF0, 0x0F, 0x22, 0xC0 = mov cr8, eax */ 1483 szInstr[0] = 0xF0; 1484 szInstr[1] = 0x0F; 1485 szInstr[2] = 0x22; 1486 szInstr[3] = 0xC0 | Cpu.param2.base.reg_gen; 1487 for (unsigned i = 4; i < cbOp; i++) 1488 szInstr[i] = 0x90; /* nop */ 1489 1490 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, szInstr, cbOp); 1491 AssertRC(rc); 1492 1482 1493 pVM->hwaccm.s.svm.fTPRPatching = true; 1483 1494 Log(("Acceptable write candidate!\n")); 1495 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatExit1, x); 1496 goto ResumeExecution; 1484 1497 } 1485 1498 else 1486 if (Cpu.param2.disp32 == (uint32_t)uFaultAddress) 1499 if ( Cpu.param2.disp32 == (uint32_t)uFaultAddress 1500 && Cpu.param1.flags == USE_REG_GEN32) 1487 1501 { 1502 /* 0xF0, 0x0F, 0x20, 0xC0 = mov eax, cr8 */ 1503 szInstr[0] = 0xF0; 1504 szInstr[1] = 0x0F; 1505 szInstr[2] = 0x20; 1506 szInstr[3] = 0xC0 | Cpu.param1.base.reg_gen; 1507 for (unsigned i = 4; i < cbOp; i++) 1508 szInstr[i] = 0x90; /* nop */ 1509 1510 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, szInstr, cbOp); 1511 AssertRC(rc); 1512 1488 1513 pVM->hwaccm.s.svm.fTPRPatching = true; 1489 1514 Log(("Acceptable read candidate!\n")); 1515 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatExit1, x); 1516 goto ResumeExecution; 1490 1517 } 1491 1518 } … … 1816 1843 1817 1844 /* Must be set by PGMSyncCR3 */ 1818 AssertMsg(rc == VINF_SUCCESS || PGMGetGuestMode(pVCpu) <= PGMMODE_PROTECTED || pVCpu->hwaccm.s.fForceTLBFlush,1845 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || PGMGetGuestMode(pVCpu) <= PGMMODE_PROTECTED || pVCpu->hwaccm.s.fForceTLBFlush, 1819 1846 ("rc=%Rrc mode=%d fForceTLBFlush=%RTbool\n", rc, PGMGetGuestMode(pVCpu), pVCpu->hwaccm.s.fForceTLBFlush)); 1820 1847 }
Note:
See TracChangeset
for help on using the changeset viewer.