VirtualBox

Changeset 31997 in vbox


Ignore:
Timestamp:
Aug 26, 2010 1:59:06 PM (14 years ago)
Author:
vboxsync
Message:

PGM: Don't shadow any extra bits in long mode PDPEs and PML4Es.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r31948 r31997  
    21182118        pVCpu->pgm.s.fGst64ShadowedBigPde4PteMask =
    21192119            X86_PDE4M_P | X86_PDE4M_RW | X86_PDE4M_US | X86_PDE4M_G | X86_PDE4M_A | X86_PDE4M_D;
     2120        pVCpu->pgm.s.fGstAmd64ShadowedPdpeMask  = X86_PDPE_P  | X86_PDPE_RW  | X86_PDPE_US  | X86_PDPE_A;
     2121        pVCpu->pgm.s.fGstAmd64ShadowedPml4eMask = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_US | X86_PML4E_A;
    21202122    }
    21212123
  • trunk/src/VBox/VMM/PGMInternal.h

    r31978 r31997  
    35933593    /** Mask containing the MBZ PML4E bits. */
    35943594    uint64_t                        fGstAmd64MbzPml4eMask;
     3595    /** Mask containing the PDPE bits that we shadow. */
     3596    uint64_t                        fGstAmd64ShadowedPdpeMask;
     3597    /** Mask containing the PML4E bits that we shadow. */
     3598    uint64_t                        fGstAmd64ShadowedPml4eMask;
    35953599    /** @} */
    35963600
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r31996 r31997  
    10551055 * @param   pVCpu       VMCPU handle.
    10561056 * @param   GCPtr       The address.
    1057  * @param   uGstPml4e   Guest PML4 entry
    1058  * @param   uGstPdpe    Guest PDPT entry
     1057 * @param   uGstPml4e   Guest PML4 entry (valid).
     1058 * @param   uGstPdpe    Guest PDPT entry (valid).
    10591059 * @param   ppPD        Receives address of page directory
    10601060 */
     
    11051105    }
    11061106    /* The PDPT was cached or created; hook it up now. */
    1107     pPml4e->u |= pShwPage->Core.Key
    1108               | (uGstPml4e & ~(X86_PML4E_PG_MASK_FULL | X86_PML4E_AVL_MASK | X86_PML4E_PCD | X86_PML4E_PWT));
     1107    pPml4e->u |= pShwPage->Core.Key | (uGstPml4e & pVCpu->pgm.s.fGstAmd64ShadowedPml4eMask);
    11091108
    11101109    const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
     
    11431142    }
    11441143    /* The PD was cached or created; hook it up now. */
    1145     pPdpe->u |= pShwPage->Core.Key
    1146              | (uGstPdpe & ~(X86_PDPE_PG_MASK_FULL | X86_PDPE_AVL_MASK | X86_PDPE_PCD | X86_PDPE_PWT));
     1144    pPdpe->u |= pShwPage->Core.Key | (uGstPdpe & pVCpu->pgm.s.fGstAmd64ShadowedPdpeMask);
    11471145
    11481146    *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
     
    11911189
    11921190    *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    1193 Log4(("pgmShwGetLongModePDPtr %RGv -> *ppPD=%p PDE=%p/%RX64\n", GCPtr, *ppPD, &(*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK], (*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK].u));
     1191    Log4(("pgmShwGetLongModePDPtr %RGv -> *ppPD=%p PDE=%p/%RX64\n", GCPtr, *ppPD, &(*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK], (*ppPD)->a[(GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK].u));
    11941192    return VINF_SUCCESS;
    11951193}
     
    22422240        pVCpu->pgm.s.fGst64ShadowedBigPdeMask     |= X86_PDE2M_PAE_NX;
    22432241        pVCpu->pgm.s.fGst64ShadowedBigPde4PteMask |= X86_PDE2M_PAE_NX;
     2242        pVCpu->pgm.s.fGstAmd64ShadowedPdpeMask    |= X86_PDPE_LM_NX;
     2243        pVCpu->pgm.s.fGstAmd64ShadowedPml4eMask   |= X86_PML4E_NX;
    22442244    }
    22452245    else
     
    22612261        pVCpu->pgm.s.fGst64ShadowedBigPdeMask     &= ~X86_PDE2M_PAE_NX;
    22622262        pVCpu->pgm.s.fGst64ShadowedBigPde4PteMask &= ~X86_PDE2M_PAE_NX;
     2263        pVCpu->pgm.s.fGstAmd64ShadowedPdpeMask    &= ~X86_PDPE_LM_NX;
     2264        pVCpu->pgm.s.fGstAmd64ShadowedPml4eMask   &= ~X86_PML4E_NX;
    22632265    }
    22642266}
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