VirtualBox

Changeset 22169 in vbox for trunk/src


Ignore:
Timestamp:
Aug 11, 2009 2:58:45 PM (15 years ago)
Author:
vboxsync
Message:

Avoid incorrect reuse of big pages: take the NX bit into account too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r21966 r22169  
    25992599            PGMPOOLACCESS enmAccess;
    26002600
     2601# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
     2602            const bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVCpu) & MSR_K6_EFER_NXE);
     2603            const bool fNoExecute = fNoExecuteBitValid && PdeSrc.n.u1NoExecute;
     2604# else
     2605            const bool fNoExecute = false;
     2606# endif
     2607
    26012608            GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc);
    26022609# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT
     
    26082615            {
    26092616                if (PdeSrc.n.u1Write)
    2610                     enmAccess = PGMPOOLACCESS_USER_RW;
     2617                    enmAccess = (fNoExecute) ? PGMPOOLACCESS_USER_RW_NX : PGMPOOLACCESS_USER_RW;
    26112618                else
    2612                     enmAccess = PGMPOOLACCESS_USER_R;
     2619                    enmAccess = (fNoExecute) ? PGMPOOLACCESS_USER_R_NX : PGMPOOLACCESS_USER_R;
    26132620            }
    26142621            else
    26152622            {
    26162623                if (PdeSrc.n.u1Write)
    2617                     enmAccess = PGMPOOLACCESS_SUPERVISOR_RW;
     2624                    enmAccess = (fNoExecute) ? PGMPOOLACCESS_SUPERVISOR_RW_NX : PGMPOOLACCESS_SUPERVISOR_RW;
    26182625                else
    2619                     enmAccess = PGMPOOLACCESS_SUPERVISOR_R;
     2626                    enmAccess = (fNoExecute) ? PGMPOOLACCESS_SUPERVISOR_R_NX : PGMPOOLACCESS_SUPERVISOR_R;
    26202627            }
    26212628            rc = pgmPoolAllocEx(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_BIG, enmAccess, pShwPde->idx, iPDDst, &pShwPage);
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