VirtualBox

Changeset 71032 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Feb 15, 2018 4:57:48 PM (7 years ago)
Author:
vboxsync
Message:

NEM: More code. bugref:9044

File:
1 edited

Legend:

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

    r71031 r71032  
    17101710{
    17111711    uint8_t u2State = pInfo->u2NemState;
    1712     int rc = nemR3NativeSetPhysPage(pVM, GCPhys, pInfo->fNemProt, &u2State,
    1713                                     u2State <= NEM_WIN_PAGE_STATE_UNMAPPED /*fBackingChanged*/);
     1712    bool    fBackingChanged = true;
     1713    switch (u2State)
     1714    {
     1715        case NEM_WIN_PAGE_STATE_UNMAPPED:
     1716        case NEM_WIN_PAGE_STATE_NOT_SET:
     1717            if (pInfo->fNemProt == NEM_PAGE_PROT_NONE)
     1718                return VINF_SUCCESS;
     1719            break;
     1720        case NEM_WIN_PAGE_STATE_READABLE:
     1721            if (pInfo->fNemProt != NEM_PAGE_PROT_NONE)
     1722            {
     1723                if (!(pInfo->fNemProt & NEM_PAGE_PROT_WRITE))
     1724                    return VINF_SUCCESS;
     1725                fBackingChanged = false;
     1726            }
     1727            break;
     1728        case NEM_WIN_PAGE_STATE_WRITABLE:
     1729            if (pInfo->fNemProt & NEM_PAGE_PROT_WRITE)
     1730                return VINF_SUCCESS;
     1731            if (pInfo->fNemProt != NEM_PAGE_PROT_NONE)
     1732                fBackingChanged = false;
     1733            break;
     1734    }
     1735
     1736    int rc = nemR3NativeSetPhysPage(pVM, GCPhys & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK, pInfo->fNemProt, &u2State, fBackingChanged);
    17141737    pInfo->u2NemState = u2State;
    17151738    RT_NOREF(pVCpu, pvUser);
     
    17271750 * @param   pVCpu           The cross context virtual CPU structure.
    17281751 * @param   pCtx            The CPU context to update.
    1729  * @param   pExitReason     The exit reason information.
     1752 * @param   pMemCtx         The exit reason information.
    17301753 */
    17311754static VBOXSTRICTRC nemR3WinHandleMemoryAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, WHV_MEMORY_ACCESS_CONTEXT const *pMemCtx)
     
    17661789 * @param   pVCpu           The cross context virtual CPU structure.
    17671790 * @param   pCtx            The CPU context to update.
    1768  * @param   pExitReason     The exit reason information.
     1791 * @param   pIoPortCtx      The exit reason information.
    17691792 */
    17701793static VBOXSTRICTRC nemR3WinHandleIoPortAccess(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx,
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