VirtualBox

Changeset 7715 in vbox


Ignore:
Timestamp:
Apr 3, 2008 9:03:01 AM (17 years ago)
Author:
vboxsync
Message:

Renamed PDPTR to PDPT.
Added preliminary code for executing code with X86_CR0_WP cleared (disabled).

Location:
trunk
Files:
15 edited

Legend:

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

    r7705 r7715  
    14861486/**
    14871487 * Page directory pointer table.
    1488  * @todo Rename to PDPT - The 'r' in PDPTR is 'register' according to the intel docs.
    1489  */
    1490 typedef struct X86PDPTR
     1488 */
     1489typedef struct X86PDPT
    14911490{
    14921491    /** PDE Array. */
    14931492    X86PDPE         a[X86_PG_AMD64_PDPE_ENTRIES];
    1494 } X86PDPTR;
     1493} X86PDPT;
    14951494/** Pointer to a page directory pointer table. */
    1496 typedef X86PDPTR *PX86PDPTR;
     1495typedef X86PDPT *PX86PDPT;
    14971496/** Pointer to a const page directory pointer table. */
    1498 typedef const X86PDPTR *PCX86PDPTR;
    1499 
    1500 /** The page shift to get the PDPTR index. */
    1501 #define X86_PDPTR_SHIFT             30
    1502 /** The PDPTR index mask (apply to a shifted page address). (32 bits PAE) */
    1503 #define X86_PDPTR_MASK_32           0x3
    1504 /** The PDPTR index mask (apply to a shifted page address). (64 bits PAE)*/
    1505 #define X86_PDPTR_MASK              0x1ff
     1497typedef const X86PDPT *PCX86PDPT;
     1498
     1499/** The page shift to get the PDPT index. */
     1500#define X86_PDPT_SHIFT             30
     1501/** The PDPT index mask (apply to a shifted page address). (32 bits PAE) */
     1502#define X86_PDPT_MASK_32           0x3
     1503/** The PDPT index mask (apply to a shifted page address). (64 bits PAE)*/
     1504#define X86_PDPT_MASK              0x1ff
    15061505
    15071506/** @} */
  • trunk/src/VBox/VMM/MMHyper.cpp

    r7635 r7715  
    635635/**
    636636 * Reserves a hypervisor memory area.
    637  * Most frequent usage is fence pages and dynamically mappings like the guest PD and PDPTR.
     637 * Most frequent usage is fence pages and dynamically mappings like the guest PD and PDPT.
    638638 *
    639639 * @return VBox status code.
  • trunk/src/VBox/VMM/PGM.cpp

    r7700 r7715  
    5454 *  [..]
    5555 *
    56  * Because of guest context mappings requires PDPTR and PML4 entries to allow
     56 * Because of guest context mappings requires PDPT and PML4 entries to allow
    5757 * writing on AMD64, the two upper levels will have fixed flags whatever the
    5858 * guest is thinking of using there. So, when shadowing the PD level we will
     
    888888    pVM->pgm.s.GCPhysGstCR3Monitored = NIL_RTGCPHYS;
    889889    pVM->pgm.s.fA20Enabled      = true;
    890     pVM->pgm.s.pGstPaePDPTRHC   = NULL;
    891     pVM->pgm.s.pGstPaePDPTRGC   = 0;
     890    pVM->pgm.s.pGstPaePDPTHC    = NULL;
     891    pVM->pgm.s.pGstPaePDPTGC    = 0;
    892892    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGstPaePDsHC); i++)
    893893    {
     
    10731073    pVM->pgm.s.apInterPaePDs[2] = (PX86PDPAE)MMR3PageAlloc(pVM);
    10741074    pVM->pgm.s.apInterPaePDs[3] = (PX86PDPAE)MMR3PageAlloc(pVM);
    1075     pVM->pgm.s.pInterPaePDPTR   = (PX86PDPTR)MMR3PageAllocLow(pVM);
    1076     pVM->pgm.s.pInterPaePDPTR64 = (PX86PDPTR)MMR3PageAllocLow(pVM);
     1075    pVM->pgm.s.pInterPaePDPT    = (PX86PDPT)MMR3PageAllocLow(pVM);
     1076    pVM->pgm.s.pInterPaePDPT64  = (PX86PDPT)MMR3PageAllocLow(pVM);
    10771077    pVM->pgm.s.pInterPaePML4    = (PX86PML4)MMR3PageAllocLow(pVM);
    10781078    if (    !pVM->pgm.s.pInterPD
     
    10851085        ||  !pVM->pgm.s.apInterPaePDs[2]
    10861086        ||  !pVM->pgm.s.apInterPaePDs[3]
    1087         ||  !pVM->pgm.s.pInterPaePDPTR
    1088         ||  !pVM->pgm.s.pInterPaePDPTR64
     1087        ||  !pVM->pgm.s.pInterPaePDPT
     1088        ||  !pVM->pgm.s.pInterPaePDPT64
    10891089        ||  !pVM->pgm.s.pInterPaePML4)
    10901090    {
     
    10951095    pVM->pgm.s.HCPhysInterPD = MMPage2Phys(pVM, pVM->pgm.s.pInterPD);
    10961096    AssertRelease(pVM->pgm.s.HCPhysInterPD != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPD & PAGE_OFFSET_MASK));
    1097     pVM->pgm.s.HCPhysInterPaePDPTR = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR);
    1098     AssertRelease(pVM->pgm.s.HCPhysInterPaePDPTR != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPaePDPTR & PAGE_OFFSET_MASK));
     1097    pVM->pgm.s.HCPhysInterPaePDPT = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT);
     1098    AssertRelease(pVM->pgm.s.HCPhysInterPaePDPT != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPaePDPT & PAGE_OFFSET_MASK));
    10991099    pVM->pgm.s.HCPhysInterPaePML4 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePML4);
    11001100    AssertRelease(pVM->pgm.s.HCPhysInterPaePML4 != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPaePML4 & PAGE_OFFSET_MASK));
    11011101
    11021102    /*
    1103      * Initialize the pages, setting up the PML4 and PDPTR for repetitive 4GB action.
     1103     * Initialize the pages, setting up the PML4 and PDPT for repetitive 4GB action.
    11041104     */
    11051105    ASMMemZeroPage(pVM->pgm.s.pInterPD);
     
    11101110    ASMMemZeroPage(pVM->pgm.s.apInterPaePTs[1]);
    11111111
    1112     ASMMemZeroPage(pVM->pgm.s.pInterPaePDPTR);
     1112    ASMMemZeroPage(pVM->pgm.s.pInterPaePDPT);
    11131113    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apInterPaePDs); i++)
    11141114    {
    11151115        ASMMemZeroPage(pVM->pgm.s.apInterPaePDs[i]);
    1116         pVM->pgm.s.pInterPaePDPTR->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT
     1116        pVM->pgm.s.pInterPaePDPT->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT
    11171117                                          | MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[i]);
    11181118    }
    11191119
    1120     for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePDPTR64->a); i++)
     1120    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePDPT64->a); i++)
    11211121    {
    11221122        const unsigned iPD = i % ELEMENTS(pVM->pgm.s.apInterPaePDs);
    1123         pVM->pgm.s.pInterPaePDPTR64->a[i].u = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A | PGM_PLXFLAGS_PERMANENT
     1123        pVM->pgm.s.pInterPaePDPT64->a[i].u = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A | PGM_PLXFLAGS_PERMANENT
    11241124                                            | MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[iPD]);
    11251125    }
    11261126
    1127     RTHCPHYS HCPhysInterPaePDPTR64 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR64);
     1127    RTHCPHYS HCPhysInterPaePDPT64 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT64);
    11281128    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePML4->a); i++)
    11291129        pVM->pgm.s.pInterPaePML4->a[i].u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_US | X86_PML4E_A | PGM_PLXFLAGS_PERMANENT
    1130                                          | HCPhysInterPaePDPTR64;
     1130                                         | HCPhysInterPaePDPT64;
    11311131
    11321132    /*
     
    11351135     * avoid resource failure during mode switches. So, we need to cover all levels of the
    11361136     * of the first 4GB down to PD level.
    1137      * As with the intermediate context, AMD64 uses the PAE PDPTR and PDs.
     1137     * As with the intermediate context, AMD64 uses the PAE PDPT and PDs.
    11381138     */
    11391139    pVM->pgm.s.pHC32BitPD    = (PX86PD)MMR3PageAllocLow(pVM);
     
    11451145    pVM->pgm.s.apHCPaePDs[3] = (PX86PDPAE)MMR3PageAlloc(pVM);
    11461146    AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[2] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[3]);
    1147     pVM->pgm.s.pHCPaePDPTR   = (PX86PDPTR)MMR3PageAllocLow(pVM);
     1147    pVM->pgm.s.pHCPaePDPT    = (PX86PDPT)MMR3PageAllocLow(pVM);
    11481148    pVM->pgm.s.pHCPaePML4    = (PX86PML4)MMR3PageAllocLow(pVM);
    11491149    if (    !pVM->pgm.s.pHC32BitPD
     
    11521152        ||  !pVM->pgm.s.apHCPaePDs[2]
    11531153        ||  !pVM->pgm.s.apHCPaePDs[3]
    1154         ||  !pVM->pgm.s.pHCPaePDPTR
     1154        ||  !pVM->pgm.s.pHCPaePDPT
    11551155        ||  !pVM->pgm.s.pHCPaePML4)
    11561156    {
     
    11661166    pVM->pgm.s.aHCPhysPaePDs[2] = MMPage2Phys(pVM, pVM->pgm.s.apHCPaePDs[2]);
    11671167    pVM->pgm.s.aHCPhysPaePDs[3] = MMPage2Phys(pVM, pVM->pgm.s.apHCPaePDs[3]);
    1168     pVM->pgm.s.HCPhysPaePDPTR   = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePDPTR);
     1168    pVM->pgm.s.HCPhysPaePDPT    = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePDPT);
    11691169    pVM->pgm.s.HCPhysPaePML4    = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePML4);
    11701170
    11711171    /*
    1172      * Initialize the pages, setting up the PML4 and PDPTR for action below 4GB.
     1172     * Initialize the pages, setting up the PML4 and PDPT for action below 4GB.
    11731173     */
    11741174    ASMMemZero32(pVM->pgm.s.pHC32BitPD, PAGE_SIZE);
    11751175
    1176     ASMMemZero32(pVM->pgm.s.pHCPaePDPTR, PAGE_SIZE);
     1176    ASMMemZero32(pVM->pgm.s.pHCPaePDPT, PAGE_SIZE);
    11771177    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
    11781178    {
    11791179        ASMMemZero32(pVM->pgm.s.apHCPaePDs[i], PAGE_SIZE);
    1180         pVM->pgm.s.pHCPaePDPTR->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.aHCPhysPaePDs[i];
     1180        pVM->pgm.s.pHCPaePDPT->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.aHCPhysPaePDs[i];
    11811181        /* The flags will be corrected when entering and leaving long mode. */
    11821182    }
     
    11841184    ASMMemZero32(pVM->pgm.s.pHCPaePML4, PAGE_SIZE);
    11851185    pVM->pgm.s.pHCPaePML4->a[0].u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_A
    1186                                   | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.HCPhysPaePDPTR;
     1186                                  | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.HCPhysPaePDPT;
    11871187
    11881188    CPUMSetHyperCR3(pVM, (uint32_t)pVM->pgm.s.HCPhys32BitPD);
     
    12271227        LogFlow(("pgmR3InitPaging: returns successfully\n"));
    12281228#if HC_ARCH_BITS == 64
    1229 LogRel(("Debug: HCPhys32BitPD=%VHp aHCPhysPaePDs={%VHp,%VHp,%VHp,%VHp} HCPhysPaePDPTR=%VHp HCPhysPaePML4=%VHp\n",
     1229LogRel(("Debug: HCPhys32BitPD=%VHp aHCPhysPaePDs={%VHp,%VHp,%VHp,%VHp} HCPhysPaePDPT=%VHp HCPhysPaePML4=%VHp\n",
    12301230        pVM->pgm.s.HCPhys32BitPD, pVM->pgm.s.aHCPhysPaePDs[0], pVM->pgm.s.aHCPhysPaePDs[1], pVM->pgm.s.aHCPhysPaePDs[2], pVM->pgm.s.aHCPhysPaePDs[3],
    1231         pVM->pgm.s.HCPhysPaePDPTR, pVM->pgm.s.HCPhysPaePML4));
    1232 LogRel(("Debug: HCPhysInterPD=%VHp HCPhysInterPaePDPTR=%VHp HCPhysInterPaePML4=%VHp\n",
    1233         pVM->pgm.s.HCPhysInterPD, pVM->pgm.s.HCPhysInterPaePDPTR, pVM->pgm.s.HCPhysInterPaePML4));
    1234 LogRel(("Debug: apInterPTs={%VHp,%VHp} apInterPaePTs={%VHp,%VHp} apInterPaePDs={%VHp,%VHp,%VHp,%VHp} pInterPaePDPTR64=%VHp\n",
     1231        pVM->pgm.s.HCPhysPaePDPT, pVM->pgm.s.HCPhysPaePML4));
     1232LogRel(("Debug: HCPhysInterPD=%VHp HCPhysInterPaePDPT=%VHp HCPhysInterPaePML4=%VHp\n",
     1233        pVM->pgm.s.HCPhysInterPD, pVM->pgm.s.HCPhysInterPaePDPT, pVM->pgm.s.HCPhysInterPaePML4));
     1234LogRel(("Debug: apInterPTs={%VHp,%VHp} apInterPaePTs={%VHp,%VHp} apInterPaePDs={%VHp,%VHp,%VHp,%VHp} pInterPaePDPT64=%VHp\n",
    12351235        MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[1]),
    12361236        MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[1]),
    12371237        MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[1]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[2]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[3]),
    1238         MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR64)));
     1238        MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT64)));
    12391239#endif
    12401240
     
    13211321    STAM_REG(pVM, &pPGM->StatGCTrap0eMap,                   STAMTYPE_COUNTER, "/PGM/GC/Trap0e/GuestPF/Map",         STAMUNIT_OCCURENCES,     "Number of guest page faults due to map accesses.");
    13221322
     1323    STAM_REG(pVM, &pPGM->StatTrap0eWPEmulGC,                STAMTYPE_COUNTER, "/PGM/GC/Trap0e/WP/InGC",             STAMUNIT_OCCURENCES,     "Number of guest page faults due to X86_CR0_WP emulation.");
     1324    STAM_REG(pVM, &pPGM->StatTrap0eWPEmulR3,                STAMTYPE_COUNTER, "/PGM/GC/Trap0e/WP/ToR3",             STAMUNIT_OCCURENCES,     "Number of guest page faults due to X86_CR0_WP emulation (forward to R3 for emulation).");
    13231325
    13241326    STAM_REG(pVM, &pPGM->StatGCGuestCR3WriteHandled,        STAMTYPE_COUNTER, "/PGM/GC/CR3WriteInt",                STAMUNIT_OCCURENCES,     "The number of times the Guest CR3 change was successfully handled.");
     
    15241526    GCPtr += PAGE_SIZE; /* reserved page */
    15251527
    1526     rc = PGMMap(pVM, GCPtr, pVM->pgm.s.HCPhysPaePDPTR, PAGE_SIZE, 0);
     1528    rc = PGMMap(pVM, GCPtr, pVM->pgm.s.HCPhysPaePDPT, PAGE_SIZE, 0);
    15271529    AssertRCReturn(rc, rc);
    1528     pVM->pgm.s.pGCPaePDPTR = GCPtr;
     1530    pVM->pgm.s.pGCPaePDPT = GCPtr;
    15291531    GCPtr += PAGE_SIZE;
    15301532    GCPtr += PAGE_SIZE; /* reserved page */
     
    15871589    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGCPaePDs); i++)
    15881590        pVM->pgm.s.apGCPaePDs[i] += offDelta;
    1589     pVM->pgm.s.pGCPaePDPTR += offDelta;
     1591    pVM->pgm.s.pGCPaePDPT += offDelta;
    15901592    pVM->pgm.s.pGCPaePML4 += offDelta;
    15911593
     
    31523154 * @param   pHlp        Pointer to the output functions.
    31533155 */
    3154 static int  pgmR3DumpHierarchyHCPaePDPTR(PVM pVM, RTHCPHYS HCPhys, uint64_t u64Address, uint32_t cr4, bool fLongMode, unsigned cMaxDepth, PCDBGFINFOHLP pHlp)
    3155 {
    3156     PX86PDPTR pPDPTR = (PX86PDPTR)MMPagePhys2Page(pVM, HCPhys);
    3157     if (!pPDPTR)
     3156static int  pgmR3DumpHierarchyHCPaePDPT(PVM pVM, RTHCPHYS HCPhys, uint64_t u64Address, uint32_t cr4, bool fLongMode, unsigned cMaxDepth, PCDBGFINFOHLP pHlp)
     3157{
     3158    PX86PDPT pPDPT = (PX86PDPT)MMPagePhys2Page(pVM, HCPhys);
     3159    if (!pPDPT)
    31583160    {
    31593161        pHlp->pfnPrintf(pHlp, "%0*llx error! Page directory pointer table at HCPhys=%#VHp was not found in the page pool!\n",
     
    31633165
    31643166    int rc = VINF_SUCCESS;
    3165     const unsigned c = fLongMode ? ELEMENTS(pPDPTR->a) : X86_PG_PAE_PDPE_ENTRIES;
     3167    const unsigned c = fLongMode ? ELEMENTS(pPDPT->a) : X86_PG_PAE_PDPE_ENTRIES;
    31663168    for (unsigned i = 0; i < c; i++)
    31673169    {
    3168         X86PDPE Pdpe = pPDPTR->a[i];
     3170        X86PDPE Pdpe = pPDPT->a[i];
    31693171        if (Pdpe.n.u1Present)
    31703172        {
     
    31723174                pHlp->pfnPrintf(pHlp,         /*P R  S  A  D  G  WT CD AT NX 4M a p ?  */
    31733175                                "%016llx 1  |   P %c %c %c %c %c %s %s %s %s .. %c%c%c  %016llx\n",
    3174                                 u64Address + ((uint64_t)i << X86_PDPTR_SHIFT),
     3176                                u64Address + ((uint64_t)i << X86_PDPT_SHIFT),
    31753177                                Pdpe.n.u1Write       ? 'W'  : 'R',
    31763178                                Pdpe.n.u1User        ? 'U'  : 'S',
     
    31893191                pHlp->pfnPrintf(pHlp,      /*P R  S  A  D  G  WT CD AT NX 4M a p ?  */
    31903192                                "%08x 0 |    P %c %c %c %c %c %s %s %s %s .. %c%c%c  %016llx\n",
    3191                                 i << X86_PDPTR_SHIFT,
     3193                                i << X86_PDPT_SHIFT,
    31923194                                Pdpe.n.u1Write       ? '!'  : '.', /* mbz */
    31933195                                Pdpe.n.u1User        ? '!'  : '.', /* mbz */
     
    32053207            if (cMaxDepth >= 1)
    32063208            {
    3207                 int rc2 = pgmR3DumpHierarchyHCPaePD(pVM, Pdpe.u & X86_PDPE_PG_MASK, u64Address + ((uint64_t)i << X86_PDPTR_SHIFT),
     3209                int rc2 = pgmR3DumpHierarchyHCPaePD(pVM, Pdpe.u & X86_PDPE_PG_MASK, u64Address + ((uint64_t)i << X86_PDPT_SHIFT),
    32083210                                                    cr4, fLongMode, cMaxDepth - 1, pHlp);
    32093211                if (rc2 < rc && VBOX_SUCCESS(rc))
     
    32413243        if (Pml4e.n.u1Present)
    32423244        {
    3243             uint64_t u64Address = ((uint64_t)i << X86_PML4_SHIFT) | (((uint64_t)i >> (X86_PML4_SHIFT - X86_PDPTR_SHIFT - 1)) * 0xffff000000000000ULL);
     3245            uint64_t u64Address = ((uint64_t)i << X86_PML4_SHIFT) | (((uint64_t)i >> (X86_PML4_SHIFT - X86_PDPT_SHIFT - 1)) * 0xffff000000000000ULL);
    32443246            pHlp->pfnPrintf(pHlp,         /*P R  S  A  D  G  WT CD AT NX 4M a p ?  */
    32453247                            "%016llx 0 |    P %c %c %c %c %c %s %s %s %s .. %c%c%c  %016llx\n",
     
    32613263            if (cMaxDepth >= 1)
    32623264            {
    3263                 int rc2 = pgmR3DumpHierarchyHCPaePDPTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, u64Address, cr4, true, cMaxDepth - 1, pHlp);
     3265                int rc2 = pgmR3DumpHierarchyHCPaePDPT(pVM, Pml4e.u & X86_PML4E_PG_MASK, u64Address, cr4, true, cMaxDepth - 1, pHlp);
    32643266                if (rc2 < rc && VBOX_SUCCESS(rc))
    32653267                    rc = rc2;
     
    35973599        if (fLongMode)
    35983600            return pgmR3DumpHierarchyHcPaePML4(pVM, cr3 & X86_CR3_PAGE_MASK, cr4, cMaxDepth, pHlp);
    3599         return pgmR3DumpHierarchyHCPaePDPTR(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, 0, cr4, false, cMaxDepth, pHlp);
     3601        return pgmR3DumpHierarchyHCPaePDPT(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, 0, cr4, false, cMaxDepth, pHlp);
    36003602    }
    36013603    return pgmR3DumpHierarchyHC32BitPD(pVM, cr3 & X86_CR3_PAGE_MASK, cr4, cMaxDepth, pHlp);
  • trunk/src/VBox/VMM/PGMGst.h

    r7677 r7715  
    342342        for (unsigned i = 0; i < 4; i++)
    343343        {
    344             if (    pVM->pgm.s.pGstPaePDPTRHC->a[i].n.u1Present
    345                 &&  (pVM->pgm.s.pGstPaePDPTRHC->a[i].u & X86_PDPE_PG_MASK) != pVM->pgm.s.aGCPhysGstPaePDsMonitored[i])
     344            if (    pVM->pgm.s.pGstPaePDPTHC->a[i].n.u1Present
     345                &&  (pVM->pgm.s.pGstPaePDPTHC->a[i].u & X86_PDPE_PG_MASK) != pVM->pgm.s.aGCPhysGstPaePDsMonitored[i])
    346346            {
    347347                Log(("pgmR3GstPAEWriteHandlerCR3: detected updated PDPE; [%d] = %#llx, Old GCPhys=%VGp\n",
    348                      i, pVM->pgm.s.pGstPaePDPTRHC->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));
     348                     i, pVM->pgm.s.pGstPaePDPTHC->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));
    349349                /*
    350350                 * The PD has changed.
     
    406406        unsigned i;
    407407        for (i = 0; i < 4; i++)
    408             if (pVM->pgm.s.pGstPaePDPTRHC->a[i].u == (GCPhys & X86_PTE_PAE_PG_MASK))
     408            if (pVM->pgm.s.pGstPaePDPTHC->a[i].u == (GCPhys & X86_PTE_PAE_PG_MASK))
    409409            {
    410                 PX86PDPAE           pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPTR_SHIFT);
     410                PX86PDPAE           pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT_SHIFT);
    411411                const RTGCUINTPTR   offPD = GCPhys & PAGE_OFFSET_MASK;
    412412                const unsigned      iPD1 = offPD / sizeof(X86PDEPAE);
     
    414414                Assert(iPD1 - iPD2 <= 1);
    415415                if (    (   pPDSrc->a[iPD1].n.u1Present
    416                          && pgmGetMapping(pVM, (i << X86_PDPTR_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)) )
     416                         && pgmGetMapping(pVM, (i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)) )
    417417                    ||  (   iPD1 != iPD2
    418418                         && pPDSrc->a[iPD2].n.u1Present
    419                          && pgmGetMapping(pVM, (i << X86_PDPTR_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)) )
     419                         && pgmGetMapping(pVM, (i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)) )
    420420                   )
    421421                {
  • trunk/src/VBox/VMM/PGMInternal.h

    r7676 r7715  
    163163
    164164
    165 /** @name PDPTR and PML4 flags.
     165/** @name PDPT and PML4 flags.
    166166 * These are placed in the three bits available for system programs in
    167  * the PDPTR and PML4 entries.
     167 * the PDPT and PML4 entries.
    168168 * @{ */
    169169/** The entry is a permanent one and it's must always be present.
     
    12811281#define PGMPOOL_IDX_PAE_PD      2
    12821282/** Page Directory Pointer Table (PAE root, not currently used). */
    1283 #define PGMPOOL_IDX_PDPTR       3
     1283#define PGMPOOL_IDX_PDPT        3
    12841284/** Page Map Level-4 (64-bit root). */
    12851285#define PGMPOOL_IDX_PML4        4
     
    13611361
    13621362    /** Shw: 64-bit page directory pointer table;   Gst: 64-bit page directory pointer table. */
    1363     PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR,
     1363    PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT,
    13641364
    13651365    /** Shw: Root 32-bit page directory. */
     
    13681368    PGMPOOLKIND_ROOT_PAE_PD,
    13691369    /** Shw: Root PAE page directory pointer table (legacy, 4 entries). */
    1370     PGMPOOLKIND_ROOT_PDPTR,
     1370    PGMPOOLKIND_ROOT_PDPT,
    13711371    /** Shw: Root page map level-4 table. */
    13721372    PGMPOOLKIND_ROOT_PML4,
     
    19091909     * @{ */
    19101910    /** The guest's page directory pointer table, static GC mapping. */
    1911     GCPTRTYPE(PX86PDPTR)        pGstPaePDPTRGC;
     1911    GCPTRTYPE(PX86PDPT)         pGstPaePDPTGC;
    19121912    /** The guest's page directory pointer table, HC pointer. */
    1913     R3R0PTRTYPE(PX86PDPTR)      pGstPaePDPTRHC;
     1913    R3R0PTRTYPE(PX86PDPT)       pGstPaePDPTHC;
    19141914    /** The guest's page directories, HC pointers.
    19151915     * These are individual pointers and doesn't have to be adjecent.
     
    19521952     * These are *NOT* 4 contiguous pages. */
    19531953    RTHCPHYS                    aHCPhysPaePDs[4];
    1954     /** The PAE PDPTR - HC Ptr. */
    1955     R3R0PTRTYPE(PX86PDPTR)      pHCPaePDPTR;
    1956     /** The Physical Address (HC) of the PAE PDPTR. */
    1957     RTHCPHYS                    HCPhysPaePDPTR;
    1958     /** The PAE PDPTR - GC Ptr. */
    1959     GCPTRTYPE(PX86PDPTR)        pGCPaePDPTR;
     1954    /** The PAE PDP - HC Ptr. */
     1955    R3R0PTRTYPE(PX86PDPT)       pHCPaePDPT;
     1956    /** The Physical Address (HC) of the PAE PDPT. */
     1957    RTHCPHYS                    HCPhysPaePDPT;
     1958    /** The PAE PDPT - GC Ptr. */
     1959    GCPTRTYPE(PX86PDPT)         pGCPaePDPT;
    19601960    /** @} */
    19611961
     
    21442144    R3PTRTYPE(PX86PDPAE)            apInterPaePDs[4];
    21452145    /** Pointer to the intermedate page directory - PAE. */
    2146     R3PTRTYPE(PX86PDPTR)            pInterPaePDPTR;
     2146    R3PTRTYPE(PX86PDPT)             pInterPaePDPT;
    21472147    /** Pointer to the intermedate page-map level 4 - AMD64. */
    21482148    R3PTRTYPE(PX86PML4)             pInterPaePML4;
    21492149    /** Pointer to the intermedate page directory - AMD64. */
    2150     R3PTRTYPE(PX86PDPTR)            pInterPaePDPTR64;
     2150    R3PTRTYPE(PX86PDPT)             pInterPaePDPT64;
    21512151    /** The Physical Address (HC) of the intermediate Page Directory - Normal. */
    21522152    RTHCPHYS                        HCPhysInterPD;
    21532153    /** The Physical Address (HC) of the intermediate Page Directory Pointer Table - PAE. */
    2154     RTHCPHYS                        HCPhysInterPaePDPTR;
     2154    RTHCPHYS                        HCPhysInterPaePDPT;
    21552155    /** The Physical Address (HC) of the intermediate Page Map Level 4 table - AMD64. */
    21562156    RTHCPHYS                        HCPhysInterPaePML4;
     
    23052305    STAMCOUNTER     StatGCTrap0eSVReserved;
    23062306    STAMCOUNTER     StatGCTrap0eSNXE;
     2307
     2308    STAMCOUNTER     StatTrap0eWPEmulGC;
     2309    STAMCOUNTER     StatTrap0eWPEmulR3;
    23072310
    23082311    STAMCOUNTER     StatGCTrap0eUnhandled;
     
    31893192DECLINLINE(PX86PDPAE) pgmGstGetPaePD(PPGM pPGM, RTGCUINTPTR GCPtr)
    31903193{
    3191     const unsigned iPdPtr = GCPtr >> X86_PDPTR_SHIFT;
    3192     if (CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].n.u1Present)
     3194    const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT;
     3195    if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present)
    31933196    {
    3194         if ((CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])
    3195             return CTXSUFF(pPGM->apGstPaePDs)[iPdPtr];
     3197        if ((CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])
     3198            return CTXSUFF(pPGM->apGstPaePDs)[iPdPt];
    31963199
    31973200        /* cache is out-of-sync. */
    31983201        PX86PDPAE pPD;
    3199         int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK, &pPD);
     3202        int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD);
    32003203        if (VBOX_SUCCESS(rc))
    32013204            return pPD;
    3202         AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u));
     3205        AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u));
    32033206        /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emulated as all 0s. */
    32043207    }
     
    32173220DECLINLINE(PX86PDEPAE) pgmGstGetPaePDEPtr(PPGM pPGM, RTGCUINTPTR GCPtr)
    32183221{
    3219     const unsigned iPdPtr = GCPtr >> X86_PDPTR_SHIFT;
    3220     if (CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].n.u1Present)
     3222    const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT;
     3223    if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present)
    32213224    {
    32223225        const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    3223         if ((CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])
    3224             return &CTXSUFF(pPGM->apGstPaePDs)[iPdPtr]->a[iPD];
     3226        if ((CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])
     3227            return &CTXSUFF(pPGM->apGstPaePDs)[iPdPt]->a[iPD];
    32253228
    32263229        /* The cache is out-of-sync. */
    32273230        PX86PDPAE pPD;
    3228         int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK, &pPD);
     3231        int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD);
    32293232        if (VBOX_SUCCESS(rc))
    32303233            return &pPD->a[iPD];
    3231         AssertMsgFailed(("Impossible! rc=%Vrc PDPE=%RX64\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u));
     3234        AssertMsgFailed(("Impossible! rc=%Vrc PDPE=%RX64\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u));
    32323235        /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page or something which we'll emulate as all 0s. */
    32333236    }
     
    32463249DECLINLINE(uint64_t) pgmGstGetPaePDE(PPGM pPGM, RTGCUINTPTR GCPtr)
    32473250{
    3248     const unsigned iPdPtr = GCPtr >> X86_PDPTR_SHIFT;
    3249     if (CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].n.u1Present)
     3251    const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT;
     3252    if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present)
    32503253    {
    32513254        const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    3252         if ((CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])
    3253             return CTXSUFF(pPGM->apGstPaePDs)[iPdPtr]->a[iPD].u;
     3255        if ((CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])
     3256            return CTXSUFF(pPGM->apGstPaePDs)[iPdPt]->a[iPD].u;
    32543257
    32553258        /* cache is out-of-sync. */
    32563259        PX86PDPAE pPD;
    3257         int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK, &pPD);
     3260        int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD);
    32583261        if (VBOX_SUCCESS(rc))
    32593262            return pPD->a[iPD].u;
    3260         AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u));
     3263        AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u));
    32613264    }
    32623265    return 0ULL;
     
    32733276 * @param   piPD        Receives the index into the returned page directory
    32743277 */
    3275 DECLINLINE(PX86PDPAE) pgmGstGetPaePDPtr(PPGM pPGM, RTGCUINTPTR GCPtr, unsigned *piPD)
    3276 {
    3277     const unsigned iPdPtr = GCPtr >> X86_PDPTR_SHIFT;
    3278     if (CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].n.u1Present)
     3278DECLINLINE(PX86PDPAE) pgmGstGetPaePDPt(PPGM pPGM, RTGCUINTPTR GCPtr, unsigned *piPD)
     3279{
     3280    const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT;
     3281    if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present)
    32793282    {
    32803283        const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    3281         if ((CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])
     3284        if ((CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt])
    32823285        {
    32833286            *piPD = iPD;
    3284             return CTXSUFF(pPGM->apGstPaePDs)[iPdPtr];
     3287            return CTXSUFF(pPGM->apGstPaePDs)[iPdPt];
    32853288        }
    32863289
    32873290        /* cache is out-of-sync. */
    32883291        PX86PDPAE pPD;
    3289         int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK, &pPD);
     3292        int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD);
    32903293        if (VBOX_SUCCESS(rc))
    32913294        {
     
    32933296            return pPD;
    32943297        }
    3295         AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u));
     3298        AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u));
    32963299        /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emulated as all 0s. */
    32973300    }
  • trunk/src/VBox/VMM/PGMMap.cpp

    r7658 r7715  
    587587         * PAE.
    588588         */
    589         const unsigned iPDPE= (uAddress >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
     589        const unsigned iPDPE= (uAddress >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
    590590        iPDE = (uAddress >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    591591        iPTE = (uAddress >> X86_PT_PAE_SHIFT) & X86_PT_PAE_MASK;
     
    660660         * PAE
    661661         */
    662         const unsigned iPDPE= (uAddress >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
     662        const unsigned iPDPE= (uAddress >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
    663663        iPDE = (uAddress >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    664664        iPTE = (uAddress >> X86_PT_PAE_SHIFT) & X86_PT_PAE_MASK;
  • trunk/src/VBox/VMM/PGMPool.cpp

    r5999 r7715  
    246246    pPool->aPages[PGMPOOL_IDX_PAE_PD].idx       = PGMPOOL_IDX_PAE_PD;
    247247
    248     /* The Shadow PDPTR. */
    249     pPool->aPages[PGMPOOL_IDX_PDPTR].Core.Key  = NIL_RTHCPHYS;
    250     pPool->aPages[PGMPOOL_IDX_PDPTR].GCPhys    = NIL_RTGCPHYS;
    251     pPool->aPages[PGMPOOL_IDX_PDPTR].pvPageHC  = pVM->pgm.s.pHCPaePDPTR;
    252     pPool->aPages[PGMPOOL_IDX_PDPTR].enmKind   = PGMPOOLKIND_ROOT_PDPTR;
    253     pPool->aPages[PGMPOOL_IDX_PDPTR].idx       = PGMPOOL_IDX_PDPTR;
     248    /* The Shadow PDPT. */
     249    pPool->aPages[PGMPOOL_IDX_PDPT].Core.Key  = NIL_RTHCPHYS;
     250    pPool->aPages[PGMPOOL_IDX_PDPT].GCPhys    = NIL_RTGCPHYS;
     251    pPool->aPages[PGMPOOL_IDX_PDPT].pvPageHC  = pVM->pgm.s.pHCPaePDPT;
     252    pPool->aPages[PGMPOOL_IDX_PDPT].enmKind   = PGMPOOLKIND_ROOT_PDPT;
     253    pPool->aPages[PGMPOOL_IDX_PDPT].idx       = PGMPOOL_IDX_PDPT;
    254254
    255255    /* The Shadow Page Map Level-4. */
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r7676 r7715  
    753753        case PGMMODE_PAE:
    754754        case PGMMODE_PAE_NX:
    755             return pVM->pgm.s.HCPhysPaePDPTR;
     755            return pVM->pgm.s.HCPhysPaePDPT;
    756756
    757757        case PGMMODE_AMD64:
     
    784784PGMDECL(uint32_t) PGMGetHyperPaeCR3(PVM pVM)
    785785{
    786     return pVM->pgm.s.HCPhysPaePDPTR;
     786    return pVM->pgm.s.HCPhysPaePDPT;
    787787}
    788788
     
    816816        case SUPPAGINGMODE_PAE_NX:
    817817        case SUPPAGINGMODE_PAE_GLOBAL_NX:
    818             return pVM->pgm.s.HCPhysInterPaePDPTR;
     818            return pVM->pgm.s.HCPhysInterPaePDPT;
    819819
    820820        case SUPPAGINGMODE_AMD64:
     
    822822        case SUPPAGINGMODE_AMD64_NX:
    823823        case SUPPAGINGMODE_AMD64_GLOBAL_NX:
    824             return pVM->pgm.s.HCPhysInterPaePDPTR;
     824            return pVM->pgm.s.HCPhysInterPaePDPT;
    825825
    826826        default:
     
    845845        case PGMMODE_PAE:
    846846        case PGMMODE_PAE_NX:
    847             return pVM->pgm.s.HCPhysInterPaePDPTR;
     847            return pVM->pgm.s.HCPhysInterPaePDPT;
    848848
    849849        case PGMMODE_AMD64:
     
    876876PGMDECL(uint32_t) PGMGetInterPaeCR3(PVM pVM)
    877877{
    878     return pVM->pgm.s.HCPhysInterPaePDPTR;
     878    return pVM->pgm.s.HCPhysInterPaePDPT;
    879879}
    880880
     
    894894 * Performs and schedules necessary updates following a CR3 load or reload.
    895895 *
    896  * This will normally involve mapping the guest PD or nPDPTR
     896 * This will normally involve mapping the guest PD or nPDPT
    897897 *
    898898 * @returns VBox status code.
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r7702 r7715  
    9494#  else /* PAE */
    9595    unsigned        iPDSrc;
    96     PGSTPD          pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, (RTGCUINTPTR)pvFault, &iPDSrc);
     96    PGSTPD          pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, (RTGCUINTPTR)pvFault, &iPDSrc);
    9797#  endif
    9898# else
     
    522522            STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b);
    523523
     524            /* Check to see if we need to emulate the instruction as X86_CR0_WP has been cleared. */
     525            if (    CPUMGetGuestCPL(pVM, pRegFrame) == 0               
     526                &&  ((CPUMGetGuestCR0(pVM) & (X86_CR0_WP|X86_CR0_PG)) == X86_CR0_PG)
     527                &&  (uErr & X86_TRAP_PF_RW))
     528            {
     529                uint64_t fPageGst;
     530                rc = PGMGstGetPage(pVM, pvFault, &fPageGst, NULL);
     531                if (    VBOX_SUCCESS(rc)
     532                    && !(fPageGst & X86_PTE_RW))
     533                {
     534                    rc = PGMInterpretInstruction(pVM, pRegFrame, pvFault);
     535                    if (VBOX_SUCCESS(rc))
     536                        STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulGC);
     537                    else
     538                        STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulR3);
     539                    return rc;
     540                }
     541            }
     542
    524543# ifdef PGM_OUT_OF_SYNC_IN_GC
    525544            /*
     
    801820#  else /* PAE */
    802821    unsigned        iPDSrc;
    803     PX86PDPAE       pPDSrc      = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc);
     822    PX86PDPAE       pPDSrc      = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc);
    804823    GSTPDE          PdeSrc      = pPDSrc->a[iPDSrc];
    805824#  endif
     
    16011620PGM_BTH_DECL(int, CheckPageFault)(PVM pVM, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCUINTPTR GCPtrPage)
    16021621{
     1622    bool fWriteProtect   = !!(CPUMGetGuestCR0(pVM) & X86_CR0_WP);
     1623    bool fUserLevelFault = !!(uErr & X86_TRAP_PF_US);
     1624    bool fWriteFault     = !!(uErr & X86_TRAP_PF_RW);
     1625
    16031626    STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a);
    16041627    LogFlow(("CheckPageFault: GCPtrPage=%VGv uErr=%#x PdeSrc=%08x\n", GCPtrPage, uErr, pPdeSrc->u));
     
    16121635        ||  ((uErr & X86_TRAP_PF_ID) &&  pPdeSrc->n.u1NoExecute)
    16131636#  endif
    1614         ||  ((uErr & X86_TRAP_PF_RW) && !pPdeSrc->n.u1Write)
    1615         ||  ((uErr & X86_TRAP_PF_US) && !pPdeSrc->n.u1User) )
     1637        ||  (fWriteFault && !pPdeSrc->n.u1Write && (fUserLevelFault || fWriteProtect))
     1638        ||  (fUserLevelFault && !pPdeSrc->n.u1User) )
    16161639    {
    16171640#  ifdef IN_GC
     
    16621685         * Only write protection page faults are relevant here.
    16631686         */
    1664         if (uErr & X86_TRAP_PF_RW)
     1687        if (fWriteFault)
    16651688        {
    16661689            /* Mark guest page directory as dirty (BIG page only). */
     
    17021725            ||  ((uErr & X86_TRAP_PF_ID) && !PteSrc.n.u1NoExecute)
    17031726#  endif
    1704             ||  ((uErr & X86_TRAP_PF_RW) && !PteSrc.n.u1Write)
    1705             ||  ((uErr & X86_TRAP_PF_US) && !PteSrc.n.u1User)
     1727            ||  (fWriteFault && !PteSrc.n.u1Write && (fUserLevelFault || fWriteProtect))
     1728            ||  (fUserLevelFault && !PteSrc.n.u1User)
    17061729           )
    17071730        {
     
    17321755         * Only write protection page faults are relevant here.
    17331756         */
    1734         if (uErr & X86_TRAP_PF_RW)
     1757        if (fWriteFault)
    17351758        {
    17361759            /* Write access, so mark guest entry as dirty. */
     
    22802303#  else /* PAE */
    22812304    unsigned        iPDSrc;
    2282     PGSTPD          pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc);
     2305    PGSTPD          pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc);
    22832306#  endif
    22842307    const GSTPDE    PdeSrc = pPDSrc->a[iPDSrc];
     
    23702393#  else /* PAE */
    23712394    unsigned        iPDSrc;
    2372     PGSTPD          pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc);
     2395    PGSTPD          pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc);
    23732396#  endif
    23742397# else
     
    25742597    }
    25752598#  if PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64
    2576     for (unsigned iPDPTRE = 0; iPDPTRE < GST_PDPE_ENTRIES; iPDPTRE++)
     2599    for (unsigned iPDPTE = 0; iPDPTE < GST_PDPE_ENTRIES; iPDPTE++)
    25772600    {
    25782601        unsigned        iPDSrc;
    25792602#   if PGM_SHW_TYPE == PGM_TYPE_PAE
    2580         PX86PDPAE       pPDPAE    = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTRE * X86_PG_PAE_ENTRIES];
     2603        PX86PDPAE       pPDPAE    = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTE * X86_PG_PAE_ENTRIES];
    25812604#   else
    25822605        AssertFailed(); /* @todo */
    2583         PX86PDPE        pPDPAE    = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTRE * X86_PG_AMD64_ENTRIES];
     2606        PX86PDPE        pPDPAE    = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTE * X86_PG_AMD64_ENTRIES];
    25842607#   endif
    25852608        PX86PDEPAE      pPDEDst   = &pPDPAE->a[0];
    2586         PGSTPD          pPDSrc    = pgmGstGetPaePDPtr(&pVM->pgm.s, iPDPTRE << X86_PDPTR_SHIFT, &iPDSrc);
     2609        PGSTPD          pPDSrc    = pgmGstGetPaePDPt(&pVM->pgm.s, iPDPTE << X86_PDPT_SHIFT, &iPDSrc);
    25872610
    25882611        if (pPDSrc == NULL)
    25892612        {
    2590             /* PDPTR not present */
    2591             pVM->pgm.s.CTXMID(p,PaePDPTR)->a[iPDPTRE].n.u1Present = 0;
     2613            /* PDPT not present */
     2614            pVM->pgm.s.CTXMID(p,PaePDPT)->a[iPDPTE].n.u1Present = 0;
    25922615            continue;
    25932616        }
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r7677 r7715  
    388388#elif PGM_GST_TYPE == PGM_TYPE_PAE
    389389            const unsigned off = GCPhysCR3 & X86_CR3_PAE_PAGE_MASK;
    390             pVM->pgm.s.pGstPaePDPTRHC = (R3R0PTRTYPE(PX86PDPTR))((RTHCUINTPTR)HCPtrGuestCR3 | off);
    391             pVM->pgm.s.pGstPaePDPTRGC = (GCPTRTYPE(PX86PDPTR))((RTGCUINTPTR)pVM->pgm.s.GCPtrCR3Mapping | off);
     390            pVM->pgm.s.pGstPaePDPTHC = (R3R0PTRTYPE(PX86PDPT))((RTHCUINTPTR)HCPtrGuestCR3 | off);
     391            pVM->pgm.s.pGstPaePDPTGC = (GCPTRTYPE(PX86PDPT))((RTGCUINTPTR)pVM->pgm.s.GCPtrCR3Mapping | off);
    392392
    393393            /*
     
    397397            for (unsigned i = 0; i < 4; i++, GCPtr += PAGE_SIZE)
    398398            {
    399                 if (pVM->pgm.s.CTXSUFF(pGstPaePDPTR)->a[i].n.u1Present)
     399                if (pVM->pgm.s.CTXSUFF(pGstPaePDPT)->a[i].n.u1Present)
    400400                {
    401401                    RTHCPTR     HCPtr;
    402402                    RTHCPHYS    HCPhys;
    403                     RTGCPHYS    GCPhys = pVM->pgm.s.CTXSUFF(pGstPaePDPTR)->a[i].u & X86_PDPE_PG_MASK;
     403                    RTGCPHYS    GCPhys = pVM->pgm.s.CTXSUFF(pGstPaePDPT)->a[i].u & X86_PDPE_PG_MASK;
    404404                    int rc2 = pgmRamGCPhys2HCPtrAndHCPhysWithFlags(&pVM->pgm.s, GCPhys, &HCPtr, &HCPhys);
    405405                    if (VBOX_SUCCESS(rc2))
     
    452452
    453453#elif PGM_GST_TYPE == PGM_TYPE_PAE
    454     pVM->pgm.s.pGstPaePDPTRHC = 0;
    455     pVM->pgm.s.pGstPaePDPTRGC = 0;
     454    pVM->pgm.s.pGstPaePDPTHC = 0;
     455    pVM->pgm.s.pGstPaePDPTGC = 0;
    456456    /** PAE todo: pVM->pgm.s.apGstPaePDsHC? -> unmap?? */
    457457    AssertFailed();
     
    529529    for (unsigned i = 0; i < 4; i++)
    530530    {
    531         if (CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].n.u1Present)
    532         {
    533             RTGCPHYS GCPhys = CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].u & X86_PDPE_PG_MASK;
     531        if (CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].n.u1Present)
     532        {
     533            RTGCPHYS GCPhys = CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].u & X86_PDPE_PG_MASK;
    534534# ifndef PGMPOOL_WITH_MIXED_PT_CR3
    535535            if (pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] != GCPhys)
     
    970970        for (unsigned i = 0; i < 4; i++)
    971971        {
    972             if (    CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].n.u1Present
    973                 &&  (   CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].u & X86_PDPE_PG_MASK)
     972            if (    CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].n.u1Present
     973                &&  (   CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].u & X86_PDPE_PG_MASK)
    974974                     != pVM->pgm.s.aGCPhysGstPaePDsMonitored[i])
    975975            {
     
    986986                pVM->pgm.s.fSyncFlags |= PGM_SYNC_MONITOR_CR3;
    987987                Log(("pgmXXGstPaeWriteHandlerCR3: detected updated PDPE; [%d] = %#llx, Old GCPhys=%VGp\n",
    988                      i, CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));
     988                     i, CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));
    989989            }
    990990        }
     
    10351035        RTGCUINTPTR i;
    10361036        for (i = 0; i < 4; i++)
    1037             if (CTXSUFF(pVM->pgm.s.pGstPaePDPTR)->a[i].u == (GCPhysFault & X86_PTE_PAE_PG_MASK))
     1037            if (CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].u == (GCPhysFault & X86_PTE_PAE_PG_MASK))
    10381038            {
    1039                 PX86PDPAE           pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPTR_SHIFT);
     1039                PX86PDPAE           pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT_SHIFT);
    10401040                const RTGCUINTPTR offPD  = GCPhysFault & PAGE_OFFSET_MASK;
    10411041                const unsigned      iPD1   = offPD / sizeof(X86PDEPAE);
     
    10481048#ifdef DEBUG
    10491049                Log(("pgmXXGstPaeWriteHandlerPD: emulated change to i=%d iPD1=%#05x (%VGv)\n",
    1050                      i, iPD1, (i << X86_PDPTR_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)));
     1050                     i, iPD1, (i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)));
    10511051                if (iPD1 != iPD2)
    10521052                    Log(("pgmXXGstPaeWriteHandlerPD: emulated change to i=%d iPD2=%#05x (%VGv)\n",
    1053                          i, iPD2, (i << X86_PDPTR_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)));
     1053                         i, iPD2, (i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)));
    10541054#endif
    10551055
     
    10571057                {
    10581058                    if (    (   pPDSrc->a[iPD1].n.u1Present
    1059                              && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPTR_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT))) )
     1059                             && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT))) )
    10601060                        ||  (   iPD1 != iPD2
    10611061                             && pPDSrc->a[iPD2].n.u1Present
    1062                              && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPTR_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT))) )
     1062                             && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT))) )
    10631063                       )
    10641064                    {
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r7655 r7715  
    10201020        Assert(PGMGetGuestMode(pVM) < PGMMODE_AMD64);
    10211021
    1022         PX86PDPTR pPdptr;
    1023         rc = PGM_GCPHYS_2_PTR(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, &pPdptr);
     1022        PX86PDPT pPdpt;
     1023        rc = PGM_GCPHYS_2_PTR(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, &pPdpt);
    10241024        if (VBOX_SUCCESS(rc))
    10251025        {
    1026             X86PDPE Pdpe = pPdptr->a[((RTGCUINTPTR)GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK];
     1026            X86PDPE Pdpe = pPdpt->a[((RTGCUINTPTR)GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK];
    10271027            if (Pdpe.n.u1Present)
    10281028            {
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r7677 r7715  
    109109        case PGMPOOL_IDX_PAE_PD:
    110110            return pVM->pgm.s.apGCPaePDs[0];
    111         case PGMPOOL_IDX_PDPTR:
    112             return pVM->pgm.s.pGCPaePDPTR;
     111        case PGMPOOL_IDX_PDPT:
     112            return pVM->pgm.s.pGCPaePDPT;
    113113        case PGMPOOL_IDX_PML4:
    114114            return pVM->pgm.s.pGCPaePML4;
     
    896896                case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    897897                case PGMPOOLKIND_PAE_PT_FOR_PAE_PT:
    898                 case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     898                case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    899899                case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB:
    900900                case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
     
    910910        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    911911        case PGMPOOLKIND_PAE_PT_FOR_PAE_PT:
    912         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     912        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    913913        case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB:
    914914            switch (enmKind2)
     
    931931        case PGMPOOLKIND_ROOT_32BIT_PD:
    932932        case PGMPOOLKIND_ROOT_PAE_PD:
    933         case PGMPOOLKIND_ROOT_PDPTR:
     933        case PGMPOOLKIND_ROOT_PDPT:
    934934        case PGMPOOLKIND_ROOT_PML4:
    935935            return false;
     
    11141114                case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    11151115                case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    1116                 case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     1116                case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    11171117                case PGMPOOLKIND_ROOT_32BIT_PD:
    11181118                case PGMPOOLKIND_ROOT_PAE_PD:
    1119                 case PGMPOOLKIND_ROOT_PDPTR:
     1119                case PGMPOOLKIND_ROOT_PDPT:
    11201120                case PGMPOOLKIND_ROOT_PML4:
    11211121                {
     
    11841184        case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    11851185        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    1186         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
    1187         case PGMPOOLKIND_ROOT_PDPTR:
     1186        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
     1187        case PGMPOOLKIND_ROOT_PDPT:
    11881188        case PGMPOOLKIND_ROOT_PML4:
    11891189        default:
     
    12651265        case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    12661266        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    1267         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
    1268         case PGMPOOLKIND_ROOT_PDPTR:
     1267        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
     1268        case PGMPOOLKIND_ROOT_PDPT:
    12691269        case PGMPOOLKIND_ROOT_PML4:
    12701270        default:
     
    19371937        case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    19381938        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    1939         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     1939        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    19401940        case PGMPOOLKIND_ROOT_PAE_PD:
    1941         case PGMPOOLKIND_ROOT_PDPTR:
     1941        case PGMPOOLKIND_ROOT_PDPT:
    19421942        case PGMPOOLKIND_ROOT_PML4:
    19431943            return 8;
     
    19731973        case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB:
    19741974        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    1975         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     1975        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    19761976        case PGMPOOLKIND_ROOT_PAE_PD:
    1977         case PGMPOOLKIND_ROOT_PDPTR:
     1977        case PGMPOOLKIND_ROOT_PDPT:
    19781978        case PGMPOOLKIND_ROOT_PML4:
    19791979            return 8;
     
    22782278            Assert(pUser->iUserTable < 2048 && pUser->iUser == PGMPOOL_IDX_PAE_PD);
    22792279            break;
    2280         case PGMPOOLKIND_ROOT_PDPTR:
     2280        case PGMPOOLKIND_ROOT_PDPT:
    22812281            Assert(!(u.pau64[pUser->iUserTable] & PGM_PLXFLAGS_PERMANENT));
    22822282            Assert(pUser->iUserTable < 4);
     
    22862286            Assert(pUser->iUserTable < X86_PG_PAE_ENTRIES);
    22872287            break;
    2288         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     2288        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    22892289        case PGMPOOLKIND_ROOT_PML4:
    22902290            Assert(!(u.pau64[pUser->iUserTable] & PGM_PLXFLAGS_PERMANENT));
     
    23092309        /* 64-bit entries */
    23102310        case PGMPOOLKIND_ROOT_PAE_PD:
    2311         case PGMPOOLKIND_ROOT_PDPTR:
     2311        case PGMPOOLKIND_ROOT_PDPT:
    23122312        case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    23132313        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    2314         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
     2314        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    23152315        case PGMPOOLKIND_ROOT_PML4:
    23162316            u.pau64[pUser->iUserTable] = 0;
     
    28362836 * @param   pPool       The pool.
    28372837 * @param   pPage       The page.
    2838  * @param   pShwPdPtr   The shadow page directory pointer table (mapping of the page).
    2839  */
    2840 DECLINLINE(void) pgmPoolTrackDerefPDPTR64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPTR pShwPdPtr)
    2841 {
    2842     for (unsigned i = 0; i < ELEMENTS(pShwPdPtr->a); i++)
    2843     {
    2844         if (pShwPdPtr->a[i].n.u1Present)
    2845         {
    2846             PPGMPOOLPAGE pSubPage = (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, pShwPdPtr->a[i].u & X86_PDPE_PG_MASK);
     2838 * @param   pShwPDPT   The shadow page directory pointer table (mapping of the page).
     2839 */
     2840DECLINLINE(void) pgmPoolTrackDerefPDPT64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPT pShwPDPT)
     2841{
     2842    for (unsigned i = 0; i < ELEMENTS(pShwPDPT->a); i++)
     2843    {
     2844        if (pShwPDPT->a[i].n.u1Present)
     2845        {
     2846            PPGMPOOLPAGE pSubPage = (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, pShwPDPT->a[i].u & X86_PDPE_PG_MASK);
    28472847            if (pSubPage)
    28482848                pgmPoolTrackFreeUser(pPool, pSubPage, pPage->idx, i);
    28492849            else
    2850                 AssertFatalMsgFailed(("%RX64\n", pShwPdPtr->a[i].u & X86_PDPE_PG_MASK));
     2850                AssertFatalMsgFailed(("%RX64\n", pShwPDPT->a[i].u & X86_PDPE_PG_MASK));
    28512851            /** @todo 64-bit guests: have to ensure that we're not exhausting the dynamic mappings! */
    28522852        }
     
    29362936            break;
    29372937
    2938         case PGMPOOLKIND_64BIT_PDPTR_FOR_64BIT_PDPTR:
    2939             pgmPoolTrackDerefPDPTR64Bit(pPool, pPage, (PX86PDPTR)pvShw);
     2938        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
     2939            pgmPoolTrackDerefPDPT64Bit(pPool, pPage, (PX86PDPT)pvShw);
    29402940            break;
    29412941
     
    30003000                break;
    30013001
    3002             case PGMPOOLKIND_ROOT_PDPTR:
     3002            case PGMPOOLKIND_ROOT_PDPT:
    30033003                /* Not root of shadowed pages currently, ignore it. */
    30043004                break;
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r7677 r7715  
    3434#undef SHW_PT_MASK
    3535#undef SHW_TOTAL_PD_ENTRIES
    36 #undef SHW_PDPTR_SHIFT
    37 #undef SHW_PDPTR_MASK
     36#undef SHW_PDPT_SHIFT
     37#undef SHW_PDPT_MASK
    3838#undef SHW_POOL_ROOT_IDX
    3939
     
    7171# define SHW_PT_MASK            X86_PT_PAE_MASK
    7272#if PGM_SHW_TYPE == PGM_TYPE_AMD64
    73 # define SHW_PDPTR_SHIFT        X86_PDPTR_SHIFT
    74 # define SHW_PDPTR_MASK         X86_PDPTR_MASK
     73# define SHW_PDPT_SHIFT        X86_PDPT_SHIFT
     74# define SHW_PDPT_MASK         X86_PDPT_MASK
    7575# define SHW_TOTAL_PD_ENTRIES   (X86_PG_AMD64_ENTRIES*X86_PG_AMD64_PDPE_ENTRIES)
    7676# define SHW_POOL_ROOT_IDX      PGMPOOL_IDX_PML4
    7777#else /* 32 bits PAE mode */
    78 # define SHW_PDPTR_SHIFT        X86_PDPTR_SHIFT
    79 # define SHW_PDPTR_MASK         X86_PDPTR_MASK_32
     78# define SHW_PDPT_SHIFT        X86_PDPT_SHIFT
     79# define SHW_PDPT_MASK         X86_PDPT_MASK_32
    8080# define SHW_TOTAL_PD_ENTRIES   (X86_PG_PAE_ENTRIES*X86_PG_PAE_PDPE_ENTRIES)
    8181# define SHW_POOL_ROOT_IDX      PGMPOOL_IDX_PAE_PD
     
    124124#endif
    125125    {
    126         const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT)  & X86_PDPTR_MASK;
     126        const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT)  & X86_PDPT_MASK;
    127127        const unsigned iPd    = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    128         Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPdptr]->a[iPd];
     128        Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd];
    129129    }
    130130#if GC_ARCH_BITS == 64
     
    137137            return VERR_PAGE_TABLE_NOT_PRESENT;
    138138
    139         /* PDPTR */
    140         PX86PDPTR pPdPtr;
    141         int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPdPtr);
     139        /* PDPT */
     140        PX86PDPT pPDPT;
     141        int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPDPT);
    142142        if (VBOX_FAILURE(rc))
    143143            return rc;
    144         const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
    145         X86PDPE Pdpe = pPdPtr->a[iPdptr];
     144        const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
     145        X86PDPE Pdpe = pPDPT->a[iPDPT];
    146146        if (!Pdpe.n.u1Present)
    147147            return VERR_PAGE_TABLE_NOT_PRESENT;
     
    153153            return rc;
    154154        const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    155         Pdpe = pPdPtr->a[iPd];
     155        Pdpe = pPDPT->a[iPd];
    156156    }
    157157#endif /* GC_ARCH_BITS == 64 */
    158158
    159159#elif PGM_SHW_TYPE == PGM_TYPE_PAE
    160     const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
     160    const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
    161161    const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    162     X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPdptr]->a[iPd];
     162    X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd];
    163163
    164164#else /* PGM_TYPE_32BIT */
     
    245245#endif
    246246        {
    247             const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT)  & X86_PDPTR_MASK;
     247            const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT)  & X86_PDPT_MASK;
    248248            const unsigned iPd    = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    249             Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPdptr]->a[iPd];
     249            Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd];
    250250        }
    251251#if GC_ARCH_BITS == 64
     
    258258                return VERR_PAGE_TABLE_NOT_PRESENT;
    259259
    260             /* PDPTR */
    261             PX86PDPTR pPdPtr;
    262             int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPdPtr);
     260            /* PDPT */
     261            PX86PDPT pPDPT;
     262            int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPDPT);
    263263            if (VBOX_FAILURE(rc))
    264264                return rc;
    265             const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
    266             X86PDPE Pdpe = pPdPtr->a[iPdptr];
     265            const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
     266            X86PDPE Pdpe = pPDPT->a[iPDPT];
    267267            if (!Pdpe.n.u1Present)
    268268                return VERR_PAGE_TABLE_NOT_PRESENT;
     
    274274                return rc;
    275275            const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    276             Pdpe = pPdPtr->a[iPd];
     276            Pdpe = pPDPT->a[iPd];
    277277        }
    278278#endif /* GC_ARCH_BITS == 64 */
    279279
    280280#elif PGM_SHW_TYPE == PGM_TYPE_PAE
    281         const unsigned iPdptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;
     281        const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;
    282282        const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
    283         X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPdptr]->a[iPd];
     283        X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd];
    284284
    285285#else /* PGM_TYPE_32BIT */
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r7635 r7715  
    364364    GEN_CHECK_OFF(PGM, pGuestPDHC);
    365365    GEN_CHECK_OFF(PGM, pGuestPDGC);
    366     GEN_CHECK_OFF(PGM, pGstPaePDPTRHC);
    367     GEN_CHECK_OFF(PGM, pGstPaePDPTRGC);
     366    GEN_CHECK_OFF(PGM, pGstPaePDPTHC);
     367    GEN_CHECK_OFF(PGM, pGstPaePDPTGC);
    368368    GEN_CHECK_OFF(PGM, apGstPaePDsHC);
    369369    GEN_CHECK_OFF(PGM, apGstPaePDsGC);
     
    376376    GEN_CHECK_OFF(PGM, apGCPaePDs);
    377377    GEN_CHECK_OFF(PGM, aHCPhysPaePDs);
    378     GEN_CHECK_OFF(PGM, pHCPaePDPTR);
    379     GEN_CHECK_OFF(PGM, pGCPaePDPTR);
    380     GEN_CHECK_OFF(PGM, HCPhysPaePDPTR);
     378    GEN_CHECK_OFF(PGM, pHCPaePDPT);
     379    GEN_CHECK_OFF(PGM, pGCPaePDPT);
     380    GEN_CHECK_OFF(PGM, HCPhysPaePDPT);
    381381    GEN_CHECK_OFF(PGM, pHCPaePML4);
    382382    GEN_CHECK_OFF(PGM, pGCPaePML4);
     
    439439    GEN_CHECK_OFF(PGM, apInterPaePTs);
    440440    GEN_CHECK_OFF(PGM, apInterPaePDs);
    441     GEN_CHECK_OFF(PGM, pInterPaePDPTR);
    442     GEN_CHECK_OFF(PGM, pInterPaePDPTR64);
     441    GEN_CHECK_OFF(PGM, pInterPaePDPT);
     442    GEN_CHECK_OFF(PGM, pInterPaePDPT64);
    443443    GEN_CHECK_OFF(PGM, pInterPaePML4);
    444444    GEN_CHECK_OFF(PGM, HCPhysInterPD);
    445     GEN_CHECK_OFF(PGM, HCPhysInterPaePDPTR);
     445    GEN_CHECK_OFF(PGM, HCPhysInterPaePDPT);
    446446    GEN_CHECK_OFF(PGM, HCPhysInterPaePML4);
    447447    GEN_CHECK_OFF(PGM, pbDynPageMapBaseGC);
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r7635 r7715  
    118118    CHECK_SIZE(X86PDPAE, PAGE_SIZE);
    119119    CHECK_SIZE(X86PDPE, 8);
    120     CHECK_SIZE(X86PDPTR, PAGE_SIZE);
     120    CHECK_SIZE(X86PDPT, PAGE_SIZE);
    121121    CHECK_SIZE(X86PML4E, 8);
    122122    CHECK_SIZE(X86PML4, PAGE_SIZE);
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