VirtualBox

Changeset 1519 in vbox for trunk


Ignore:
Timestamp:
Mar 15, 2007 4:27:16 PM (18 years ago)
Author:
vboxsync
Message:

Forward trap back to raw mode if the rechecked gate handler is valid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/EM.cpp

    r1366 r1519  
    21742174                break;
    21752175            }
    2176             uint8_t u8Interrupt;
    21772176
    21782177            Assert(TRPMHasTrap(pVM));
     
    21812180            if (TRPMHasTrap(pVM))
    21822181            {
    2183                 u8Interrupt = TRPMGetTrapNo(pVM);
     2182                uint8_t         u8Interrupt;
     2183                uint32_t        uErrorCode;
     2184                TRPMERRORCODE   enmError = TRPM_TRAP_NO_ERRORCODE;
     2185
     2186                rc = TRPMQueryTrapAll(pVM, &u8Interrupt, NULL, &uErrorCode, NULL);
     2187                AssertRC(rc);
     2188
     2189                if (uErrorCode != ~0)
     2190                    enmError = TRPM_TRAP_HAS_ERRORCODE;
    21842191
    21852192                /* If the guest gate is marked unpatched, then we will check again if we can patch it. */
     
    21882195                    CSAMR3CheckGates(pVM, u8Interrupt, 1);
    21892196                    Log(("emR3RawHandleRC: recheck gate %x -> valid=%d\n", u8Interrupt, TRPMR3GetGuestTrapHandler(pVM, u8Interrupt) != TRPM_INVALID_HANDLER));
    2190                     /** @note If it was successful, then we could go back to raw mode, but let's keep things simple for now. */
     2197                    /** If it was successful, then we could go back to raw mode. */
     2198                    if (TRPMR3GetGuestTrapHandler(pVM, u8Interrupt) != TRPM_INVALID_HANDLER)
     2199                    {
     2200                        rc = TRPMForwardTrap(pVM, CPUMCTX2CORE(pCtx), u8Interrupt, uErrorCode, enmError, TRPM_TRAP);
     2201                        if (rc == VINF_SUCCESS /* Don't use VBOX_SUCCESS */)
     2202                        {
     2203                            TRPMResetTrap(pVM);
     2204                            return VINF_EM_RESCHEDULE_RAW;
     2205                        }
     2206                    }
    21912207                }
    21922208            }
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