VirtualBox

Changeset 10285 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 5, 2008 5:29:23 PM (17 years ago)
Author:
vboxsync
Message:

Corrected protected mode without paging shadow paging.

File:
1 edited

Legend:

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

    r10283 r10285  
    17921792    PSHWPT pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
    17931793
    1794 # if PGM_SHW_TYPE == PGM_TYPE_PAE
    1795     /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
    1796     const unsigned  offPTSrc  = ((GCPtrPage >> SHW_PD_SHIFT) & 1) * 512;
    1797 # else
    1798     const unsigned  offPTSrc  = 0;
    1799 # endif
    1800 
    18011794    Assert(cPages == 1 || !(uErr & X86_TRAP_PF_P));
    18021795    if (cPages > 1 && !(uErr & X86_TRAP_PF_P))
     
    18211814                GSTPTE PteSrc;
    18221815
    1823                 RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT);
     1816                RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT);
    18241817
    18251818                /* Fake the page table entry */
     
    18421835            }
    18431836            else
    1844                 Log4(("%VGv iPTDst=%x pPTDst->a[iPTDst] %RX64\n", ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT), iPTDst, pPTDst->a[iPTDst].u));
     1837                Log4(("%VGv iPTDst=%x pPTDst->a[iPTDst] %RX64\n", ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT), iPTDst, pPTDst->a[iPTDst].u));
    18451838        }
    18461839    }
     
    18501843        GSTPTE PteSrc;
    18511844        const unsigned iPTDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK;
    1852         RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT);
     1845        RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT);
    18531846
    18541847        /* Fake the page table entry */
     
    26572650
    26582651    /* Virtual address = physical address */
    2659     GCPhys = GCPtrPage & X86_PAGE_4K_BASE_MASK;
     2652    GCPhys = GCPtrPage & SHW_PD_MASK;
    26602653# if PGM_SHW_TYPE == PGM_TYPE_AMD64
    2661     rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx,    iPDDst, &pShwPage);
     2654    rc = pgmPoolAlloc(pVM, GCPhys & ~(RT_BIT_64(SHW_PD_SHIFT) - 1), BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx,    iPDDst, &pShwPage);
    26622655# else
    2663     rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, SHW_POOL_ROOT_IDX, iPDDst, &pShwPage);
     2656    rc = pgmPoolAlloc(pVM, GCPhys & ~(RT_BIT_64(SHW_PD_SHIFT) - 1), BTH_PGMPOOLKIND_PT_FOR_PT, SHW_POOL_ROOT_IDX, iPDDst, &pShwPage);
    26642657# endif
    26652658
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