Changeset 3073 in vbox for trunk/src/VBox/VMM/PATM
- Timestamp:
- Jun 6, 2007 4:44:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/PATM.cpp
r3020 r3073 5978 5978 ) 5979 5979 { 5980 uint64_t fFlags; 5981 5980 5982 STAM_COUNTER_INC(&pVM->patm.s.StatPushTrap); 5983 5984 if (Cpu.pCurInstr->opcode == OP_PUSH) 5985 { 5986 rc = PGMShwGetPage(pVM, pCtx->esp, &fFlags, NULL); 5987 if ( rc == VINF_SUCCESS 5988 && ((fFlags & (X86_PTE_P|X86_PTE_RW)) == (X86_PTE_P|X86_PTE_RW)) ) 5989 { 5990 /* The stack address is fine, so the push argument is a pointer -> emulate this instruction */ 5991 5992 /* Reset the PATM stack. */ 5993 CTXSUFF(pVM->patm.s.pGCState)->Psp = PATM_STACK_SIZE; 5994 5995 pVM->patm.s.pGCStateHC->fPIF = 1; 5996 5997 Log(("Faulting push -> go back to the original instruction\n")); 5998 5999 /* continue at the original instruction */ 6000 *ppNewEip = pNewEip - SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, 0); 6001 STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a); 6002 return VINF_SUCCESS; 6003 } 6004 } 6005 5981 6006 /* Typical pushf (most patches)/push (call patch) trap because of a monitored page. */ 5982 6007 rc = PGMShwModifyPage(pVM, pCtx->esp, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW); … … 5984 6009 if (rc == VINF_SUCCESS) 5985 6010 { 5986 uint64_t fFlags;5987 6011 5988 6012 /* The guest page *must* be present. */ … … 6041 6065 } 6042 6066 6043 *ppNewEip = pNewEip ;6067 *ppNewEip = pNewEip - SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, 0); 6044 6068 STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a); 6045 6069 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.