VirtualBox

Changeset 72287 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 22, 2018 2:28:10 PM (7 years ago)
Author:
vboxsync
Message:

NEM/win: Fixes to code using WHv API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r72286 r72287  
    14991499    if (fExitCtx)
    15001500    {
    1501         const WHV_VP_EXIT_CONTEXT *pVpCtx = &pExitReason->IoPortAccess.VpContext;
     1501        const WHV_VP_EXIT_CONTEXT *pVpCtx = &pExitReason->VpContext;
    15021502        Log2(("Exit: + CS:RIP=%04x:%08RX64 RFLAGS=%06RX64 cbInstr=%u CS={%RX64 L %#RX32, %#x}\n",
    15031503              pVpCtx->Cs.Selector,
     
    16011601 * @param   pCtx            The CPU context to update.
    16021602 * @param   pMemCtx         The exit reason information.
    1603  */
    1604 static VBOXSTRICTRC nemR3WinWHvHandleMemoryAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, WHV_MEMORY_ACCESS_CONTEXT const *pMemCtx)
     1603 * @param   pVpContext      The processor context info associated with the exit.
     1604 */
     1605static VBOXSTRICTRC nemR3WinWHvHandleMemoryAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, WHV_MEMORY_ACCESS_CONTEXT const *pMemCtx,
     1606                                                  WHV_VP_EXIT_CONTEXT const *pVpContext)
    16051607{
    16061608    /*
     
    16421644    VBOXSTRICTRC rcStrict;
    16431645    if (pMemCtx->InstructionByteCount > 0)
    1644         rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pMemCtx->VpContext.Rip,
     1646        rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pVpContext->Rip,
    16451647                                                &pMemCtx->InstructionBytes[0], pMemCtx->InstructionByteCount);
    16461648    else
     
    16621664 * @param   pIoPortCtx      The exit reason information.
    16631665 */
    1664 static VBOXSTRICTRC nemR3WinWHvHandleIoPortAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx,
    1665                                                   WHV_X64_IO_PORT_ACCESS_CONTEXT const *pIoPortCtx)
     1666static VBOXSTRICTRC
     1667nemR3WinWHvHandleIoPortAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, WHV_X64_IO_PORT_ACCESS_CONTEXT const *pIoPortCtx,
     1668                              WHV_VP_EXIT_CONTEXT const *pVpContext)
    16661669{
    16671670    Assert(   pIoPortCtx->AccessInfo.AccessSize == 1
     
    16851688                                      pIoPortCtx->AccessInfo.AccessSize);
    16861689            if (IOM_SUCCESS(rcStrict))
    1687                 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext);
     1690                nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, pVpContext);
    16881691        }
    16891692        else
     
    16951698            {
    16961699                pCtx->eax = (pCtx->eax & ~fAndMask) | (uValue & fAndMask);
    1697                 nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, &pIoPortCtx->VpContext);
     1700                nemR3WinAdvanceGuestRipAndClearRF(pVCpu, pCtx, pVpContext);
    16981701            }
    16991702        }
     
    17331736         * Do debug checks.
    17341737         */
    1735         if (   pIoPortCtx->VpContext.ExecutionState.DebugActive /** @todo Microsoft: Does DebugActive this only reflext DR7? */
    1736             || (pIoPortCtx->VpContext.Rflags & X86_EFL_TF)
     1738        if (   pVpContext->ExecutionState.DebugActive /** @todo Microsoft: Does DebugActive this only reflext DR7? */
     1739            || (pVpContext->Rflags & X86_EFL_TF)
    17371740            || DBGFBpIsHwIoArmed(pVM) )
    17381741        {
     
    18981901            /* Frequent exits: */
    18991902            case WHvRunVpExitReasonCanceled:
    1900             case WHvRunVpExitReasonAlerted:
     1903            //case WHvRunVpExitReasonAlerted:
    19011904                rcStrict = VINF_SUCCESS;
    19021905                break;
     
    19071910
    19081911            case WHvRunVpExitReasonMemoryAccess:
    1909                 rcStrict = nemR3WinWHvHandleMemoryAccess(pVM, pVCpu, pCtx, &ExitReason.MemoryAccess);
     1912                rcStrict = nemR3WinWHvHandleMemoryAccess(pVM, pVCpu, pCtx, &ExitReason.MemoryAccess, &ExitReason.VpContext);
    19101913                break;
    19111914
    19121915            case WHvRunVpExitReasonX64IoPortAccess:
    1913                 rcStrict = nemR3WinWHvHandleIoPortAccess(pVM, pVCpu, pCtx, &ExitReason.IoPortAccess);
     1916                rcStrict = nemR3WinWHvHandleIoPortAccess(pVM, pVCpu, pCtx, &ExitReason.IoPortAccess, &ExitReason.VpContext);
    19141917                break;
    19151918
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