VirtualBox

Changeset 12747 in vbox


Ignore:
Timestamp:
Sep 25, 2008 3:21:34 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37071
Message:

Put back #GP handler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r12746 r12747  
    10971097#endif
    10981098
     1099    /* Intercept #GP faults in real mode to handle IO instructions. */
     1100    if (CPUMIsGuestInRealModeEx(pCtx))
     1101        pVM->hwaccm.s.vmx.u32TrapMask |= RT_BIT(X86_XCPT_GP);
     1102    else
     1103        pVM->hwaccm.s.vmx.u32TrapMask &= ~RT_BIT(X86_XCPT_GP);
     1104
     1105    rc = VMXWriteVMCS(VMX_VMCS_CTRL_EXCEPTION_BITMAP, pVM->hwaccm.s.vmx.u32TrapMask);
     1106    AssertRC(rc);   
     1107
    10991108    /* Done. */
    11001109    pVM->hwaccm.s.fContextUseFlags &= ~HWACCM_CHANGED_ALL_GUEST;
     
    18181827            }
    18191828
     1829            case X86_XCPT_GP:   /* General protection failure exception.*/
     1830            {
     1831                uint32_t cbSize;
     1832
     1833                STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitGuestGP);
     1834#ifdef VBOX_STRICT
     1835                if (!CPUMIsGuestInRealModeEx(pCtx))
     1836                {
     1837                    Log(("Trap %x at %VGv error code %x\n", vector, pCtx->rip, errCode));
     1838                    rc = VMXR0InjectEvent(pVM, pCtx, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(intInfo), cbInstr, errCode);
     1839                    AssertRC(rc);
     1840                    STAM_PROFILE_ADV_STOP(&pVM->hwaccm.s.StatExit, x);
     1841                    goto ResumeExecution;
     1842                }
     1843#endif
     1844                Assert(CPUMIsGuestInRealModeEx(pCtx));
     1845
     1846                LogFlow(("Real mode X86_XCPT_GP instruction emulation at %VGv\n", pCtx->rip));
     1847                rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1848                if (rc == VINF_SUCCESS)
     1849                {
     1850                    /* EIP has been updated already. */
     1851
     1852                    /* Only resume if successful. */
     1853                    STAM_PROFILE_ADV_STOP(&pVM->hwaccm.s.StatExit, x);
     1854                    goto ResumeExecution;
     1855                }
     1856                AssertMsg(rc == VERR_EM_INTERPRETER);
     1857                break;
     1858            }
     1859
    18201860#ifdef VBOX_STRICT
    18211861            case X86_XCPT_DE:   /* Divide error. */
    1822             case X86_XCPT_GP:   /* General protection failure exception.*/
    18231862            case X86_XCPT_UD:   /* Unknown opcode exception. */
    18241863            case X86_XCPT_SS:   /* Stack segment exception. */
     
    18381877                case X86_XCPT_NP:
    18391878                    STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitGuestNP);
    1840                     break;
    1841                 case X86_XCPT_GP:
    1842                     STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitGuestGP);
    18431879                    break;
    18441880                }
Note: See TracChangeset for help on using the changeset viewer.

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