Changeset 7728 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Apr 3, 2008 3:25:34 PM (17 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r7719 r7728 1629 1629 LogFlow(("CheckPageFault: GCPtrPage=%VGv uErr=%#x PdeSrc=%08x\n", GCPtrPage, uErr, pPdeSrc->u)); 1630 1630 1631 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1632 AssertFailed(); 1633 # elif PGM_GST_TYPE == PGM_TYPE_PAE 1634 PX86PDPE pPdpeSrc = &pVM->pgm.s.CTXSUFF(pGstPaePDPT)->a[(GCPtrPage >> GST_PDPT_SHIFT) & GST_PDPT_MASK]; 1635 1636 /* 1637 * Real page fault? 1638 */ 1639 if ( (uErr & X86_TRAP_PF_RSVD) 1640 || !pPdpeSrc->n.u1Present 1641 || ((uErr & X86_TRAP_PF_ID) && pPdpeSrc->n.u1NoExecute) 1642 || (fWriteFault && !pPdpeSrc->n.u1Write && (fUserLevelFault || fWriteProtect)) 1643 || (fUserLevelFault && !pPdpeSrc->n.u1User) ) 1644 { 1645 # ifdef IN_GC 1646 STAM_COUNTER_INC(&pVM->pgm.s.StatGCDirtyTrackRealPF); 1647 # endif 1648 STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a); 1649 LogFlow(("CheckPageFault: real page fault at %VGv (0)\n", GCPtrPage)); 1650 1651 if ( pPdpeSrc->n.u1Present 1652 && pPdeSrc->n.u1Present) 1653 { 1654 /* Check the present bit as the shadow tables can cause different error codes by being out of sync. 1655 * See the 2nd case below as well. 1656 */ 1657 if (pPdeSrc->b.u1Size && (CPUMGetGuestCR4(pVM) & X86_CR4_PSE)) 1658 { 1659 TRPMSetErrorCode(pVM, uErr | X86_TRAP_PF_P); /* page-level protection violation */ 1660 } 1661 else 1662 { 1663 /* 1664 * Map the guest page table. 1665 */ 1666 PGSTPT pPTSrc; 1667 int rc = PGM_GCPHYS_2_PTR(pVM, pPdeSrc->u & GST_PDE_PG_MASK, &pPTSrc); 1668 if (VBOX_SUCCESS(rc)) 1669 { 1670 PGSTPTE pPteSrc = &pPTSrc->a[(GCPtrPage >> PAGE_SHIFT) & GST_PT_MASK]; 1671 const GSTPTE PteSrc = *pPteSrc; 1672 if (pPteSrc->n.u1Present) 1673 TRPMSetErrorCode(pVM, uErr | X86_TRAP_PF_P); /* page-level protection violation */ 1674 } 1675 AssertRC(rc); 1676 } 1677 } 1678 return VINF_EM_RAW_GUEST_TRAP; 1679 } 1680 # endif 1681 1631 1682 /* 1632 1683 * Real page fault? -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r7715 r7728 40 40 #undef GST_CR3_PAGE_MASK 41 41 #undef GST_PDPE_ENTRIES 42 #undef GST_PDPT_SHIFT 43 #undef GST_PDPT_MASK 42 44 43 45 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ … … 82 84 # define GST_TOTAL_PD_ENTRIES (X86_PG_PAE_ENTRIES * X86_PG_PAE_PDPE_ENTRIES) 83 85 # define GST_PDPE_ENTRIES X86_PG_PAE_PDPE_ENTRIES 86 # define GST_PDPT_SHIFT X86_PDPT_SHIFT 87 # define GST_PDPT_MASK X86_PDPT_MASK_PAE 84 88 # else 85 89 # define GST_TOTAL_PD_ENTRIES (X86_PG_AMD64_ENTRIES * X86_PG_AMD64_PDPE_ENTRIES) 86 90 # define GST_PDPE_ENTRIES X86_PG_AMD64_PDPE_ENTRIES 91 # define GST_PDPT_SHIFT X86_PDPT_SHIFT 92 # define GST_PDPT_MASK X86_PDPT_MASK_AMD64 87 93 # endif 88 94 # define GST_PTE_PG_MASK X86_PTE_PAE_PG_MASK -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r7715 r7728 1024 1024 if (VBOX_SUCCESS(rc)) 1025 1025 { 1026 X86PDPE Pdpe = pPdpt->a[((RTGCUINTPTR)GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK ];1026 X86PDPE Pdpe = pPdpt->a[((RTGCUINTPTR)GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE]; 1027 1027 if (Pdpe.n.u1Present) 1028 1028 { -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r7715 r7728 72 72 #if PGM_SHW_TYPE == PGM_TYPE_AMD64 73 73 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 74 # define SHW_PDPT_MASK X86_PDPT_MASK 74 # define SHW_PDPT_MASK X86_PDPT_MASK_AMD64 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 78 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 79 # define SHW_PDPT_MASK X86_PDPT_MASK_ 3279 # define SHW_PDPT_MASK X86_PDPT_MASK_PAE 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 iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;126 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 127 127 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 128 128 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; … … 142 142 if (VBOX_FAILURE(rc)) 143 143 return rc; 144 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;144 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 145 145 X86PDPE Pdpe = pPDPT->a[iPDPT]; 146 146 if (!Pdpe.n.u1Present) … … 158 158 159 159 #elif PGM_SHW_TYPE == PGM_TYPE_PAE 160 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;160 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 161 161 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 162 162 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; … … 245 245 #endif 246 246 { 247 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;247 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 248 248 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 249 249 Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd]; … … 263 263 if (VBOX_FAILURE(rc)) 264 264 return rc; 265 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;265 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 266 266 X86PDPE Pdpe = pPDPT->a[iPDPT]; 267 267 if (!Pdpe.n.u1Present) … … 279 279 280 280 #elif PGM_SHW_TYPE == PGM_TYPE_PAE 281 const unsigned iPDPT = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK;281 const unsigned iPDPT = (GCPtr >> SHW_PDPT_SHIFT) & SHW_PDPT_MASK; 282 282 const unsigned iPd = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 283 283 X86PDEPAE Pde = CTXMID(pVM->pgm.s.ap,PaePDs)[iPDPT]->a[iPd];
Note:
See TracChangeset
for help on using the changeset viewer.