Changeset 11525 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 21, 2008 9:07:51 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/CPUM.cpp
r11495 r11525 264 264 | X86_CPUID_FEATURE_EDX_CMOV 265 265 | X86_CPUID_FEATURE_EDX_PAT 266 //| X86_CPUID_FEATURE_EDX_PSE36 - not virtualized.266 | X86_CPUID_FEATURE_EDX_PSE36 267 267 //| X86_CPUID_FEATURE_EDX_PSN - no serial number. 268 268 | X86_CPUID_FEATURE_EDX_CLFSH … … 311 311 | X86_CPUID_AMD_FEATURE_EDX_CMOV 312 312 | X86_CPUID_AMD_FEATURE_EDX_PAT 313 //| X86_CPUID_AMD_FEATURE_EDX_PSE36 - not virtualized.313 | X86_CPUID_AMD_FEATURE_EDX_PSE36 314 314 //| X86_CPUID_AMD_FEATURE_EDX_NX - not virtualized, requires PAE. 315 315 //| X86_CPUID_AMD_FEATURE_EDX_AXMMX -
trunk/src/VBox/VMM/PGM.cpp
r11311 r11525 1821 1821 LogFlow(("PGMR3Relocate\n")); 1822 1822 1823 /* Note that AMD uses all the 8 reserved bits for the address (so 40 bits in total); Intel only goes up to 36 bits, so 1824 * we stick to 36 as well. 1825 * 1826 * @todo How to test for the 40 bits support? Long mode seems to be the test criterium. 1827 */ 1828 uint32_t u32Dummy, u32Features; 1829 CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features); 1830 1831 if (u32Features & X86_CPUID_FEATURE_EDX_PSE36) 1832 pVM->pgm.s.GCPhys4MBPSEMask = RT_BIT_64(36) - 1; 1833 else 1834 pVM->pgm.s.GCPhys4MBPSEMask = RT_BIT_64(32) - 1; 1835 1836 LogRel(("PGMR3Relocate: 4 MB PSE mask %VGp\n", pVM->pgm.s.GCPhys4MBPSEMask)); 1837 1838 1823 1839 /* 1824 1840 * Paging stuff. … … 2549 2565 "%04X - %VGp P=%d U=%d RW=%d G=%d - BIG\n", 2550 2566 iPD, 2551 PdeSrc.u & X86_PDE_PG_MASK,2567 pgmGstGet4MBPhysPage(&pVM->pgm.s, PdeSrc), 2552 2568 PdeSrc.b.u1Present, PdeSrc.b.u1User, PdeSrc.b.u1Write, PdeSrc.b.u1Global && fPGE); 2553 2569 } … … 2557 2573 "%04X - %VGp P=%d U=%d RW=%d [G=%d]\n", 2558 2574 iPD, 2559 PdeSrc.u & X86_PDE 4M_PG_MASK,2575 PdeSrc.u & X86_PDE_PG_MASK, 2560 2576 PdeSrc.n.u1Present, PdeSrc.n.u1User, PdeSrc.n.u1Write, PdeSrc.b.u1Global && fPGE); 2561 2577 } … … 3927 3943 Pde.u & RT_BIT(10) ? '1' : '0', 3928 3944 Pde.u & RT_BIT(11) ? '1' : '0', 3929 Pde.u & X86_PDE4M_PG_MASK));3945 pgmGstGet4MBPhysPage(&pVM->pgm.s, Pde))); 3930 3946 /** @todo PhysSearch */ 3931 3947 else -
trunk/src/VBox/VMM/PGMGst.h
r10035 r11525 43 43 #undef GST_CR3_PAGE_MASK 44 44 #undef GST_PDPE_ENTRIES 45 #undef GST_GET_PDE_BIG_PG_GCPHYS 45 46 46 47 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ … … 59 60 # define GST_PDE_PG_MASK X86_PDE_PG_MASK 60 61 # define GST_PDE_BIG_PG_MASK X86_PDE4M_PG_MASK 62 # define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) pgmGstGet4MBPhysPage(&pVM->pgm.s, PdeGst) 61 63 # define GST_PD_SHIFT X86_PD_SHIFT 62 64 # define GST_PD_MASK X86_PD_MASK … … 80 82 # define GST_PDE_PG_MASK X86_PDE_PAE_PG_MASK 81 83 # define GST_PDE_BIG_PG_MASK X86_PDE2M_PAE_PG_MASK 84 # define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) (PdeGst.u & GST_PDE_BIG_PG_MASK) 82 85 # define GST_PD_SHIFT X86_PD_PAE_SHIFT 83 86 # define GST_PD_MASK X86_PD_PAE_MASK -
trunk/src/VBox/VMM/PGMInternal.h
r11309 r11525 2224 2224 RTHCPHYS aHCPhysDynPageMapCache[MM_HYPER_DYNAMIC_SIZE >> (PAGE_SHIFT + 1)]; 2225 2225 2226 /** 4 MB page mask; 32 or 36 bits depending on PSE-36 */ 2227 RTGCPHYS GCPhys4MBPSEMask; 2228 2226 2229 /** A20 gate mask. 2227 2230 * Our current approach to A20 emulation is to let REM do it and don't bother … … 3242 3245 } 3243 3246 3247 /** 3248 * Calculated the guest physical address of the large (4 MB) page in 32 bits paging mode. 3249 * Takes PSE-36 into account. 3250 * 3251 * @returns guest physical address 3252 * @param pPGM Pointer to the PGM instance data. 3253 * @param Pde Guest Pde 3254 */ 3255 DECLINLINE(RTGCPHYS) pgmGstGet4MBPhysPage(PPGM pPGM, X86PDE Pde) 3256 { 3257 RTGCPHYS GCPhys = Pde.u & X86_PDE4M_PG_MASK; 3258 GCPhys |= (RTGCPHYS)Pde.b.u8PageNoHigh << 32; 3259 3260 return GCPhys & pPGM->GCPhys4MBPSEMask; 3261 } 3244 3262 3245 3263 /** -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r11449 r11525 326 326 if ( PdeSrc.b.u1Size 327 327 && fBigPagesSupported) 328 GCPhys = (PdeSrc.u & GST_PDE_BIG_PG_MASK)328 GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc) 329 329 | ((RTGCPHYS)pvFault & (GST_BIG_PAGE_OFFSET_MASK ^ PAGE_OFFSET_MASK)); 330 330 else … … 1211 1211 /* Before freeing the page, check if anything really changed. */ 1212 1212 PPGMPOOLPAGE pShwPage = pgmPoolGetPageByHCPhys(pVM, PdeDst.u & SHW_PDE_PG_MASK); 1213 RTGCPHYS GCPhys = PdeSrc.u & GST_PDE_BIG_PG_MASK;1213 RTGCPHYS GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc); 1214 1214 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 1215 1215 /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs.*/ … … 1591 1591 else 1592 1592 { 1593 GCPhys = PdeSrc.u & GST_PDE_BIG_PG_MASK;1593 GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc); 1594 1594 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 1595 1595 /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs.*/ … … 1706 1706 */ 1707 1707 /* Calculate the GC physical address of this 4KB shadow page. */ 1708 RTGCPHYS GCPhys = (PdeSrc.u & GST_PDE_BIG_PG_MASK) | ((RTGCUINTPTR)GCPtrPage & GST_BIG_PAGE_OFFSET_MASK);1708 RTGCPHYS GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc) | ((RTGCUINTPTR)GCPtrPage & GST_BIG_PAGE_OFFSET_MASK); 1709 1709 /* Find ram range. */ 1710 1710 PPGMPAGE pPage; … … 2355 2355 else 2356 2356 { 2357 GCPhys = PdeSrc.u & GST_PDE_BIG_PG_MASK;2357 GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc); 2358 2358 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 2359 2359 /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs.*/ … … 3335 3335 else 3336 3336 { 3337 GCPhys = PdeSrc.u & GST_PDE_BIG_PG_MASK;3337 GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc); 3338 3338 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 3339 3339 /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs.*/ … … 3853 3853 } 3854 3854 # endif 3855 GCPhysGst = PdeSrc.u & GST_PDE_BIG_PG_MASK;3855 GCPhysGst = GST_GET_PDE_BIG_PG_GCPHYS(PdeSrc); 3856 3856 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 3857 3857 GCPhysGst |= GCPtr & RT_BIT(X86_PAGE_2M_SHIFT); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r10674 r11525 47 47 #undef GST_PDPT_MASK 48 48 #undef GST_PDPE_PG_MASK 49 #undef GST_GET_PDE_BIG_PG_GCPHYS 49 50 50 51 #if PGM_GST_TYPE == PGM_TYPE_REAL \ … … 72 73 # define GST_PDE_PG_MASK X86_PDE_PG_MASK 73 74 # define GST_PDE_BIG_PG_MASK X86_PDE4M_PG_MASK 75 # define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) pgmGstGet4MBPhysPage(&pVM->pgm.s, PdeGst) 74 76 # define GST_PD_SHIFT X86_PD_SHIFT 75 77 # define GST_PD_MASK X86_PD_MASK … … 93 95 # define GST_PDE_PG_MASK X86_PDE_PAE_PG_MASK_FULL 94 96 # define GST_PDE_BIG_PG_MASK X86_PDE2M_PAE_PG_MASK 97 # define GST_GET_PDE_BIG_PG_GCPHYS(PdeGst) (PdeGst.u & GST_PDE_BIG_PG_MASK) 95 98 # define GST_PD_SHIFT X86_PD_PAE_SHIFT 96 99 # define GST_PD_MASK X86_PD_PAE_MASK -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r9836 r11525 1002 1002 if ((fFlags & X86_CR4_PSE) && Pde.b.u1Size) 1003 1003 { /* (big page) */ 1004 rc = PGMPhysGCPhys2HCPtr(pVM, (Pde.u & X86_PDE4M_PG_MASK) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), 1 /* we always stay within one page */, pHCPtr);1004 rc = PGMPhysGCPhys2HCPtr(pVM, pgmGstGet4MBPhysPage(&pVM->pgm.s, Pde) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), 1 /* we always stay within one page */, pHCPtr); 1005 1005 } 1006 1006 else
Note:
See TracChangeset
for help on using the changeset viewer.