Changeset 1352 in vbox for trunk/src/VBox/VMM/PATM/VMMGC
- Timestamp:
- Mar 9, 2007 9:35:15 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
r23 r1352 76 76 Assert(pPATMGCState->fPIF || fPatchCode); 77 77 /** When patch code is executing instructions that must complete, then we must *never* interrupt it. */ 78 if (!pPATMGCState->fPIF && fPatchCode) 78 if (!pPATMGCState->fPIF && fPatchCode) 79 79 { 80 80 Log(("CSAMGCCodePageWriteHandler: fPIF=0 -> stack fault in patch generated code at %VGv!\n", pRegFrame->eip)); … … 91 91 } 92 92 93 Log(("CSAMGCCodePageWriteHandler: code page write at %VGv original address %VGv\n", pvFault, (RTGCUINTPTR)pvRange + offRange)); 94 rc = PATMGCHandleWriteToPatchPage(pVM, pRegFrame, (RTGCPTR)((RTGCUINTPTR)pvRange + offRange), 4 /** @todo */); 95 if (rc == VINF_SUCCESS) 96 return rc; 97 if (rc == VINF_EM_RAW_EMULATE_INSTR) 93 uint32_t cpl; 94 95 if (pRegFrame->eflags.Bits.u1VM) 96 cpl = 3; 97 else 98 cpl = (pRegFrame->ss & X86_SEL_RPL); 99 100 Log(("CSAMGCCodePageWriteHandler: code page write at %VGv original address %VGv (cpl=%d)\n", pvFault, (RTGCUINTPTR)pvRange + offRange, cpl)); 101 102 /* If user code is modifying one of our monitored pages, then we can safely make it r/w as it's no longer being used for supervisor code. */ 103 if (cpl != 3) 98 104 { 99 STAM_COUNTER_INC(&pVM->csam.s.StatDangerousWrite); 100 return VINF_EM_RAW_EMULATE_INSTR; 105 rc = PATMGCHandleWriteToPatchPage(pVM, pRegFrame, (RTGCPTR)((RTGCUINTPTR)pvRange + offRange), 4 /** @todo */); 106 if (rc == VINF_SUCCESS) 107 return rc; 108 if (rc == VINF_EM_RAW_EMULATE_INSTR) 109 { 110 STAM_COUNTER_INC(&pVM->csam.s.StatDangerousWrite); 111 return VINF_EM_RAW_EMULATE_INSTR; 112 } 113 Assert(rc == VERR_PATCH_NOT_FOUND); 101 114 } 102 Assert(rc == VERR_PATCH_NOT_FOUND); 115 103 116 VM_FF_SET(pVM, VM_FF_CSAM_FLUSH_DIRTY_PAGE); 104 117
Note:
See TracChangeset
for help on using the changeset viewer.