VirtualBox

Changeset 8536 in vbox


Ignore:
Timestamp:
May 2, 2008 4:46:51 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30441
Message:

Split out the long mode only bits from the PDPE.
Set accessed bits for the PDPE & PML4E

Location:
trunk
Files:
4 edited

Legend:

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

    r8155 r8536  
    14371437    /** Flags whether(=1) or not the page is present. */
    14381438    uint32_t    u1Present : 1;
     1439    /** Chunk of reserved bits. */
     1440    uint32_t    u2Reserved : 2;
     1441    /** Write Thru flag. If PAT enabled, bit 0 of the index. */
     1442    uint32_t    u1WriteThru : 1;
     1443    /** Cache disabled flag. If PAT enabled, bit 1 of the index. */
     1444    uint32_t    u1CacheDisable : 1;
     1445    /** Chunk of reserved bits. */
     1446    uint32_t    u4Reserved : 4;
     1447    /** Available for use to system software. */
     1448    uint32_t    u3Available : 3;
     1449    /** Physical Page number of the next level - Low Part. Don't use! */
     1450    uint32_t    u20PageNoLow : 20;
     1451    /** Physical Page number of the next level - High Part. Don't use! */
     1452    uint32_t    u20PageNoHigh : 20;
     1453    /** MBZ bits */
     1454    uint32_t    u12Reserved : 12;
     1455} X86PDPEBITS;
     1456/** Pointer to a page directory pointer table entry. */
     1457typedef X86PDPEBITS *PX86PTPEBITS;
     1458/** Pointer to a const page directory pointer table entry. */
     1459typedef const X86PDPEBITS *PCX86PTPEBITS;
     1460
     1461/**
     1462 * Page directory pointer table entry. AMD64 version
     1463 */
     1464typedef struct X86PDPEAMD64BITS
     1465{
     1466    /** Flags whether(=1) or not the page is present. */
     1467    uint32_t    u1Present : 1;
    14391468    /** Read(=0) / Write(=1) flag. */
    14401469    uint32_t    u1Write : 1;
     
    14601489    /** No Execute flag. */
    14611490    uint32_t    u1NoExecute : 1;
    1462 } X86PDPEBITS;
     1491} X86PDPEAMD64BITS;
    14631492/** Pointer to a page directory pointer table entry. */
    1464 typedef X86PDPEBITS *PX86PTPEBITS;
     1493typedef X86PDPEAMD64BITS *PX86PDPEAMD64BITS;
    14651494/** Pointer to a const page directory pointer table entry. */
    1466 typedef const X86PDPEBITS *PCX86PTPEBITS;
     1495typedef const X86PDPEBITS *PCX86PDPEAMD64BITS;
    14671496
    14681497/**
     
    14731502    /** Normal view. */
    14741503    X86PDPEBITS     n;
     1504    /** AMD64 view. */
     1505    X86PDPEAMD64BITS lm;
    14751506    /** Unsigned integer view. */
    14761507    X86PGPAEUINT    u;
  • trunk/src/VBox/VMM/PGM.cpp

    r8500 r8536  
    31723172                                "%016llx 1  |   P %c %c %c %c %c %s %s %s %s .. %c%c%c  %016llx\n",
    31733173                                u64Address + ((uint64_t)i << X86_PDPT_SHIFT),
    3174                                 Pdpe.n.u1Write       ? 'W'  : 'R',
    3175                                 Pdpe.n.u1User        ? 'U'  : 'S',
    3176                                 Pdpe.n.u1Accessed    ? 'A'  : '-',
    3177                                 Pdpe.n.u3Reserved & 1? '?'  : '.', /* ignored */
    3178                                 Pdpe.n.u3Reserved & 4? '!'  : '.', /* mbz */
    3179                                 Pdpe.n.u1WriteThru   ? "WT" : "--",
    3180                                 Pdpe.n.u1CacheDisable? "CD" : "--",
    3181                                 Pdpe.n.u3Reserved & 2? "!"  : "..",/* mbz */
    3182                                 Pdpe.n.u1NoExecute   ? "NX" : "--",
     3174                                Pdpe.lm.u1Write       ? 'W'  : 'R',
     3175                                Pdpe.lm.u1User        ? 'U'  : 'S',
     3176                                Pdpe.lm.u1Accessed    ? 'A'  : '-',
     3177                                Pdpe.lm.u3Reserved & 1? '?'  : '.', /* ignored */
     3178                                Pdpe.lm.u3Reserved & 4? '!'  : '.', /* mbz */
     3179                                Pdpe.lm.u1WriteThru   ? "WT" : "--",
     3180                                Pdpe.lm.u1CacheDisable? "CD" : "--",
     3181                                Pdpe.lm.u3Reserved & 2? "!"  : "..",/* mbz */
     3182                                Pdpe.lm.u1NoExecute   ? "NX" : "--",
    31833183                                Pdpe.u & RT_BIT(9)                   ? '1' : '0',
    31843184                                Pdpe.u & PGM_PLXFLAGS_PERMANENT   ? 'p' : '-',
     
    31863186                                Pdpe.u & X86_PDPE_PG_MASK);
    31873187            else
    3188                 pHlp->pfnPrintf(pHlp,      /*P R  S  A  D  G  WT CD AT NX 4M a p ?  */
    3189                                 "%08x 0 |    P %c %c %c %c %c %s %s %s %s .. %c%c%c  %016llx\n",
     3188                pHlp->pfnPrintf(pHlp,      /*P             G  WT CD AT NX 4M a p ?  */
     3189                                "%08x 0 |    P             %c %s %s %s %s .. %c%c%c  %016llx\n",
    31903190                                i << X86_PDPT_SHIFT,
    3191                                 Pdpe.n.u1Write       ? '!'  : '.', /* mbz */
    3192                                 Pdpe.n.u1User        ? '!'  : '.', /* mbz */
    3193                                 Pdpe.n.u1Accessed    ? '!'  : '.', /* mbz */
    3194                                 Pdpe.n.u3Reserved & 1? '!'  : '.', /* mbz */
    3195                                 Pdpe.n.u3Reserved & 4? '!'  : '.', /* mbz */
     3191                                Pdpe.n.u4Reserved & 1? '!'  : '.', /* mbz */
     3192                                Pdpe.n.u4Reserved & 4? '!'  : '.', /* mbz */
    31963193                                Pdpe.n.u1WriteThru   ? "WT" : "--",
    31973194                                Pdpe.n.u1CacheDisable? "CD" : "--",
    3198                                 Pdpe.n.u3Reserved & 2? "!"  : "..",/* mbz */
    3199                                 Pdpe.n.u1NoExecute   ? "NX" : "--",
     3195                                Pdpe.n.u4Reserved & 2? "!"  : "..",/* mbz */
    32003196                                Pdpe.u & RT_BIT(9)                   ? '1' : '0',
    32013197                                Pdpe.u & PGM_PLXFLAGS_PERMANENT   ? 'p' : '-',
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r8535 r8536  
    17331733        ||  !pPdpeSrc->n.u1Present
    17341734# if PGM_GST_TYPE == PGM_TYPE_AMD64 /* NX, r/w, u/s bits in the PDPE are long mode only */
    1735         ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) && pPdpeSrc->n.u1NoExecute)
    1736         ||  (fWriteFault && !pPdpeSrc->n.u1Write && (fUserLevelFault || fWriteProtect))
    1737         ||  (fUserLevelFault && !pPdpeSrc->n.u1User)
     1735        ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) && pPdpeSrc->lm.u1NoExecute)
     1736        ||  (fWriteFault && !pPdpeSrc->lm.u1Write && (fUserLevelFault || fWriteProtect))
     1737        ||  (fUserLevelFault && !pPdpeSrc->lm.u1User)
    17381738# endif
    17391739       )
     
    17661766    {
    17671767        /* Mark guest page directory as accessed */
    1768         pPdeSrc->b.u1Accessed = 1;
     1768#  if PGM_GST_TYPE == PGM_TYPE_AMD64
     1769        pPml4eSrc->n.u1Accessed = 1;
     1770        pPdpeSrc->lm.u1Accessed  = 1;
     1771#  endif
     1772        pPdeSrc->b.u1Accessed   = 1;
    17691773
    17701774        /*
     
    18351839         * Set the accessed bits in the page directory and the page table.
    18361840         */
    1837         pPdeSrc->n.u1Accessed = 1;
    1838         pPteSrc->n.u1Accessed = 1;
     1841#  if PGM_GST_TYPE == PGM_TYPE_AMD64
     1842        pPml4eSrc->n.u1Accessed = 1;
     1843        pPdpeSrc->lm.u1Accessed = 1;
     1844#  endif
     1845        pPdeSrc->n.u1Accessed   = 1;
     1846        pPteSrc->n.u1Accessed   = 1;
    18391847
    18401848        /*
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r8458 r8536  
    181181
    182182    /* Merge accessed, write, user and no-execute bits into the PDE. */
    183     Pde.n.u1Accessed  &= pPml4e->n.u1Accessed & Pdpe.n.u1Accessed;
    184     Pde.n.u1Write     &= pPml4e->n.u1Write & Pdpe.n.u1Write;
    185     Pde.n.u1User      &= pPml4e->n.u1User & Pdpe.n.u1User;
    186     Pde.n.u1NoExecute &= pPml4e->n.u1NoExecute& Pdpe.n.u1NoExecute;
     183    Pde.n.u1Accessed  &= pPml4e->n.u1Accessed & Pdpe.lm.u1Accessed;
     184    Pde.n.u1Write     &= pPml4e->n.u1Write & Pdpe.lm.u1Write;
     185    Pde.n.u1User      &= pPml4e->n.u1User & Pdpe.lm.u1User;
     186    Pde.n.u1NoExecute &= pPml4e->n.u1NoExecute& Pdpe.lm.u1NoExecute;
    187187# endif
    188188
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