Changeset 7715 in vbox
- Timestamp:
- Apr 3, 2008 9:03:01 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/x86.h
r7705 r7715 1486 1486 /** 1487 1487 * 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 */ 1489 typedef struct X86PDPT 1491 1490 { 1492 1491 /** PDE Array. */ 1493 1492 X86PDPE a[X86_PG_AMD64_PDPE_ENTRIES]; 1494 } X86PDPT R;1493 } X86PDPT; 1495 1494 /** Pointer to a page directory pointer table. */ 1496 typedef X86PDPT R *PX86PDPTR;1495 typedef X86PDPT *PX86PDPT; 1497 1496 /** Pointer to a const page directory pointer table. */ 1498 typedef const X86PDPT R *PCX86PDPTR;1499 1500 /** The page shift to get the PDPT Rindex. */1501 #define X86_PDPT R_SHIFT 301502 /** The PDPT Rindex mask (apply to a shifted page address). (32 bits PAE) */1503 #define X86_PDPT R_MASK_32 0x31504 /** The PDPT Rindex mask (apply to a shifted page address). (64 bits PAE)*/1505 #define X86_PDPT R_MASK 0x1ff1497 typedef 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 1506 1505 1507 1506 /** @} */ -
trunk/src/VBox/VMM/MMHyper.cpp
r7635 r7715 635 635 /** 636 636 * Reserves a hypervisor memory area. 637 * Most frequent usage is fence pages and dynamically mappings like the guest PD and PDPT R.637 * Most frequent usage is fence pages and dynamically mappings like the guest PD and PDPT. 638 638 * 639 639 * @return VBox status code. -
trunk/src/VBox/VMM/PGM.cpp
r7700 r7715 54 54 * [..] 55 55 * 56 * Because of guest context mappings requires PDPT Rand PML4 entries to allow56 * Because of guest context mappings requires PDPT and PML4 entries to allow 57 57 * writing on AMD64, the two upper levels will have fixed flags whatever the 58 58 * guest is thinking of using there. So, when shadowing the PD level we will … … 888 888 pVM->pgm.s.GCPhysGstCR3Monitored = NIL_RTGCPHYS; 889 889 pVM->pgm.s.fA20Enabled = true; 890 pVM->pgm.s.pGstPaePDPT RHC= NULL;891 pVM->pgm.s.pGstPaePDPT RGC= 0;890 pVM->pgm.s.pGstPaePDPTHC = NULL; 891 pVM->pgm.s.pGstPaePDPTGC = 0; 892 892 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGstPaePDsHC); i++) 893 893 { … … 1073 1073 pVM->pgm.s.apInterPaePDs[2] = (PX86PDPAE)MMR3PageAlloc(pVM); 1074 1074 pVM->pgm.s.apInterPaePDs[3] = (PX86PDPAE)MMR3PageAlloc(pVM); 1075 pVM->pgm.s.pInterPaePDPT R = (PX86PDPTR)MMR3PageAllocLow(pVM);1076 pVM->pgm.s.pInterPaePDPT R64 = (PX86PDPTR)MMR3PageAllocLow(pVM);1075 pVM->pgm.s.pInterPaePDPT = (PX86PDPT)MMR3PageAllocLow(pVM); 1076 pVM->pgm.s.pInterPaePDPT64 = (PX86PDPT)MMR3PageAllocLow(pVM); 1077 1077 pVM->pgm.s.pInterPaePML4 = (PX86PML4)MMR3PageAllocLow(pVM); 1078 1078 if ( !pVM->pgm.s.pInterPD … … 1085 1085 || !pVM->pgm.s.apInterPaePDs[2] 1086 1086 || !pVM->pgm.s.apInterPaePDs[3] 1087 || !pVM->pgm.s.pInterPaePDPT R1088 || !pVM->pgm.s.pInterPaePDPT R641087 || !pVM->pgm.s.pInterPaePDPT 1088 || !pVM->pgm.s.pInterPaePDPT64 1089 1089 || !pVM->pgm.s.pInterPaePML4) 1090 1090 { … … 1095 1095 pVM->pgm.s.HCPhysInterPD = MMPage2Phys(pVM, pVM->pgm.s.pInterPD); 1096 1096 AssertRelease(pVM->pgm.s.HCPhysInterPD != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPD & PAGE_OFFSET_MASK)); 1097 pVM->pgm.s.HCPhysInterPaePDPT R = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR);1098 AssertRelease(pVM->pgm.s.HCPhysInterPaePDPT R != 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)); 1099 1099 pVM->pgm.s.HCPhysInterPaePML4 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePML4); 1100 1100 AssertRelease(pVM->pgm.s.HCPhysInterPaePML4 != NIL_RTHCPHYS && !(pVM->pgm.s.HCPhysInterPaePML4 & PAGE_OFFSET_MASK)); 1101 1101 1102 1102 /* 1103 * Initialize the pages, setting up the PML4 and PDPT Rfor repetitive 4GB action.1103 * Initialize the pages, setting up the PML4 and PDPT for repetitive 4GB action. 1104 1104 */ 1105 1105 ASMMemZeroPage(pVM->pgm.s.pInterPD); … … 1110 1110 ASMMemZeroPage(pVM->pgm.s.apInterPaePTs[1]); 1111 1111 1112 ASMMemZeroPage(pVM->pgm.s.pInterPaePDPT R);1112 ASMMemZeroPage(pVM->pgm.s.pInterPaePDPT); 1113 1113 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apInterPaePDs); i++) 1114 1114 { 1115 1115 ASMMemZeroPage(pVM->pgm.s.apInterPaePDs[i]); 1116 pVM->pgm.s.pInterPaePDPT R->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT1116 pVM->pgm.s.pInterPaePDPT->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT 1117 1117 | MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[i]); 1118 1118 } 1119 1119 1120 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePDPT R64->a); i++)1120 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePDPT64->a); i++) 1121 1121 { 1122 1122 const unsigned iPD = i % ELEMENTS(pVM->pgm.s.apInterPaePDs); 1123 pVM->pgm.s.pInterPaePDPT R64->a[i].u = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A | PGM_PLXFLAGS_PERMANENT1123 pVM->pgm.s.pInterPaePDPT64->a[i].u = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A | PGM_PLXFLAGS_PERMANENT 1124 1124 | MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[iPD]); 1125 1125 } 1126 1126 1127 RTHCPHYS HCPhysInterPaePDPT R64 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR64);1127 RTHCPHYS HCPhysInterPaePDPT64 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT64); 1128 1128 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePML4->a); i++) 1129 1129 pVM->pgm.s.pInterPaePML4->a[i].u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_US | X86_PML4E_A | PGM_PLXFLAGS_PERMANENT 1130 | HCPhysInterPaePDPT R64;1130 | HCPhysInterPaePDPT64; 1131 1131 1132 1132 /* … … 1135 1135 * avoid resource failure during mode switches. So, we need to cover all levels of the 1136 1136 * of the first 4GB down to PD level. 1137 * As with the intermediate context, AMD64 uses the PAE PDPT Rand PDs.1137 * As with the intermediate context, AMD64 uses the PAE PDPT and PDs. 1138 1138 */ 1139 1139 pVM->pgm.s.pHC32BitPD = (PX86PD)MMR3PageAllocLow(pVM); … … 1145 1145 pVM->pgm.s.apHCPaePDs[3] = (PX86PDPAE)MMR3PageAlloc(pVM); 1146 1146 AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[2] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[3]); 1147 pVM->pgm.s.pHCPaePDPT R = (PX86PDPTR)MMR3PageAllocLow(pVM);1147 pVM->pgm.s.pHCPaePDPT = (PX86PDPT)MMR3PageAllocLow(pVM); 1148 1148 pVM->pgm.s.pHCPaePML4 = (PX86PML4)MMR3PageAllocLow(pVM); 1149 1149 if ( !pVM->pgm.s.pHC32BitPD … … 1152 1152 || !pVM->pgm.s.apHCPaePDs[2] 1153 1153 || !pVM->pgm.s.apHCPaePDs[3] 1154 || !pVM->pgm.s.pHCPaePDPT R1154 || !pVM->pgm.s.pHCPaePDPT 1155 1155 || !pVM->pgm.s.pHCPaePML4) 1156 1156 { … … 1166 1166 pVM->pgm.s.aHCPhysPaePDs[2] = MMPage2Phys(pVM, pVM->pgm.s.apHCPaePDs[2]); 1167 1167 pVM->pgm.s.aHCPhysPaePDs[3] = MMPage2Phys(pVM, pVM->pgm.s.apHCPaePDs[3]); 1168 pVM->pgm.s.HCPhysPaePDPT R = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePDPTR);1168 pVM->pgm.s.HCPhysPaePDPT = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePDPT); 1169 1169 pVM->pgm.s.HCPhysPaePML4 = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePML4); 1170 1170 1171 1171 /* 1172 * Initialize the pages, setting up the PML4 and PDPT Rfor action below 4GB.1172 * Initialize the pages, setting up the PML4 and PDPT for action below 4GB. 1173 1173 */ 1174 1174 ASMMemZero32(pVM->pgm.s.pHC32BitPD, PAGE_SIZE); 1175 1175 1176 ASMMemZero32(pVM->pgm.s.pHCPaePDPT R, PAGE_SIZE);1176 ASMMemZero32(pVM->pgm.s.pHCPaePDPT, PAGE_SIZE); 1177 1177 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apHCPaePDs); i++) 1178 1178 { 1179 1179 ASMMemZero32(pVM->pgm.s.apHCPaePDs[i], PAGE_SIZE); 1180 pVM->pgm.s.pHCPaePDPT R->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]; 1181 1181 /* The flags will be corrected when entering and leaving long mode. */ 1182 1182 } … … 1184 1184 ASMMemZero32(pVM->pgm.s.pHCPaePML4, PAGE_SIZE); 1185 1185 pVM->pgm.s.pHCPaePML4->a[0].u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_A 1186 | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.HCPhysPaePDPT R;1186 | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.HCPhysPaePDPT; 1187 1187 1188 1188 CPUMSetHyperCR3(pVM, (uint32_t)pVM->pgm.s.HCPhys32BitPD); … … 1227 1227 LogFlow(("pgmR3InitPaging: returns successfully\n")); 1228 1228 #if HC_ARCH_BITS == 64 1229 LogRel(("Debug: HCPhys32BitPD=%VHp aHCPhysPaePDs={%VHp,%VHp,%VHp,%VHp} HCPhysPaePDPT R=%VHp HCPhysPaePML4=%VHp\n",1229 LogRel(("Debug: HCPhys32BitPD=%VHp aHCPhysPaePDs={%VHp,%VHp,%VHp,%VHp} HCPhysPaePDPT=%VHp HCPhysPaePML4=%VHp\n", 1230 1230 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.HCPhysPaePDPT R, pVM->pgm.s.HCPhysPaePML4));1232 LogRel(("Debug: HCPhysInterPD=%VHp HCPhysInterPaePDPT R=%VHp HCPhysInterPaePML4=%VHp\n",1233 pVM->pgm.s.HCPhysInterPD, pVM->pgm.s.HCPhysInterPaePDPT R, pVM->pgm.s.HCPhysInterPaePML4));1234 LogRel(("Debug: apInterPTs={%VHp,%VHp} apInterPaePTs={%VHp,%VHp} apInterPaePDs={%VHp,%VHp,%VHp,%VHp} pInterPaePDPT R64=%VHp\n",1231 pVM->pgm.s.HCPhysPaePDPT, pVM->pgm.s.HCPhysPaePML4)); 1232 LogRel(("Debug: HCPhysInterPD=%VHp HCPhysInterPaePDPT=%VHp HCPhysInterPaePML4=%VHp\n", 1233 pVM->pgm.s.HCPhysInterPD, pVM->pgm.s.HCPhysInterPaePDPT, pVM->pgm.s.HCPhysInterPaePML4)); 1234 LogRel(("Debug: apInterPTs={%VHp,%VHp} apInterPaePTs={%VHp,%VHp} apInterPaePDs={%VHp,%VHp,%VHp,%VHp} pInterPaePDPT64=%VHp\n", 1235 1235 MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[1]), 1236 1236 MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[1]), 1237 1237 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.pInterPaePDPT R64)));1238 MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT64))); 1239 1239 #endif 1240 1240 … … 1321 1321 STAM_REG(pVM, &pPGM->StatGCTrap0eMap, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/GuestPF/Map", STAMUNIT_OCCURENCES, "Number of guest page faults due to map accesses."); 1322 1322 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)."); 1323 1325 1324 1326 STAM_REG(pVM, &pPGM->StatGCGuestCR3WriteHandled, STAMTYPE_COUNTER, "/PGM/GC/CR3WriteInt", STAMUNIT_OCCURENCES, "The number of times the Guest CR3 change was successfully handled."); … … 1524 1526 GCPtr += PAGE_SIZE; /* reserved page */ 1525 1527 1526 rc = PGMMap(pVM, GCPtr, pVM->pgm.s.HCPhysPaePDPT R, PAGE_SIZE, 0);1528 rc = PGMMap(pVM, GCPtr, pVM->pgm.s.HCPhysPaePDPT, PAGE_SIZE, 0); 1527 1529 AssertRCReturn(rc, rc); 1528 pVM->pgm.s.pGCPaePDPT R= GCPtr;1530 pVM->pgm.s.pGCPaePDPT = GCPtr; 1529 1531 GCPtr += PAGE_SIZE; 1530 1532 GCPtr += PAGE_SIZE; /* reserved page */ … … 1587 1589 for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGCPaePDs); i++) 1588 1590 pVM->pgm.s.apGCPaePDs[i] += offDelta; 1589 pVM->pgm.s.pGCPaePDPT R+= offDelta;1591 pVM->pgm.s.pGCPaePDPT += offDelta; 1590 1592 pVM->pgm.s.pGCPaePML4 += offDelta; 1591 1593 … … 3152 3154 * @param pHlp Pointer to the output functions. 3153 3155 */ 3154 static int pgmR3DumpHierarchyHCPaePDPT R(PVM pVM, RTHCPHYS HCPhys, uint64_t u64Address, uint32_t cr4, bool fLongMode, unsigned cMaxDepth, PCDBGFINFOHLP pHlp)3155 { 3156 PX86PDPT R pPDPTR = (PX86PDPTR)MMPagePhys2Page(pVM, HCPhys);3157 if (!pPDPT R)3156 static 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) 3158 3160 { 3159 3161 pHlp->pfnPrintf(pHlp, "%0*llx error! Page directory pointer table at HCPhys=%#VHp was not found in the page pool!\n", … … 3163 3165 3164 3166 int rc = VINF_SUCCESS; 3165 const unsigned c = fLongMode ? ELEMENTS(pPDPT R->a) : X86_PG_PAE_PDPE_ENTRIES;3167 const unsigned c = fLongMode ? ELEMENTS(pPDPT->a) : X86_PG_PAE_PDPE_ENTRIES; 3166 3168 for (unsigned i = 0; i < c; i++) 3167 3169 { 3168 X86PDPE Pdpe = pPDPT R->a[i];3170 X86PDPE Pdpe = pPDPT->a[i]; 3169 3171 if (Pdpe.n.u1Present) 3170 3172 { … … 3172 3174 pHlp->pfnPrintf(pHlp, /*P R S A D G WT CD AT NX 4M a p ? */ 3173 3175 "%016llx 1 | P %c %c %c %c %c %s %s %s %s .. %c%c%c %016llx\n", 3174 u64Address + ((uint64_t)i << X86_PDPT R_SHIFT),3176 u64Address + ((uint64_t)i << X86_PDPT_SHIFT), 3175 3177 Pdpe.n.u1Write ? 'W' : 'R', 3176 3178 Pdpe.n.u1User ? 'U' : 'S', … … 3189 3191 pHlp->pfnPrintf(pHlp, /*P R S A D G WT CD AT NX 4M a p ? */ 3190 3192 "%08x 0 | P %c %c %c %c %c %s %s %s %s .. %c%c%c %016llx\n", 3191 i << X86_PDPT R_SHIFT,3193 i << X86_PDPT_SHIFT, 3192 3194 Pdpe.n.u1Write ? '!' : '.', /* mbz */ 3193 3195 Pdpe.n.u1User ? '!' : '.', /* mbz */ … … 3205 3207 if (cMaxDepth >= 1) 3206 3208 { 3207 int rc2 = pgmR3DumpHierarchyHCPaePD(pVM, Pdpe.u & X86_PDPE_PG_MASK, u64Address + ((uint64_t)i << X86_PDPT R_SHIFT),3209 int rc2 = pgmR3DumpHierarchyHCPaePD(pVM, Pdpe.u & X86_PDPE_PG_MASK, u64Address + ((uint64_t)i << X86_PDPT_SHIFT), 3208 3210 cr4, fLongMode, cMaxDepth - 1, pHlp); 3209 3211 if (rc2 < rc && VBOX_SUCCESS(rc)) … … 3241 3243 if (Pml4e.n.u1Present) 3242 3244 { 3243 uint64_t u64Address = ((uint64_t)i << X86_PML4_SHIFT) | (((uint64_t)i >> (X86_PML4_SHIFT - X86_PDPT R_SHIFT - 1)) * 0xffff000000000000ULL);3245 uint64_t u64Address = ((uint64_t)i << X86_PML4_SHIFT) | (((uint64_t)i >> (X86_PML4_SHIFT - X86_PDPT_SHIFT - 1)) * 0xffff000000000000ULL); 3244 3246 pHlp->pfnPrintf(pHlp, /*P R S A D G WT CD AT NX 4M a p ? */ 3245 3247 "%016llx 0 | P %c %c %c %c %c %s %s %s %s .. %c%c%c %016llx\n", … … 3261 3263 if (cMaxDepth >= 1) 3262 3264 { 3263 int rc2 = pgmR3DumpHierarchyHCPaePDPT R(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); 3264 3266 if (rc2 < rc && VBOX_SUCCESS(rc)) 3265 3267 rc = rc2; … … 3597 3599 if (fLongMode) 3598 3600 return pgmR3DumpHierarchyHcPaePML4(pVM, cr3 & X86_CR3_PAGE_MASK, cr4, cMaxDepth, pHlp); 3599 return pgmR3DumpHierarchyHCPaePDPT R(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); 3600 3602 } 3601 3603 return pgmR3DumpHierarchyHC32BitPD(pVM, cr3 & X86_CR3_PAGE_MASK, cr4, cMaxDepth, pHlp); -
trunk/src/VBox/VMM/PGMGst.h
r7677 r7715 342 342 for (unsigned i = 0; i < 4; i++) 343 343 { 344 if ( pVM->pgm.s.pGstPaePDPT RHC->a[i].n.u1Present345 && (pVM->pgm.s.pGstPaePDPT RHC->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]) 346 346 { 347 347 Log(("pgmR3GstPAEWriteHandlerCR3: detected updated PDPE; [%d] = %#llx, Old GCPhys=%VGp\n", 348 i, pVM->pgm.s.pGstPaePDPT RHC->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));348 i, pVM->pgm.s.pGstPaePDPTHC->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i])); 349 349 /* 350 350 * The PD has changed. … … 406 406 unsigned i; 407 407 for (i = 0; i < 4; i++) 408 if (pVM->pgm.s.pGstPaePDPT RHC->a[i].u == (GCPhys & X86_PTE_PAE_PG_MASK))408 if (pVM->pgm.s.pGstPaePDPTHC->a[i].u == (GCPhys & X86_PTE_PAE_PG_MASK)) 409 409 { 410 PX86PDPAE pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT R_SHIFT);410 PX86PDPAE pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT_SHIFT); 411 411 const RTGCUINTPTR offPD = GCPhys & PAGE_OFFSET_MASK; 412 412 const unsigned iPD1 = offPD / sizeof(X86PDEPAE); … … 414 414 Assert(iPD1 - iPD2 <= 1); 415 415 if ( ( pPDSrc->a[iPD1].n.u1Present 416 && pgmGetMapping(pVM, (i << X86_PDPT R_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)) )416 && pgmGetMapping(pVM, (i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)) ) 417 417 || ( iPD1 != iPD2 418 418 && pPDSrc->a[iPD2].n.u1Present 419 && pgmGetMapping(pVM, (i << X86_PDPT R_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)) )419 && pgmGetMapping(pVM, (i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)) ) 420 420 ) 421 421 { -
trunk/src/VBox/VMM/PGMInternal.h
r7676 r7715 163 163 164 164 165 /** @name PDPT Rand PML4 flags.165 /** @name PDPT and PML4 flags. 166 166 * These are placed in the three bits available for system programs in 167 * the PDPT Rand PML4 entries.167 * the PDPT and PML4 entries. 168 168 * @{ */ 169 169 /** The entry is a permanent one and it's must always be present. … … 1281 1281 #define PGMPOOL_IDX_PAE_PD 2 1282 1282 /** Page Directory Pointer Table (PAE root, not currently used). */ 1283 #define PGMPOOL_IDX_PDPT R31283 #define PGMPOOL_IDX_PDPT 3 1284 1284 /** Page Map Level-4 (64-bit root). */ 1285 1285 #define PGMPOOL_IDX_PML4 4 … … 1361 1361 1362 1362 /** Shw: 64-bit page directory pointer table; Gst: 64-bit page directory pointer table. */ 1363 PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR,1363 PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, 1364 1364 1365 1365 /** Shw: Root 32-bit page directory. */ … … 1368 1368 PGMPOOLKIND_ROOT_PAE_PD, 1369 1369 /** Shw: Root PAE page directory pointer table (legacy, 4 entries). */ 1370 PGMPOOLKIND_ROOT_PDPT R,1370 PGMPOOLKIND_ROOT_PDPT, 1371 1371 /** Shw: Root page map level-4 table. */ 1372 1372 PGMPOOLKIND_ROOT_PML4, … … 1909 1909 * @{ */ 1910 1910 /** The guest's page directory pointer table, static GC mapping. */ 1911 GCPTRTYPE(PX86PDPT R) pGstPaePDPTRGC;1911 GCPTRTYPE(PX86PDPT) pGstPaePDPTGC; 1912 1912 /** The guest's page directory pointer table, HC pointer. */ 1913 R3R0PTRTYPE(PX86PDPT R) pGstPaePDPTRHC;1913 R3R0PTRTYPE(PX86PDPT) pGstPaePDPTHC; 1914 1914 /** The guest's page directories, HC pointers. 1915 1915 * These are individual pointers and doesn't have to be adjecent. … … 1952 1952 * These are *NOT* 4 contiguous pages. */ 1953 1953 RTHCPHYS aHCPhysPaePDs[4]; 1954 /** The PAE PDP TR- HC Ptr. */1955 R3R0PTRTYPE(PX86PDPT R) pHCPaePDPTR;1956 /** The Physical Address (HC) of the PAE PDPT R. */1957 RTHCPHYS HCPhysPaePDPT R;1958 /** The PAE PDPT R- GC Ptr. */1959 GCPTRTYPE(PX86PDPT R) 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; 1960 1960 /** @} */ 1961 1961 … … 2144 2144 R3PTRTYPE(PX86PDPAE) apInterPaePDs[4]; 2145 2145 /** Pointer to the intermedate page directory - PAE. */ 2146 R3PTRTYPE(PX86PDPT R) pInterPaePDPTR;2146 R3PTRTYPE(PX86PDPT) pInterPaePDPT; 2147 2147 /** Pointer to the intermedate page-map level 4 - AMD64. */ 2148 2148 R3PTRTYPE(PX86PML4) pInterPaePML4; 2149 2149 /** Pointer to the intermedate page directory - AMD64. */ 2150 R3PTRTYPE(PX86PDPT R) pInterPaePDPTR64;2150 R3PTRTYPE(PX86PDPT) pInterPaePDPT64; 2151 2151 /** The Physical Address (HC) of the intermediate Page Directory - Normal. */ 2152 2152 RTHCPHYS HCPhysInterPD; 2153 2153 /** The Physical Address (HC) of the intermediate Page Directory Pointer Table - PAE. */ 2154 RTHCPHYS HCPhysInterPaePDPT R;2154 RTHCPHYS HCPhysInterPaePDPT; 2155 2155 /** The Physical Address (HC) of the intermediate Page Map Level 4 table - AMD64. */ 2156 2156 RTHCPHYS HCPhysInterPaePML4; … … 2305 2305 STAMCOUNTER StatGCTrap0eSVReserved; 2306 2306 STAMCOUNTER StatGCTrap0eSNXE; 2307 2308 STAMCOUNTER StatTrap0eWPEmulGC; 2309 STAMCOUNTER StatTrap0eWPEmulR3; 2307 2310 2308 2311 STAMCOUNTER StatGCTrap0eUnhandled; … … 3189 3192 DECLINLINE(PX86PDPAE) pgmGstGetPaePD(PPGM pPGM, RTGCUINTPTR GCPtr) 3190 3193 { 3191 const unsigned iPdPt r = GCPtr >> X86_PDPTR_SHIFT;3192 if (CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].n.u1Present)3194 const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT; 3195 if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present) 3193 3196 { 3194 if ((CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])3195 return CTXSUFF(pPGM->apGstPaePDs)[iPdPt r];3197 if ((CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPt]) 3198 return CTXSUFF(pPGM->apGstPaePDs)[iPdPt]; 3196 3199 3197 3200 /* cache is out-of-sync. */ 3198 3201 PX86PDPAE pPD; 3199 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT R)->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); 3200 3203 if (VBOX_SUCCESS(rc)) 3201 3204 return pPD; 3202 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u));3205 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u)); 3203 3206 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emulated as all 0s. */ 3204 3207 } … … 3217 3220 DECLINLINE(PX86PDEPAE) pgmGstGetPaePDEPtr(PPGM pPGM, RTGCUINTPTR GCPtr) 3218 3221 { 3219 const unsigned iPdPt r = GCPtr >> X86_PDPTR_SHIFT;3220 if (CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].n.u1Present)3222 const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT; 3223 if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present) 3221 3224 { 3222 3225 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3223 if ((CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])3224 return &CTXSUFF(pPGM->apGstPaePDs)[iPdPt r]->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]; 3225 3228 3226 3229 /* The cache is out-of-sync. */ 3227 3230 PX86PDPAE pPD; 3228 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT R)->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); 3229 3232 if (VBOX_SUCCESS(rc)) 3230 3233 return &pPD->a[iPD]; 3231 AssertMsgFailed(("Impossible! rc=%Vrc PDPE=%RX64\n", rc, CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u));3234 AssertMsgFailed(("Impossible! rc=%Vrc PDPE=%RX64\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u)); 3232 3235 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page or something which we'll emulate as all 0s. */ 3233 3236 } … … 3246 3249 DECLINLINE(uint64_t) pgmGstGetPaePDE(PPGM pPGM, RTGCUINTPTR GCPtr) 3247 3250 { 3248 const unsigned iPdPt r = GCPtr >> X86_PDPTR_SHIFT;3249 if (CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].n.u1Present)3251 const unsigned iPdPt = GCPtr >> X86_PDPT_SHIFT; 3252 if (CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].n.u1Present) 3250 3253 { 3251 3254 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3252 if ((CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr])3253 return CTXSUFF(pPGM->apGstPaePDs)[iPdPt r]->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; 3254 3257 3255 3258 /* cache is out-of-sync. */ 3256 3259 PX86PDPAE pPD; 3257 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT R)->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); 3258 3261 if (VBOX_SUCCESS(rc)) 3259 3262 return pPD->a[iPD].u; 3260 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u));3263 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u)); 3261 3264 } 3262 3265 return 0ULL; … … 3273 3276 * @param piPD Receives the index into the returned page directory 3274 3277 */ 3275 DECLINLINE(PX86PDPAE) pgmGstGetPaePDPt r(PPGM pPGM, RTGCUINTPTR GCPtr, unsigned *piPD)3276 { 3277 const unsigned iPdPt r = GCPtr >> X86_PDPTR_SHIFT;3278 if (CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].n.u1Present)3278 DECLINLINE(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) 3279 3282 { 3280 3283 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 3281 if ((CTXSUFF(pPGM->pGstPaePDPT R)->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]) 3282 3285 { 3283 3286 *piPD = iPD; 3284 return CTXSUFF(pPGM->apGstPaePDs)[iPdPt r];3287 return CTXSUFF(pPGM->apGstPaePDs)[iPdPt]; 3285 3288 } 3286 3289 3287 3290 /* cache is out-of-sync. */ 3288 3291 PX86PDPAE pPD; 3289 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPT R)->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); 3290 3293 if (VBOX_SUCCESS(rc)) 3291 3294 { … … 3293 3296 return pPD; 3294 3297 } 3295 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT R)->a[iPdPtr].u));3298 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPT)->a[iPdPt].u)); 3296 3299 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emulated as all 0s. */ 3297 3300 } -
trunk/src/VBox/VMM/PGMMap.cpp
r7658 r7715 587 587 * PAE. 588 588 */ 589 const unsigned iPDPE= (uAddress >> X86_PDPT R_SHIFT) & X86_PDPTR_MASK;589 const unsigned iPDPE= (uAddress >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 590 590 iPDE = (uAddress >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 591 591 iPTE = (uAddress >> X86_PT_PAE_SHIFT) & X86_PT_PAE_MASK; … … 660 660 * PAE 661 661 */ 662 const unsigned iPDPE= (uAddress >> X86_PDPT R_SHIFT) & X86_PDPTR_MASK;662 const unsigned iPDPE= (uAddress >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 663 663 iPDE = (uAddress >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 664 664 iPTE = (uAddress >> X86_PT_PAE_SHIFT) & X86_PT_PAE_MASK; -
trunk/src/VBox/VMM/PGMPool.cpp
r5999 r7715 246 246 pPool->aPages[PGMPOOL_IDX_PAE_PD].idx = PGMPOOL_IDX_PAE_PD; 247 247 248 /* The Shadow PDPT R. */249 pPool->aPages[PGMPOOL_IDX_PDPT R].Core.Key = NIL_RTHCPHYS;250 pPool->aPages[PGMPOOL_IDX_PDPT R].GCPhys = NIL_RTGCPHYS;251 pPool->aPages[PGMPOOL_IDX_PDPT R].pvPageHC = pVM->pgm.s.pHCPaePDPTR;252 pPool->aPages[PGMPOOL_IDX_PDPT R].enmKind = PGMPOOLKIND_ROOT_PDPTR;253 pPool->aPages[PGMPOOL_IDX_PDPT R].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; 254 254 255 255 /* The Shadow Page Map Level-4. */ -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r7676 r7715 753 753 case PGMMODE_PAE: 754 754 case PGMMODE_PAE_NX: 755 return pVM->pgm.s.HCPhysPaePDPT R;755 return pVM->pgm.s.HCPhysPaePDPT; 756 756 757 757 case PGMMODE_AMD64: … … 784 784 PGMDECL(uint32_t) PGMGetHyperPaeCR3(PVM pVM) 785 785 { 786 return pVM->pgm.s.HCPhysPaePDPT R;786 return pVM->pgm.s.HCPhysPaePDPT; 787 787 } 788 788 … … 816 816 case SUPPAGINGMODE_PAE_NX: 817 817 case SUPPAGINGMODE_PAE_GLOBAL_NX: 818 return pVM->pgm.s.HCPhysInterPaePDPT R;818 return pVM->pgm.s.HCPhysInterPaePDPT; 819 819 820 820 case SUPPAGINGMODE_AMD64: … … 822 822 case SUPPAGINGMODE_AMD64_NX: 823 823 case SUPPAGINGMODE_AMD64_GLOBAL_NX: 824 return pVM->pgm.s.HCPhysInterPaePDPT R;824 return pVM->pgm.s.HCPhysInterPaePDPT; 825 825 826 826 default: … … 845 845 case PGMMODE_PAE: 846 846 case PGMMODE_PAE_NX: 847 return pVM->pgm.s.HCPhysInterPaePDPT R;847 return pVM->pgm.s.HCPhysInterPaePDPT; 848 848 849 849 case PGMMODE_AMD64: … … 876 876 PGMDECL(uint32_t) PGMGetInterPaeCR3(PVM pVM) 877 877 { 878 return pVM->pgm.s.HCPhysInterPaePDPT R;878 return pVM->pgm.s.HCPhysInterPaePDPT; 879 879 } 880 880 … … 894 894 * Performs and schedules necessary updates following a CR3 load or reload. 895 895 * 896 * This will normally involve mapping the guest PD or nPDPT R896 * This will normally involve mapping the guest PD or nPDPT 897 897 * 898 898 * @returns VBox status code. -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r7702 r7715 94 94 # else /* PAE */ 95 95 unsigned iPDSrc; 96 PGSTPD pPDSrc = pgmGstGetPaePDPt r(&pVM->pgm.s, (RTGCUINTPTR)pvFault, &iPDSrc);96 PGSTPD pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, (RTGCUINTPTR)pvFault, &iPDSrc); 97 97 # endif 98 98 # else … … 522 522 STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b); 523 523 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 524 543 # ifdef PGM_OUT_OF_SYNC_IN_GC 525 544 /* … … 801 820 # else /* PAE */ 802 821 unsigned iPDSrc; 803 PX86PDPAE pPDSrc = pgmGstGetPaePDPt r(&pVM->pgm.s, GCPtrPage, &iPDSrc);822 PX86PDPAE pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc); 804 823 GSTPDE PdeSrc = pPDSrc->a[iPDSrc]; 805 824 # endif … … 1601 1620 PGM_BTH_DECL(int, CheckPageFault)(PVM pVM, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCUINTPTR GCPtrPage) 1602 1621 { 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 1603 1626 STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a); 1604 1627 LogFlow(("CheckPageFault: GCPtrPage=%VGv uErr=%#x PdeSrc=%08x\n", GCPtrPage, uErr, pPdeSrc->u)); … … 1612 1635 || ((uErr & X86_TRAP_PF_ID) && pPdeSrc->n.u1NoExecute) 1613 1636 # 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) ) 1616 1639 { 1617 1640 # ifdef IN_GC … … 1662 1685 * Only write protection page faults are relevant here. 1663 1686 */ 1664 if ( uErr & X86_TRAP_PF_RW)1687 if (fWriteFault) 1665 1688 { 1666 1689 /* Mark guest page directory as dirty (BIG page only). */ … … 1702 1725 || ((uErr & X86_TRAP_PF_ID) && !PteSrc.n.u1NoExecute) 1703 1726 # 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) 1706 1729 ) 1707 1730 { … … 1732 1755 * Only write protection page faults are relevant here. 1733 1756 */ 1734 if ( uErr & X86_TRAP_PF_RW)1757 if (fWriteFault) 1735 1758 { 1736 1759 /* Write access, so mark guest entry as dirty. */ … … 2280 2303 # else /* PAE */ 2281 2304 unsigned iPDSrc; 2282 PGSTPD pPDSrc = pgmGstGetPaePDPt r(&pVM->pgm.s, GCPtrPage, &iPDSrc);2305 PGSTPD pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc); 2283 2306 # endif 2284 2307 const GSTPDE PdeSrc = pPDSrc->a[iPDSrc]; … … 2370 2393 # else /* PAE */ 2371 2394 unsigned iPDSrc; 2372 PGSTPD pPDSrc = pgmGstGetPaePDPt r(&pVM->pgm.s, GCPtrPage, &iPDSrc);2395 PGSTPD pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, GCPtrPage, &iPDSrc); 2373 2396 # endif 2374 2397 # else … … 2574 2597 } 2575 2598 # if PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64 2576 for (unsigned iPDPT RE = 0; iPDPTRE < GST_PDPE_ENTRIES; iPDPTRE++)2599 for (unsigned iPDPTE = 0; iPDPTE < GST_PDPE_ENTRIES; iPDPTE++) 2577 2600 { 2578 2601 unsigned iPDSrc; 2579 2602 # if PGM_SHW_TYPE == PGM_TYPE_PAE 2580 PX86PDPAE pPDPAE = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPT RE * X86_PG_PAE_ENTRIES];2603 PX86PDPAE pPDPAE = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTE * X86_PG_PAE_ENTRIES]; 2581 2604 # else 2582 2605 AssertFailed(); /* @todo */ 2583 PX86PDPE pPDPAE = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPT RE * X86_PG_AMD64_ENTRIES];2606 PX86PDPE pPDPAE = pVM->pgm.s.CTXMID(ap,PaePDs)[iPDPTE * X86_PG_AMD64_ENTRIES]; 2584 2607 # endif 2585 2608 PX86PDEPAE pPDEDst = &pPDPAE->a[0]; 2586 PGSTPD pPDSrc = pgmGstGetPaePDPt r(&pVM->pgm.s, iPDPTRE << X86_PDPTR_SHIFT, &iPDSrc);2609 PGSTPD pPDSrc = pgmGstGetPaePDPt(&pVM->pgm.s, iPDPTE << X86_PDPT_SHIFT, &iPDSrc); 2587 2610 2588 2611 if (pPDSrc == NULL) 2589 2612 { 2590 /* PDPT Rnot present */2591 pVM->pgm.s.CTXMID(p,PaePDPT R)->a[iPDPTRE].n.u1Present = 0;2613 /* PDPT not present */ 2614 pVM->pgm.s.CTXMID(p,PaePDPT)->a[iPDPTE].n.u1Present = 0; 2592 2615 continue; 2593 2616 } -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r7677 r7715 388 388 #elif PGM_GST_TYPE == PGM_TYPE_PAE 389 389 const unsigned off = GCPhysCR3 & X86_CR3_PAE_PAGE_MASK; 390 pVM->pgm.s.pGstPaePDPT RHC = (R3R0PTRTYPE(PX86PDPTR))((RTHCUINTPTR)HCPtrGuestCR3 | off);391 pVM->pgm.s.pGstPaePDPT RGC = (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); 392 392 393 393 /* … … 397 397 for (unsigned i = 0; i < 4; i++, GCPtr += PAGE_SIZE) 398 398 { 399 if (pVM->pgm.s.CTXSUFF(pGstPaePDPT R)->a[i].n.u1Present)399 if (pVM->pgm.s.CTXSUFF(pGstPaePDPT)->a[i].n.u1Present) 400 400 { 401 401 RTHCPTR HCPtr; 402 402 RTHCPHYS HCPhys; 403 RTGCPHYS GCPhys = pVM->pgm.s.CTXSUFF(pGstPaePDPT R)->a[i].u & X86_PDPE_PG_MASK;403 RTGCPHYS GCPhys = pVM->pgm.s.CTXSUFF(pGstPaePDPT)->a[i].u & X86_PDPE_PG_MASK; 404 404 int rc2 = pgmRamGCPhys2HCPtrAndHCPhysWithFlags(&pVM->pgm.s, GCPhys, &HCPtr, &HCPhys); 405 405 if (VBOX_SUCCESS(rc2)) … … 452 452 453 453 #elif PGM_GST_TYPE == PGM_TYPE_PAE 454 pVM->pgm.s.pGstPaePDPT RHC = 0;455 pVM->pgm.s.pGstPaePDPT RGC = 0;454 pVM->pgm.s.pGstPaePDPTHC = 0; 455 pVM->pgm.s.pGstPaePDPTGC = 0; 456 456 /** PAE todo: pVM->pgm.s.apGstPaePDsHC? -> unmap?? */ 457 457 AssertFailed(); … … 529 529 for (unsigned i = 0; i < 4; i++) 530 530 { 531 if (CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->a[i].n.u1Present)532 { 533 RTGCPHYS GCPhys = CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->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; 534 534 # ifndef PGMPOOL_WITH_MIXED_PT_CR3 535 535 if (pVM->pgm.s.aGCPhysGstPaePDsMonitored[i] != GCPhys) … … 970 970 for (unsigned i = 0; i < 4; i++) 971 971 { 972 if ( CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->a[i].n.u1Present973 && ( CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->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) 974 974 != pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]) 975 975 { … … 986 986 pVM->pgm.s.fSyncFlags |= PGM_SYNC_MONITOR_CR3; 987 987 Log(("pgmXXGstPaeWriteHandlerCR3: detected updated PDPE; [%d] = %#llx, Old GCPhys=%VGp\n", 988 i, CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i]));988 i, CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[i].u, pVM->pgm.s.aGCPhysGstPaePDsMonitored[i])); 989 989 } 990 990 } … … 1035 1035 RTGCUINTPTR i; 1036 1036 for (i = 0; i < 4; i++) 1037 if (CTXSUFF(pVM->pgm.s.pGstPaePDPT R)->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)) 1038 1038 { 1039 PX86PDPAE pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT R_SHIFT);1039 PX86PDPAE pPDSrc = pgmGstGetPaePD(&pVM->pgm.s, i << X86_PDPT_SHIFT); 1040 1040 const RTGCUINTPTR offPD = GCPhysFault & PAGE_OFFSET_MASK; 1041 1041 const unsigned iPD1 = offPD / sizeof(X86PDEPAE); … … 1048 1048 #ifdef DEBUG 1049 1049 Log(("pgmXXGstPaeWriteHandlerPD: emulated change to i=%d iPD1=%#05x (%VGv)\n", 1050 i, iPD1, (i << X86_PDPT R_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT)));1050 i, iPD1, (i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT))); 1051 1051 if (iPD1 != iPD2) 1052 1052 Log(("pgmXXGstPaeWriteHandlerPD: emulated change to i=%d iPD2=%#05x (%VGv)\n", 1053 i, iPD2, (i << X86_PDPT R_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT)));1053 i, iPD2, (i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT))); 1054 1054 #endif 1055 1055 … … 1057 1057 { 1058 1058 if ( ( pPDSrc->a[iPD1].n.u1Present 1059 && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT R_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT))) )1059 && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT_SHIFT) | (iPD1 << X86_PD_PAE_SHIFT))) ) 1060 1060 || ( iPD1 != iPD2 1061 1061 && pPDSrc->a[iPD2].n.u1Present 1062 && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT R_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT))) )1062 && pgmGetMapping(pVM, (RTGCPTR)((i << X86_PDPT_SHIFT) | (iPD2 << X86_PD_PAE_SHIFT))) ) 1063 1063 ) 1064 1064 { -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r7655 r7715 1020 1020 Assert(PGMGetGuestMode(pVM) < PGMMODE_AMD64); 1021 1021 1022 PX86PDPT R pPdptr;1023 rc = PGM_GCPHYS_2_PTR(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, &pPdpt r);1022 PX86PDPT pPdpt; 1023 rc = PGM_GCPHYS_2_PTR(pVM, cr3 & X86_CR3_PAE_PAGE_MASK, &pPdpt); 1024 1024 if (VBOX_SUCCESS(rc)) 1025 1025 { 1026 X86PDPE Pdpe = pPdpt r->a[((RTGCUINTPTR)GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK];1026 X86PDPE Pdpe = pPdpt->a[((RTGCUINTPTR)GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK]; 1027 1027 if (Pdpe.n.u1Present) 1028 1028 { -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r7677 r7715 109 109 case PGMPOOL_IDX_PAE_PD: 110 110 return pVM->pgm.s.apGCPaePDs[0]; 111 case PGMPOOL_IDX_PDPT R:112 return pVM->pgm.s.pGCPaePDPT R;111 case PGMPOOL_IDX_PDPT: 112 return pVM->pgm.s.pGCPaePDPT; 113 113 case PGMPOOL_IDX_PML4: 114 114 return pVM->pgm.s.pGCPaePML4; … … 896 896 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 897 897 case PGMPOOLKIND_PAE_PT_FOR_PAE_PT: 898 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:898 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 899 899 case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB: 900 900 case PGMPOOLKIND_32BIT_PT_FOR_PHYS: … … 910 910 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 911 911 case PGMPOOLKIND_PAE_PT_FOR_PAE_PT: 912 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:912 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 913 913 case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB: 914 914 switch (enmKind2) … … 931 931 case PGMPOOLKIND_ROOT_32BIT_PD: 932 932 case PGMPOOLKIND_ROOT_PAE_PD: 933 case PGMPOOLKIND_ROOT_PDPT R:933 case PGMPOOLKIND_ROOT_PDPT: 934 934 case PGMPOOLKIND_ROOT_PML4: 935 935 return false; … … 1114 1114 case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD: 1115 1115 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 1116 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:1116 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1117 1117 case PGMPOOLKIND_ROOT_32BIT_PD: 1118 1118 case PGMPOOLKIND_ROOT_PAE_PD: 1119 case PGMPOOLKIND_ROOT_PDPT R:1119 case PGMPOOLKIND_ROOT_PDPT: 1120 1120 case PGMPOOLKIND_ROOT_PML4: 1121 1121 { … … 1184 1184 case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD: 1185 1185 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 1186 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:1187 case PGMPOOLKIND_ROOT_PDPT R:1186 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1187 case PGMPOOLKIND_ROOT_PDPT: 1188 1188 case PGMPOOLKIND_ROOT_PML4: 1189 1189 default: … … 1265 1265 case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD: 1266 1266 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 1267 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:1268 case PGMPOOLKIND_ROOT_PDPT R:1267 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1268 case PGMPOOLKIND_ROOT_PDPT: 1269 1269 case PGMPOOLKIND_ROOT_PML4: 1270 1270 default: … … 1937 1937 case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD: 1938 1938 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 1939 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:1939 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1940 1940 case PGMPOOLKIND_ROOT_PAE_PD: 1941 case PGMPOOLKIND_ROOT_PDPT R:1941 case PGMPOOLKIND_ROOT_PDPT: 1942 1942 case PGMPOOLKIND_ROOT_PML4: 1943 1943 return 8; … … 1973 1973 case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB: 1974 1974 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 1975 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:1975 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1976 1976 case PGMPOOLKIND_ROOT_PAE_PD: 1977 case PGMPOOLKIND_ROOT_PDPT R:1977 case PGMPOOLKIND_ROOT_PDPT: 1978 1978 case PGMPOOLKIND_ROOT_PML4: 1979 1979 return 8; … … 2278 2278 Assert(pUser->iUserTable < 2048 && pUser->iUser == PGMPOOL_IDX_PAE_PD); 2279 2279 break; 2280 case PGMPOOLKIND_ROOT_PDPT R:2280 case PGMPOOLKIND_ROOT_PDPT: 2281 2281 Assert(!(u.pau64[pUser->iUserTable] & PGM_PLXFLAGS_PERMANENT)); 2282 2282 Assert(pUser->iUserTable < 4); … … 2286 2286 Assert(pUser->iUserTable < X86_PG_PAE_ENTRIES); 2287 2287 break; 2288 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:2288 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2289 2289 case PGMPOOLKIND_ROOT_PML4: 2290 2290 Assert(!(u.pau64[pUser->iUserTable] & PGM_PLXFLAGS_PERMANENT)); … … 2309 2309 /* 64-bit entries */ 2310 2310 case PGMPOOLKIND_ROOT_PAE_PD: 2311 case PGMPOOLKIND_ROOT_PDPT R:2311 case PGMPOOLKIND_ROOT_PDPT: 2312 2312 case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD: 2313 2313 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 2314 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:2314 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2315 2315 case PGMPOOLKIND_ROOT_PML4: 2316 2316 u.pau64[pUser->iUserTable] = 0; … … 2836 2836 * @param pPool The pool. 2837 2837 * @param pPage The page. 2838 * @param pShwP dPtrThe shadow page directory pointer table (mapping of the page).2839 */ 2840 DECLINLINE(void) pgmPoolTrackDerefPDPT R64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPTR pShwPdPtr)2841 { 2842 for (unsigned i = 0; i < ELEMENTS(pShwP dPtr->a); i++)2843 { 2844 if (pShwP dPtr->a[i].n.u1Present)2845 { 2846 PPGMPOOLPAGE pSubPage = (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, pShwP dPtr->a[i].u & X86_PDPE_PG_MASK);2838 * @param pShwPDPT The shadow page directory pointer table (mapping of the page). 2839 */ 2840 DECLINLINE(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); 2847 2847 if (pSubPage) 2848 2848 pgmPoolTrackFreeUser(pPool, pSubPage, pPage->idx, i); 2849 2849 else 2850 AssertFatalMsgFailed(("%RX64\n", pShwP dPtr->a[i].u & X86_PDPE_PG_MASK));2850 AssertFatalMsgFailed(("%RX64\n", pShwPDPT->a[i].u & X86_PDPE_PG_MASK)); 2851 2851 /** @todo 64-bit guests: have to ensure that we're not exhausting the dynamic mappings! */ 2852 2852 } … … 2936 2936 break; 2937 2937 2938 case PGMPOOLKIND_64BIT_PDPT R_FOR_64BIT_PDPTR:2939 pgmPoolTrackDerefPDPT R64Bit(pPool, pPage, (PX86PDPTR)pvShw);2938 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2939 pgmPoolTrackDerefPDPT64Bit(pPool, pPage, (PX86PDPT)pvShw); 2940 2940 break; 2941 2941 … … 3000 3000 break; 3001 3001 3002 case PGMPOOLKIND_ROOT_PDPT R:3002 case PGMPOOLKIND_ROOT_PDPT: 3003 3003 /* Not root of shadowed pages currently, ignore it. */ 3004 3004 break; -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r7677 r7715 34 34 #undef SHW_PT_MASK 35 35 #undef SHW_TOTAL_PD_ENTRIES 36 #undef SHW_PDPT R_SHIFT37 #undef SHW_PDPT R_MASK36 #undef SHW_PDPT_SHIFT 37 #undef SHW_PDPT_MASK 38 38 #undef SHW_POOL_ROOT_IDX 39 39 … … 71 71 # define SHW_PT_MASK X86_PT_PAE_MASK 72 72 #if PGM_SHW_TYPE == PGM_TYPE_AMD64 73 # define SHW_PDPT R_SHIFT X86_PDPTR_SHIFT74 # define SHW_PDPT R_MASK X86_PDPTR_MASK73 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 74 # define SHW_PDPT_MASK X86_PDPT_MASK 75 75 # define SHW_TOTAL_PD_ENTRIES (X86_PG_AMD64_ENTRIES*X86_PG_AMD64_PDPE_ENTRIES) 76 76 # define SHW_POOL_ROOT_IDX PGMPOOL_IDX_PML4 77 77 #else /* 32 bits PAE mode */ 78 # define SHW_PDPT R_SHIFT X86_PDPTR_SHIFT79 # define SHW_PDPT R_MASK X86_PDPTR_MASK_3278 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 79 # define SHW_PDPT_MASK X86_PDPT_MASK_32 80 80 # define SHW_TOTAL_PD_ENTRIES (X86_PG_PAE_ENTRIES*X86_PG_PAE_PDPE_ENTRIES) 81 81 # define SHW_POOL_ROOT_IDX PGMPOOL_IDX_PAE_PD … … 124 124 #endif 125 125 { 126 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;126 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 127 127 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 128 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iP dptr]->a[iPd];128 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; 129 129 } 130 130 #if GC_ARCH_BITS == 64 … … 137 137 return VERR_PAGE_TABLE_NOT_PRESENT; 138 138 139 /* PDPT R*/140 PX86PDPT R pPdPtr;141 int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pP dPtr);139 /* PDPT */ 140 PX86PDPT pPDPT; 141 int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPDPT); 142 142 if (VBOX_FAILURE(rc)) 143 143 return rc; 144 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;145 X86PDPE Pdpe = pP dPtr->a[iPdptr];144 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 145 X86PDPE Pdpe = pPDPT->a[iPDPT]; 146 146 if (!Pdpe.n.u1Present) 147 147 return VERR_PAGE_TABLE_NOT_PRESENT; … … 153 153 return rc; 154 154 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 155 Pdpe = pP dPtr->a[iPd];155 Pdpe = pPDPT->a[iPd]; 156 156 } 157 157 #endif /* GC_ARCH_BITS == 64 */ 158 158 159 159 #elif PGM_SHW_TYPE == PGM_TYPE_PAE 160 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;160 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 161 161 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 162 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iP dptr]->a[iPd];162 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; 163 163 164 164 #else /* PGM_TYPE_32BIT */ … … 245 245 #endif 246 246 { 247 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;247 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 248 248 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 249 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iP dptr]->a[iPd];249 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; 250 250 } 251 251 #if GC_ARCH_BITS == 64 … … 258 258 return VERR_PAGE_TABLE_NOT_PRESENT; 259 259 260 /* PDPT R*/261 PX86PDPT R pPdPtr;262 int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pP dPtr);260 /* PDPT */ 261 PX86PDPT pPDPT; 262 int rc = PGM_HCPHYS_2_PTR(pVM, Pml4e.u & X86_PML4E_PG_MASK, &pPDPT); 263 263 if (VBOX_FAILURE(rc)) 264 264 return rc; 265 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;266 X86PDPE Pdpe = pP dPtr->a[iPdptr];265 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 266 X86PDPE Pdpe = pPDPT->a[iPDPT]; 267 267 if (!Pdpe.n.u1Present) 268 268 return VERR_PAGE_TABLE_NOT_PRESENT; … … 274 274 return rc; 275 275 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 276 Pdpe = pP dPtr->a[iPd];276 Pdpe = pPDPT->a[iPd]; 277 277 } 278 278 #endif /* GC_ARCH_BITS == 64 */ 279 279 280 280 #elif PGM_SHW_TYPE == PGM_TYPE_PAE 281 const unsigned iP dptr = (GCPtr >> X86_PDPTR_SHIFT) & X86_PDPTR_MASK;281 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK; 282 282 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 283 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iP dptr]->a[iPd];283 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; 284 284 285 285 #else /* PGM_TYPE_32BIT */ -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r7635 r7715 364 364 GEN_CHECK_OFF(PGM, pGuestPDHC); 365 365 GEN_CHECK_OFF(PGM, pGuestPDGC); 366 GEN_CHECK_OFF(PGM, pGstPaePDPT RHC);367 GEN_CHECK_OFF(PGM, pGstPaePDPT RGC);366 GEN_CHECK_OFF(PGM, pGstPaePDPTHC); 367 GEN_CHECK_OFF(PGM, pGstPaePDPTGC); 368 368 GEN_CHECK_OFF(PGM, apGstPaePDsHC); 369 369 GEN_CHECK_OFF(PGM, apGstPaePDsGC); … … 376 376 GEN_CHECK_OFF(PGM, apGCPaePDs); 377 377 GEN_CHECK_OFF(PGM, aHCPhysPaePDs); 378 GEN_CHECK_OFF(PGM, pHCPaePDPT R);379 GEN_CHECK_OFF(PGM, pGCPaePDPT R);380 GEN_CHECK_OFF(PGM, HCPhysPaePDPT R);378 GEN_CHECK_OFF(PGM, pHCPaePDPT); 379 GEN_CHECK_OFF(PGM, pGCPaePDPT); 380 GEN_CHECK_OFF(PGM, HCPhysPaePDPT); 381 381 GEN_CHECK_OFF(PGM, pHCPaePML4); 382 382 GEN_CHECK_OFF(PGM, pGCPaePML4); … … 439 439 GEN_CHECK_OFF(PGM, apInterPaePTs); 440 440 GEN_CHECK_OFF(PGM, apInterPaePDs); 441 GEN_CHECK_OFF(PGM, pInterPaePDPT R);442 GEN_CHECK_OFF(PGM, pInterPaePDPT R64);441 GEN_CHECK_OFF(PGM, pInterPaePDPT); 442 GEN_CHECK_OFF(PGM, pInterPaePDPT64); 443 443 GEN_CHECK_OFF(PGM, pInterPaePML4); 444 444 GEN_CHECK_OFF(PGM, HCPhysInterPD); 445 GEN_CHECK_OFF(PGM, HCPhysInterPaePDPT R);445 GEN_CHECK_OFF(PGM, HCPhysInterPaePDPT); 446 446 GEN_CHECK_OFF(PGM, HCPhysInterPaePML4); 447 447 GEN_CHECK_OFF(PGM, pbDynPageMapBaseGC); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r7635 r7715 118 118 CHECK_SIZE(X86PDPAE, PAGE_SIZE); 119 119 CHECK_SIZE(X86PDPE, 8); 120 CHECK_SIZE(X86PDPT R, PAGE_SIZE);120 CHECK_SIZE(X86PDPT, PAGE_SIZE); 121 121 CHECK_SIZE(X86PML4E, 8); 122 122 CHECK_SIZE(X86PML4, PAGE_SIZE);
Note:
See TracChangeset
for help on using the changeset viewer.