Changeset 6911 in vbox
- Timestamp:
- Feb 11, 2008 10:00:13 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pgm.h
r6862 r6911 184 184 /** All access handled. */ 185 185 PGMVIRTHANDLERTYPE_ALL, 186 /** By eip - Natural traps only. */187 PGMVIRTHANDLERTYPE_EIP,188 186 /** Hypervisor write access handled. 189 187 * This is used to catch the guest trying to write to LDT, TSS and any other -
trunk/src/VBox/VMM/PGMHandler.cpp
r6902 r6911 285 285 case PGMVIRTHANDLERTYPE_ALL: 286 286 case PGMVIRTHANDLERTYPE_WRITE: 287 case PGMVIRTHANDLERTYPE_EIP:288 287 if (!pfnHandlerHC) 289 288 { … … 573 572 case PGMVIRTHANDLERTYPE_WRITE: pszType = "Write "; break; 574 573 case PGMVIRTHANDLERTYPE_ALL: pszType = "All "; break; 575 case PGMVIRTHANDLERTYPE_EIP: pszType = "EIP "; break;576 574 case PGMVIRTHANDLERTYPE_HYPERVISOR: pszType = "WriteHyp "; break; 577 575 default: pszType = "????"; break; -
trunk/src/VBox/VMM/PGMMap.cpp
r6862 r6911 1090 1090 switch (pCur->enmType) 1091 1091 { 1092 case PGMVIRTHANDLERTYPE_EIP:1093 RTLogPrintf("EIP %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc);1094 break;1095 1092 case PGMVIRTHANDLERTYPE_NORMAL: 1096 1093 RTLogPrintf("NORMAL %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc); -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r6902 r6911 199 199 PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)RTAvlroGCPtrRangeGet(&CTXSUFF(pVM->pgm.s.pTrees)->VirtHandlers, pvFault); 200 200 if ( pCur 201 && pCur->enmType != PGMVIRTHANDLERTYPE_EIP202 201 && (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb 203 202 && ( uErr & X86_TRAP_PF_RW … … 216 215 STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a); 217 216 return rc; 218 }219 220 /*221 * Check if the EIP is in a virtual page access handler range.222 */223 if (cpl == 0)224 {225 RTGCPTR pvEIP;226 rc = SELMValidateAndConvertCSAddr(pVM, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, (RTGCPTR)pRegFrame->eip, &pvEIP);227 if (VBOX_SUCCESS(rc))228 {229 PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)RTAvlroGCPtrRangeGet(&CTXSUFF(pVM->pgm.s.pTrees)->VirtHandlers, pvEIP);230 if ( pCur231 && pCur->enmType == PGMVIRTHANDLERTYPE_EIP232 && (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr < pCur->cb)233 {234 # ifdef IN_GC235 STAM_PROFILE_START(&pCur->Stat, h);236 rc = CTXSUFF(pCur->pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->GCPtr, (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr);237 STAM_PROFILE_STOP(&pCur->Stat, h);238 # else239 AssertFailed();240 rc = VINF_EM_RAW_EMULATE_INSTR; /* can't happen with VMX */241 # endif242 STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eMapHandler);243 STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);244 return rc;245 }246 }247 217 } 248 218 … … 412 382 ("Unexpected trap for virtual handler: %VGv (phys=%VGp) HCPhys=%HGp uErr=%X, enum=%d\n", pvFault, GCPhys, pPage->HCPhys, uErr, pCur->enmType)); 413 383 414 if ( pCur->enmType != PGMVIRTHANDLERTYPE_EIP 415 && (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb 384 if ( (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb 416 385 && ( uErr & X86_TRAP_PF_RW 417 386 || ( pCur->enmType != PGMVIRTHANDLERTYPE_WRITE … … 441 410 Assert(VBOX_SUCCESS(rc) || !pCur); 442 411 if ( pCur 443 && pCur->enmType != PGMVIRTHANDLERTYPE_EIP444 412 && ( uErr & X86_TRAP_PF_RW 445 413 || ( pCur->enmType != PGMVIRTHANDLERTYPE_WRITE … … 524 492 ("Unexpected trap for virtual handler: %08X (phys=%08x) HCPhys=%X uErr=%X, enum=%d\n", pvFault, GCPhys, pPage->HCPhys, uErr, pCur->enmType)); 525 493 526 if ( pCur->enmType != PGMVIRTHANDLERTYPE_EIP 527 && (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb 494 if ( (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb 528 495 && ( uErr & X86_TRAP_PF_RW 529 496 || ( pCur->enmType != PGMVIRTHANDLERTYPE_WRITE … … 759 726 760 727 # if PGM_WITH_PAGING(PGM_GST_TYPE) 761 /*762 * Check if it's in a EIP based virtual page access handler range.763 * This is only used for supervisor pages in flat mode.764 */765 /** @todo this stuff is completely broken by the out-of-sync stuff. since we don't use this stuff, that's not really a problem yet. */766 STAM_PROFILE_START(&pVM->pgm.s.StatEIPHandlers, d);767 if (cpl == 0)768 {769 RTGCPTR pvEIP;770 rc = SELMValidateAndConvertCSAddr(pVM, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid, (RTGCPTR)pRegFrame->eip, &pvEIP);771 if ( VBOX_SUCCESS(rc)772 && pvEIP == (RTGCPTR)pRegFrame->eip)773 {774 PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)RTAvlroGCPtrRangeGet(&CTXSUFF(pVM->pgm.s.pTrees)->VirtHandlers, pvEIP);775 if ( pCur776 && pCur->enmType == PGMVIRTHANDLERTYPE_EIP777 && (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr < pCur->cb)778 {779 LogFlow(("EIP handler\n"));780 # ifdef IN_GC781 STAM_PROFILE_START(&pCur->Stat, h);782 rc = CTXSUFF(pCur->pfnHandler)(pVM, uErr, pRegFrame, pvFault, pCur->GCPtr, (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr);783 STAM_PROFILE_STOP(&pCur->Stat, h);784 # else785 rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */786 # endif787 STAM_PROFILE_STOP(&pVM->pgm.s.StatEIPHandlers, d);788 return rc;789 }790 }791 }792 STAM_PROFILE_STOP(&pVM->pgm.s.StatEIPHandlers, d);793 794 728 /* 795 729 * Conclusion, this is a guest trap. -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r6764 r6911 659 659 switch (pCur->enmType) 660 660 { 661 case PGMVIRTHANDLERTYPE_EIP:662 661 case PGMVIRTHANDLERTYPE_NORMAL: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break; 663 662 case PGMVIRTHANDLERTYPE_WRITE: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break; -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r6908 r6911 1103 1103 switch (pCur->enmType) 1104 1104 { 1105 case PGMVIRTHANDLERTYPE_EIP:1106 1105 case PGMVIRTHANDLERTYPE_NORMAL: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break; 1107 1106 case PGMVIRTHANDLERTYPE_WRITE: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break; … … 1232 1231 switch (pCur->enmType) 1233 1232 { 1234 case PGMVIRTHANDLERTYPE_EIP:1235 1233 case PGMVIRTHANDLERTYPE_NORMAL: pState->fFlagsFound |= MM_RAM_FLAGS_VIRTUAL_HANDLER; break; 1236 1234 case PGMVIRTHANDLERTYPE_WRITE: pState->fFlagsFound |= MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break; … … 1276 1274 switch (pVirt->enmType) 1277 1275 { 1278 case PGMVIRTHANDLERTYPE_EIP:1279 1276 case PGMVIRTHANDLERTYPE_NORMAL: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break; 1280 1277 case PGMVIRTHANDLERTYPE_WRITE: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break;
Note:
See TracChangeset
for help on using the changeset viewer.