VirtualBox

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


Ignore:
Timestamp:
Oct 22, 2021 1:20:39 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147814
Message:

VMM/PGM: Always check VM_IS_NEM_ENABLED before calling into NEM. bugref:10122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r91907 r92006  
    17591759     * Notify NEM now that it has been linked.
    17601760     */
    1761     int rc = NEMR3NotifyPhysRamRegister(pVM, GCPhys, pNew->cb, pNew->pvR3);
    1762     if (RT_FAILURE(rc))
    1763         pgmR3PhysUnlinkRamRange2(pVM, pNew, pPrev);
    1764     return rc;
    1765 #else
     1761    if (VM_IS_NEM_ENABLED(pVM))
     1762    {
     1763        int rc = NEMR3NotifyPhysRamRegister(pVM, GCPhys, pNew->cb, pNew->pvR3);
     1764        if (RT_FAILURE(rc))
     1765            pgmR3PhysUnlinkRamRange2(pVM, pNew, pPrev);
     1766        return rc;
     1767    }
     1768#endif
    17661769    return VINF_SUCCESS;
    1767 #endif
    17681770}
    17691771
     
    43774379                         * Notify NEM again.
    43784380                         */
    4379                         u2NemState = UINT8_MAX;
    4380                         rc = NEMR3NotifyPhysRomRegisterLate(pVM, GCPhys, cb, PGM_RAMRANGE_CALC_PAGE_R3PTR(pRamNew, GCPhys),
    4381                                                             fNemNotify, &u2NemState);
    4382                         if (u2NemState != UINT8_MAX)
    4383                             pgmPhysSetNemStateForPages(&pRamNew->aPages[idxFirstRamPage], cPages, u2NemState);
    4384                         if (RT_SUCCESS(rc))
     4381                        if (VM_IS_NEM_ENABLED(pVM))
     4382                        {
     4383                            u2NemState = UINT8_MAX;
     4384                            rc = NEMR3NotifyPhysRomRegisterLate(pVM, GCPhys, cb, PGM_RAMRANGE_CALC_PAGE_R3PTR(pRamNew, GCPhys),
     4385                                                                fNemNotify, &u2NemState);
     4386                            if (u2NemState != UINT8_MAX)
     4387                                pgmPhysSetNemStateForPages(&pRamNew->aPages[idxFirstRamPage], cPages, u2NemState);
     4388                            if (RT_SUCCESS(rc))
     4389                                return rc;
     4390                        }
     4391                        else
    43854392#endif
    43864393                            return rc;
     
    48254832        pVCpu->pgm.s.fA20Enabled = fEnable;
    48264833        pVCpu->pgm.s.GCPhysA20Mask = ~((RTGCPHYS)!fEnable << 20);
    4827         NEMR3NotifySetA20(pVCpu, fEnable);
     4834        if (VM_IS_NEM_ENABLED(pVCpu->CTX_SUFF(pVM)))
     4835            NEMR3NotifySetA20(pVCpu, fEnable);
    48284836#ifdef PGM_WITH_A20
    48294837        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette