VirtualBox

Changeset 6911 in vbox


Ignore:
Timestamp:
Feb 11, 2008 10:00:13 PM (17 years ago)
Author:
vboxsync
Message:

Removed the EIP (PGMVIRTHANDLERTYPE_EIP) kind of virtual access handlers. This type have never been used, isn't working right, and is just messing up the code.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pgm.h

    r6862 r6911  
    184184    /** All access handled. */
    185185    PGMVIRTHANDLERTYPE_ALL,
    186     /** By eip - Natural traps only. */
    187     PGMVIRTHANDLERTYPE_EIP,
    188186    /** Hypervisor write access handled.
    189187     * This is used to catch the guest trying to write to LDT, TSS and any other
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r6902 r6911  
    285285        case PGMVIRTHANDLERTYPE_ALL:
    286286        case PGMVIRTHANDLERTYPE_WRITE:
    287         case PGMVIRTHANDLERTYPE_EIP:
    288287            if (!pfnHandlerHC)
    289288            {
     
    573572        case PGMVIRTHANDLERTYPE_WRITE:  pszType = "Write  "; break;
    574573        case PGMVIRTHANDLERTYPE_ALL:    pszType = "All    "; break;
    575         case PGMVIRTHANDLERTYPE_EIP:    pszType = "EIP    "; break;
    576574        case PGMVIRTHANDLERTYPE_HYPERVISOR: pszType = "WriteHyp "; break;
    577575        default:                        pszType = "????"; break;
  • trunk/src/VBox/VMM/PGMMap.cpp

    r6862 r6911  
    10901090    switch (pCur->enmType)
    10911091    {
    1092         case PGMVIRTHANDLERTYPE_EIP:
    1093             RTLogPrintf("EIP      %RGv-%RGv size %RGv %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->cb, pCur->pszDesc);
    1094             break;
    10951092        case PGMVIRTHANDLERTYPE_NORMAL:
    10961093            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  
    199199                PPGMVIRTHANDLER pCur = (PPGMVIRTHANDLER)RTAvlroGCPtrRangeGet(&CTXSUFF(pVM->pgm.s.pTrees)->VirtHandlers, pvFault);
    200200                if (    pCur
    201                     &&  pCur->enmType != PGMVIRTHANDLERTYPE_EIP
    202201                    &&  (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb
    203202                    &&  (    uErr & X86_TRAP_PF_RW
     
    216215                    STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);
    217216                    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 (    pCur
    231                             &&  pCur->enmType == PGMVIRTHANDLERTYPE_EIP
    232                             &&  (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr < pCur->cb)
    233                         {
    234 #  ifdef IN_GC
    235                             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 #  else
    239                             AssertFailed();
    240                             rc = VINF_EM_RAW_EMULATE_INSTR; /* can't happen with VMX */
    241 #  endif
    242                             STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eMapHandler);
    243                             STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);
    244                             return rc;
    245                         }
    246                     }
    247217                }
    248218
     
    412382                                      ("Unexpected trap for virtual handler: %VGv (phys=%VGp) HCPhys=%HGp uErr=%X, enum=%d\n", pvFault, GCPhys, pPage->HCPhys, uErr, pCur->enmType));
    413383
    414                             if (    pCur->enmType != PGMVIRTHANDLERTYPE_EIP
    415                                 &&  (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb
     384                            if (    (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb
    416385                                &&  (    uErr & X86_TRAP_PF_RW
    417386                                     ||  (   pCur->enmType != PGMVIRTHANDLERTYPE_WRITE
     
    441410                            Assert(VBOX_SUCCESS(rc) || !pCur);
    442411                            if (    pCur
    443                                 &&  pCur->enmType != PGMVIRTHANDLERTYPE_EIP
    444412                                &&  (   uErr & X86_TRAP_PF_RW
    445413                                    ||  (   pCur->enmType != PGMVIRTHANDLERTYPE_WRITE
     
    524492                                  ("Unexpected trap for virtual handler: %08X (phys=%08x) HCPhys=%X uErr=%X, enum=%d\n", pvFault, GCPhys, pPage->HCPhys, uErr, pCur->enmType));
    525493
    526                         if (    pCur->enmType != PGMVIRTHANDLERTYPE_EIP
    527                             &&  (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb
     494                        if (    (RTGCUINTPTR)pvFault - (RTGCUINTPTR)pCur->GCPtr < pCur->cb
    528495                            &&  (    uErr & X86_TRAP_PF_RW
    529496                                 ||  (   pCur->enmType != PGMVIRTHANDLERTYPE_WRITE
     
    759726
    760727# 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 (    pCur
    776                 &&  pCur->enmType == PGMVIRTHANDLERTYPE_EIP
    777                 &&  (RTGCUINTPTR)pvEIP - (RTGCUINTPTR)pCur->GCPtr < pCur->cb)
    778             {
    779                 LogFlow(("EIP handler\n"));
    780 #  ifdef IN_GC
    781                 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 #  else
    785                 rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */
    786 #  endif
    787                 STAM_PROFILE_STOP(&pVM->pgm.s.StatEIPHandlers, d);
    788                 return rc;
    789             }
    790         }
    791     }
    792     STAM_PROFILE_STOP(&pVM->pgm.s.StatEIPHandlers, d);
    793 
    794728    /*
    795729     * Conclusion, this is a guest trap.
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r6764 r6911  
    659659    switch (pCur->enmType)
    660660    {
    661         case PGMVIRTHANDLERTYPE_EIP:
    662661        case PGMVIRTHANDLERTYPE_NORMAL:     fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break;
    663662        case PGMVIRTHANDLERTYPE_WRITE:      fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break;
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r6908 r6911  
    11031103    switch (pCur->enmType)
    11041104    {
    1105         case PGMVIRTHANDLERTYPE_EIP:
    11061105        case PGMVIRTHANDLERTYPE_NORMAL: fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break;
    11071106        case PGMVIRTHANDLERTYPE_WRITE:  fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break;
     
    12321231            switch (pCur->enmType)
    12331232            {
    1234                 case PGMVIRTHANDLERTYPE_EIP:
    12351233                case PGMVIRTHANDLERTYPE_NORMAL:     pState->fFlagsFound |= MM_RAM_FLAGS_VIRTUAL_HANDLER; break;
    12361234                case PGMVIRTHANDLERTYPE_WRITE:      pState->fFlagsFound |= MM_RAM_FLAGS_VIRTUAL_HANDLER | MM_RAM_FLAGS_VIRTUAL_WRITE; break;
     
    12761274    switch (pVirt->enmType)
    12771275    {
    1278         case PGMVIRTHANDLERTYPE_EIP:
    12791276        case PGMVIRTHANDLERTYPE_NORMAL:     fFlags = MM_RAM_FLAGS_VIRTUAL_HANDLER; break;
    12801277        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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette