VirtualBox

Changeset 72564 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jun 15, 2018 12:56:01 PM (7 years ago)
Author:
vboxsync
Message:

EM,TRPM,IOM: Improved the raw-mode exit history a little (just for the heck of it). bugref:9044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r72560 r72564  
    469469 *
    470470 * @param   pVCpu           The cross context virtual CPU structure.
    471  * @param   uFlatPC         The flattened program counter (RIP).  UINT64_MAX if not available.
     471 * @param   uFlatPC         The flattened program counter (RIP).
    472472 * @param   fFlattened      Set if RIP was subjected to CS.BASE, clear if not.
    473473 */
     
    483483}
    484484#endif
     485
     486
     487/**
     488 * Interface for convering a engine specific exit to a generic one and get guidance.
     489 *
     490 * @param   pVCpu           The cross context virtual CPU structure.
     491 * @param   uFlagsAndType   Combined flags and type (see EMEXIT_MAKE_FLAGS_AND_TYPE).
     492 * @thread  EMT(pVCpu)
     493 */
     494VMM_INT_DECL(EMEXITACTION) EMHistoryUpdateFlagsAndType(PVMCPU pVCpu, uint32_t uFlagsAndType)
     495{
     496    VMCPU_ASSERT_EMT(pVCpu);
     497
     498    /*
     499     * Do the updating.
     500     */
     501    AssertCompile(RT_ELEMENTS(pVCpu->em.s.aExitHistory) == 256);
     502    PEMEXITENTRY pHistEntry = &pVCpu->em.s.aExitHistory[((uintptr_t)pVCpu->em.s.iNextExit - 1) & 0xff];
     503    pHistEntry->uFlagsAndType = uFlagsAndType | (pHistEntry->uFlagsAndType & (EMEXIT_F_CS_EIP | EMEXIT_F_UNFLATTENED_PC));
     504
     505    /*
     506     * If common exit type, we will insert/update the exit into the shared hash table.
     507     */
     508    if ((uFlagsAndType & EMEXIT_F_KIND_MASK) == EMEXIT_F_KIND_EM)
     509    {
     510        /** @todo later */
     511    }
     512
     513    return EMEXITACTION_NORMAL;
     514}
     515
     516
     517/**
     518 * Interface for convering a engine specific exit to a generic one and get
     519 * guidance, supplying flattened PC too.
     520 *
     521 * @param   pVCpu           The cross context virtual CPU structure.
     522 * @param   uFlagsAndType   Combined flags and type (see EMEXIT_MAKE_FLAGS_AND_TYPE).
     523 * @param   uFlatPC         The flattened program counter (RIP).
     524 * @thread  EMT(pVCpu)
     525 */
     526VMM_INT_DECL(EMEXITACTION) EMHistoryUpdateFlagsAndTypeAndPC(PVMCPU pVCpu, uint32_t uFlagsAndType, uint64_t uFlatPC)
     527{
     528    VMCPU_ASSERT_EMT(pVCpu);
     529
     530    /*
     531     * Do the updating.
     532     */
     533    AssertCompile(RT_ELEMENTS(pVCpu->em.s.aExitHistory) == 256);
     534    PEMEXITENTRY pHistEntry = &pVCpu->em.s.aExitHistory[((uintptr_t)pVCpu->em.s.iNextExit - 1) & 0xff];
     535    pHistEntry->uFlagsAndType = uFlagsAndType;
     536    pHistEntry->uFlatPC       = uFlatPC;
     537
     538    /*
     539     * If common exit type, we will insert/update the exit into the shared hash table.
     540     */
     541    if ((uFlagsAndType & EMEXIT_F_KIND_MASK) == EMEXIT_F_KIND_EM)
     542    {
     543        /** @todo later */
     544    }
     545
     546    return EMEXITACTION_NORMAL;
     547}
    485548
    486549
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