VirtualBox

Changeset 7961 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 14, 2008 5:09:45 PM (17 years ago)
Author:
vboxsync
Message:

Updates for PAE paging in raw mode

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInternal.h

    r7845 r7961  
    12801280/** The extended PAE page directory (2048 entries, works as root currently). */
    12811281#define PGMPOOL_IDX_PAE_PD      2
     1282 /** PAE Page Directory Table 0. */
     1283#define PGMPOOL_IDX_PAE_PD_0    3
     1284 /** PAE Page Directory Table 1. */
     1285#define PGMPOOL_IDX_PAE_PD_1    4
     1286 /** PAE Page Directory Table 2. */
     1287#define PGMPOOL_IDX_PAE_PD_2    5
     1288 /** PAE Page Directory Table 3. */
     1289#define PGMPOOL_IDX_PAE_PD_4    6
    12821290/** Page Directory Pointer Table (PAE root, not currently used). */
    1283 #define PGMPOOL_IDX_PDPT        3
     1291#define PGMPOOL_IDX_PDPT        7
    12841292/** Page Map Level-4 (64-bit root). */
    1285 #define PGMPOOL_IDX_PML4        4
     1293#define PGMPOOL_IDX_PML4        8
    12861294/** The first normal index. */
    1287 #define PGMPOOL_IDX_FIRST       5
     1295#define PGMPOOL_IDX_FIRST       9
    12881296/** The last valid index. (inclusive, 14 bits) */
    12891297#define PGMPOOL_IDX_LAST        0x3fff
  • trunk/src/VBox/VMM/PGMPool.cpp

    r7945 r7961  
    232232    pPool->aPages[NIL_PGMPOOL_IDX].enmKind = PGMPOOLKIND_INVALID;
    233233
    234     /* The Shadow 32-bit PD. */
     234    /* The Shadow 32-bit PD. (32 bits guest paging) */
    235235    pPool->aPages[PGMPOOL_IDX_PD].Core.Key  = NIL_RTHCPHYS;
    236236    pPool->aPages[PGMPOOL_IDX_PD].GCPhys    = NIL_RTGCPHYS;
     
    239239    pPool->aPages[PGMPOOL_IDX_PD].idx       = PGMPOOL_IDX_PD;
    240240
    241     /* The Shadow PAE PDs. This is actually 4 pages! */
     241    /* The Shadow PAE PDs. This is actually 4 pages! (32 bits guest paging)  */
    242242    pPool->aPages[PGMPOOL_IDX_PAE_PD].Core.Key  = NIL_RTHCPHYS;
    243243    pPool->aPages[PGMPOOL_IDX_PAE_PD].GCPhys    = NIL_RTGCPHYS;
     
    245245    pPool->aPages[PGMPOOL_IDX_PAE_PD].enmKind   = PGMPOOLKIND_ROOT_PAE_PD;
    246246    pPool->aPages[PGMPOOL_IDX_PAE_PD].idx       = PGMPOOL_IDX_PAE_PD;
     247
     248    /* The Shadow PAE PDs for PAE guest mode. */
     249    for (unsigned i = 0; i < X86_PG_PAE_PDPE_ENTRIES; i++)
     250    {
     251        pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].Core.Key  = NIL_RTHCPHYS;
     252        pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].GCPhys    = NIL_RTGCPHYS;
     253        pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].pvPageHC  = pVM->pgm.s.apHCPaePDs[i];
     254        pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].enmKind   = PGMPOOLKIND_PAE_PD_FOR_PAE_PD;
     255        pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].idx       = PGMPOOL_IDX_PAE_PD_0 + i;
     256    }
    247257
    248258    /* The Shadow PDPT. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r7953 r7961  
    579579                   || pVM->pgm.s.enmShadowMode == PGMMODE_PAE_NX);
    580580
    581             rc = pgmPoolMonitorMonitorCR3(pVM->pgm.s.CTXSUFF(pPool), PGMPOOL_IDX_PAE_PD, GCPhys);
     581            rc = pgmPoolMonitorMonitorCR3(pVM->pgm.s.CTXSUFF(pPool), PGMPOOL_IDX_PAE_PD_0 + i, GCPhys);
    582582# endif /* PGMPOOL_WITH_MIXED_PT_CR3 */
    583583            if (VBOX_FAILURE(rc))
     
    658658# else /* PGMPOOL_WITH_MIXED_PT_CR3 */
    659659            Assert(pVM->pgm.s.enmShadowMode == PGMMODE_PAE || pVM->pgm.s.enmShadowMode == PGMMODE_PAE_NX);
    660             int rc2 = pgmPoolMonitorUnmonitorCR3(pVM->pgm.s.CTXSUFF(pPool), PGMPOOL_IDX_PAE_PD);
     660            int rc2 = pgmPoolMonitorUnmonitorCR3(pVM->pgm.s.CTXSUFF(pPool), PGMPOOL_IDX_PAE_PD_0 + i);
    661661# endif /* PGMPOOL_WITH_MIXED_PT_CR3 */
    662662            AssertRC(rc2);
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r7959 r7961  
    388388            }
    389389
     390            case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
     391            {
     392                const unsigned iShw = off / sizeof(X86PTEPAE);
     393                if (uShw.pPDPae->a[iShw].u & PGM_PDFLAGS_MAPPING)
     394                {
     395                    Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s));
     396                    VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);
     397                    LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw));
     398                }
     399                /* paranoia / a bit assumptive. */
     400                else if (   pCpu
     401                         && (off & 7)
     402                         && (off & 7) + pgmPoolDisasWriteSize(pCpu) > 8)
     403                {
     404                    const unsigned iShw2 = (off + pgmPoolDisasWriteSize(pCpu) - 1) / sizeof(X86PTEPAE);
     405                    if (    iShw2 != iShw
     406                        &&  iShw2 < ELEMENTS(uShw.pPDPae->a)
     407                        &&  uShw.pPDPae->a[iShw2].u & PGM_PDFLAGS_MAPPING)
     408                    {
     409                        Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s));
     410                        VM_FF_SET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3);
     411                        LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2));
     412                    }
     413                }
     414#if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */
     415                if (    uShw.pPDPae->a[iShw].n.u1Present
     416                    &&  !VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))
     417                {
     418                    LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX32 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u));
     419# ifdef IN_GC       /* TLB load - we're pushing things a bit... */
     420                    ASMProbeReadByte(pvAddress);
     421# endif
     422                    pgmPoolFree(pPool->CTXSUFF(pVM), uShwpPDPae->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw);
     423                    uShw.pPDPae->a[iShw].u = 0;
     424                }
     425#endif
     426                break;
     427            }
     428
    390429            default:
    391430                AssertFatalMsgFailed(("enmKind=%d\n", pPage->enmKind));
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