VirtualBox

Changeset 7666 in vbox


Ignore:
Timestamp:
Mar 31, 2008 3:02:43 PM (17 years ago)
Author:
vboxsync
Message:

Put back the original PAE defines. AMD differs from Intel wrt valid pae & long mode physical address bits.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/x86.h

    r7660 r7666  
    899899#define X86_PTE_PG_MASK                     ( 0xfffff000 )
    900900
    901 /** Bits 12-51 - - PAE - Physical Page number of the next level. */
     901/** Bits 12-36 - - PAE - Physical Page number of the next level. */
    902902#if 1 /* we're using this internally and have to mask of the top 16-bit. */
    903903#define X86_PTE_PAE_PG_MASK                 ( 0x0000fffffffff000ULL )
     
    12101210#define X86_PDE4M_PG_HIGH_SHIFT             19
    12111211
    1212 /** Bits 21-36 - - PAE - Physical Page number. */
    1213 #define X86_PDE2M_PAE_PG_MASK               ( 0x0000000fffe00000ULL )
    1214 /** Bits 63 - NX - PAE - No execution flag. */
    1215 #define X86_PDE2M_PAE_NX                    RT_BIT_64(63)
    1216 
    1217 /** Bits 21-39 - - AMD64 - Physical Page number. (bits 40-51 are reserved) */
    1218 #define X86_PDE2M_AMD64_PG_MASK             ( 0x000000ffffe00000ULL )
    1219 /** Bits 63 - NX - AMD64 - No execution flag. */
    1220 #define X86_PDE2M_AMD64_NX                  X86_PDE2M_PAE_NX
     1212/** Bits 21-51 - - PAE & AMD64 - Physical Page number. (bits 40-51 (long mode) & bits 36-51 (pae legacy) are reserved according to the Intel docs; AMD allows for more) */
     1213#define X86_PDE2M_PAE_PG_MASK               ( 0x000fffffffe00000ULL )
     1214/** Bits 63 - NX - PAE & AMD64 - No execution flag. */
     1215#define X86_PDE2M_PAE_NX                    X86_PDE2M_PAE_NX
    12211216
    12221217/**
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r7664 r7666  
    864864            PPGMPOOLPAGE    pShwPage = pgmPoolGetPageByHCPhys(pVM, PdeDst.u & SHW_PDE_PG_MASK);
    865865            RTGCPHYS        GCPhys   = PdeSrc.u & GST_PDE_PG_MASK;
    866 #  if PGM_SHW_TYPE != PGM_TYPE_32BIT
     866#  if    PGM_SHW_TYPE != PGM_TYPE_32BIT \
     867      && PGM_GST_TYPE == PGM_TYPE_32BIT   
     868            /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
    867869            GCPhys |= (iPDDst & 1) * (PAGE_SIZE/2);
    868870#  endif
     
    12691271    {
    12701272        GCPhys = PdeSrc.u & GST_PDE_PG_MASK;
    1271 # if PGM_SHW_TYPE != PGM_TYPE_32BIT
     1273#  if    PGM_SHW_TYPE != PGM_TYPE_32BIT \
     1274      && PGM_GST_TYPE == PGM_TYPE_32BIT   
     1275            /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
     1276        /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
    12721277        GCPhys |= (iPDDst & 1) * (PAGE_SIZE/2);
    12731278# endif
     
    12781283#  if    PGM_SHW_TYPE != PGM_TYPE_32BIT \
    12791284      && PGM_GST_TYPE == PGM_TYPE_32BIT
    1280         /* Select the right PDE as we're emulating a 4MB page with two 2 MB shadow PDEs */
     1285        /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs */
    12811286        GCPhys |= GCPtrPage & (1 << X86_PD_PAE_SHIFT);
    12821287# endif
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r7660 r7666  
    6262# define GST_PT_MASK                X86_PT_MASK
    6363# define GST_CR3_PAGE_MASK          X86_CR3_PAGE_MASK
    64 #elif PGM_GST_TYPE == PGM_TYPE_PAE
     64#elif   PGM_GST_TYPE == PGM_TYPE_PAE \
     65     || PGM_GST_TYPE == PGM_TYPE_AMD64
    6566# define GSTPT                      X86PTPAE
    6667# define PGSTPT                     PX86PTPAE
     
    7879# define GST_PD_MASK                X86_PD_PAE_MASK
    7980# define GST_TOTAL_PD_ENTRIES       (X86_PG_PAE_ENTRIES*4)
    80 # define GST_PTE_PG_MASK            X86_PTE_PAE_PG_MASK
    81 # define GST_PT_SHIFT               X86_PT_PAE_SHIFT
    82 # define GST_PT_MASK                X86_PT_PAE_MASK
    83 # define GST_CR3_PAGE_MASK          X86_CR3_PAE_PAGE_MASK
    84 #elif PGM_GST_TYPE == PGM_TYPE_AMD64
    85 /* @todo */
    86 # define GSTPT                      X86PTPAE
    87 # define PGSTPT                     PX86PTPAE
    88 # define GSTPTE                     X86PTEPAE
    89 # define PGSTPTE                    PX86PTEPAE
    90 # define GSTPD                      X86PDPAE
    91 # define PGSTPD                     PX86PDPAE
    92 # define GSTPDE                     X86PDEPAE
    93 # define PGSTPDE                    PX86PDEPAE
    94 # define GST_BIG_PAGE_SIZE          X86_PAGE_2M_SIZE
    95 # define GST_BIG_PAGE_OFFSET_MASK   X86_PAGE_2M_OFFSET_MASK
    96 # define GST_PDE_PG_MASK            X86_PDE_PAE_PG_MASK
    97 # define GST_PDE_BIG_PG_MASK        X86_PDE2M_AMD64_PG_MASK
    98 # define GST_PD_SHIFT               X86_PD_PAE_SHIFT
    99 # define GST_PD_MASK                X86_PD_PAE_MASK
    100 # define GST_TOTAL_PD_ENTRIES       (X86_PG_PAE_ENTRIES*512)
    10181# define GST_PTE_PG_MASK            X86_PTE_PAE_PG_MASK
    10282# define GST_PT_SHIFT               X86_PT_PAE_SHIFT
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