VirtualBox

Changeset 1306 in vbox for trunk/src/VBox/VMM/VMMGC


Ignore:
Timestamp:
Mar 7, 2007 4:50:52 PM (18 years ago)
Author:
vboxsync
Message:

Forward #UD & #GP in V86 code in GC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp

    r1160 r1306  
    366366        {
    367367            int rc = PATMGCHandleIllegalInstrTrap(pVM, pRegFrame);
    368             if (rc == VINF_SUCCESS || rc == VINF_EM_RAW_EMULATE_INSTR || rc == VINF_PATM_DUPLICATE_FUNCTION || rc == VINF_PATM_PENDING_IRQ_AFTER_IRET)
     368            if (rc == VINF_SUCCESS || rc == VINF_EM_RAW_EMULATE_INSTR || rc == VINF_PATM_DUPLICATE_FUNCTION || rc == VINF_PATM_PENDING_IRQ_AFTER_IRET || rc == VINF_EM_RESCHEDULE)
    369369                return trpmGCExitTrap(pVM, rc, pRegFrame);
    370370        }
     371    }
     372    else
     373    if (pRegFrame->eflags.Bits.u1VM)
     374    {
     375        int rc = TRPMForwardTrap(pVM, pRegFrame, 0x6, 0, TRPM_TRAP_NO_ERRORCODE, TRPM_TRAP);
     376        Assert(rc == VINF_EM_RAW_GUEST_TRAP);
    371377    }
    372378    return trpmGCExitTrap(pVM, VINF_EM_RAW_GUEST_TRAP, pRegFrame);
     
    704710    if (pRegFrame->eflags.Bits.u1VM)
    705711    {
     712        X86EFLAGS eflags;
     713
    706714        STAM_PROFILE_ADV_STOP(&pVM->trpm.s.StatTrap0dDisasm, a);
     715
     716        /* Retrieve the eflags including the virtualized bits. */
     717        /** @note hackish as the cpumctxcore structure doesn't contain the right value */
     718        eflags.u32 = CPUMRawGetEFlags(pVM, pRegFrame);
     719        if (eflags.Bits.u2IOPL == 0)
     720        {
     721            int rc = TRPMForwardTrap(pVM, pRegFrame, 0xD, 0, TRPM_TRAP_HAS_ERRORCODE, TRPM_TRAP);
     722            Assert(rc == VINF_EM_RAW_GUEST_TRAP);
     723            return trpmGCExitTrap(pVM, rc, pRegFrame);
     724        }
     725
    707726        return trpmGCExitTrap(pVM, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
    708727    }
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