VirtualBox

Changeset 94983 in vbox


Ignore:
Timestamp:
May 11, 2022 9:17:50 AM (3 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:10092 Assertion to ensure we don't need to mask twice.

File:
1 edited

Legend:

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

    r94982 r94983  
    134134                                  | PGM_PTATTRS_EPT_W_MASK
    135135                                  | PGM_PTATTRS_EPT_X_SUPER_MASK;
     136    Assert(!(fCumulativeEpt & ~PGM_PTATTRS_EPT_MASK));
    136137
    137138    /*
     
    176177        uint8_t const fExecute       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_EXECUTE);
    177178        uint8_t const fAccessed      = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_ACCESSED);
    178         uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     179        uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    179180        fEffective = RT_BF_MAKE(PGM_PTATTRS_R,   fRead)
    180181                   | RT_BF_MAKE(PGM_PTATTRS_W,   fWrite)
     
    209210            uint8_t const fExecute       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_EXECUTE);
    210211            uint8_t const fAccessed      = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_ACCESSED);
    211             uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     212            uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    212213            fEffective &= RT_BF_MAKE(PGM_PTATTRS_R,   fRead)
    213214                        | RT_BF_MAKE(PGM_PTATTRS_W,   fWrite)
    214215                        | RT_BF_MAKE(PGM_PTATTRS_NX, !fExecute)
    215216                        | RT_BF_MAKE(PGM_PTATTRS_A,   fAccessed)
    216                         | (fEffectiveEpt & fCumulativeEpt);
     217                        | fEffectiveEpt;
    217218            pWalk->fEffective = fEffective;
    218219        }
     
    228229            uint8_t const fDirty         = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_DIRTY);
    229230            uint8_t const fMemType       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_MEMTYPE);
    230             uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     231            uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    231232            fEffective &= RT_BF_MAKE(PGM_PTATTRS_R,           fRead)
    232233                        | RT_BF_MAKE(PGM_PTATTRS_W,           fWrite)
    233234                        | RT_BF_MAKE(PGM_PTATTRS_NX,         !fExecute)
    234235                        | RT_BF_MAKE(PGM_PTATTRS_A,           fAccessed)
    235                         | (fEffectiveEpt & fCumulativeEpt);
     236                        | fEffectiveEpt;
    236237            fEffective |= RT_BF_MAKE(PGM_PTATTRS_D,           fDirty)
    237238                        | RT_BF_MAKE(PGM_PTATTRS_EPT_MEMTYPE, fMemType);
     
    272273            uint8_t const fExecute       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_EXECUTE);
    273274            uint8_t const fAccessed      = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_ACCESSED);
    274             uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     275            uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    275276            fEffective &= RT_BF_MAKE(PGM_PTATTRS_R,   fRead)
    276277                        | RT_BF_MAKE(PGM_PTATTRS_W,   fWrite)
    277278                        | RT_BF_MAKE(PGM_PTATTRS_NX, !fExecute)
    278279                        | RT_BF_MAKE(PGM_PTATTRS_A,   fAccessed)
    279                         | (fEffectiveEpt & fCumulativeEpt);
     280                        | fEffectiveEpt;
    280281            pWalk->fEffective = fEffective;
    281282        }
     
    291292            uint8_t const fDirty         = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_DIRTY);
    292293            uint8_t const fMemType       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_MEMTYPE);
    293             uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     294            uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    294295            fEffective &= RT_BF_MAKE(PGM_PTATTRS_R,           fRead)
    295296                        | RT_BF_MAKE(PGM_PTATTRS_W,           fWrite)
    296297                        | RT_BF_MAKE(PGM_PTATTRS_NX,         !fExecute)
    297298                        | RT_BF_MAKE(PGM_PTATTRS_A,           fAccessed)
    298                         | (fEffectiveEpt & fCumulativeEpt);
     299                        | fEffectiveEpt;
    299300            fEffective |= RT_BF_MAKE(PGM_PTATTRS_D,           fDirty)
    300301                        | RT_BF_MAKE(PGM_PTATTRS_EPT_MEMTYPE, fMemType);
     
    340341        uint8_t const fDirty         = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_DIRTY);
    341342        uint8_t const fMemType       = RT_BF_GET(fEptAttrs, VMX_BF_EPT_PT_MEMTYPE);
    342         uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & PGM_PTATTRS_EPT_MASK;
     343        uint64_t const fEffectiveEpt = (fEptAttrs << PGM_PTATTRS_EPT_SHIFT) & fCumulativeEpt;
    343344        fEffective &= RT_BF_MAKE(PGM_PTATTRS_R,           fRead)
    344345                    | RT_BF_MAKE(PGM_PTATTRS_W,           fWrite)
    345346                    | RT_BF_MAKE(PGM_PTATTRS_NX,         !fExecute)
    346347                    | RT_BF_MAKE(PGM_PTATTRS_A,           fAccessed)
    347                     | (fEffectiveEpt & fCumulativeEpt);
     348                    | fEffectiveEpt;
    348349        fEffective |= RT_BF_MAKE(PGM_PTATTRS_D,           fDirty)
    349350                    | RT_BF_MAKE(PGM_PTATTRS_EPT_MEMTYPE, fMemType);
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