Changeset 31069 in vbox
- Timestamp:
- Jul 23, 2010 3:49:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64004
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMGstDefs.h
r31066 r31069 82 82 # define PGSTPDE PSHWPDE 83 83 # define GST_PTE_PG_MASK SHW_PTE_PG_MASK 84 # define GST_IS_NX_ACTIVE(pVCpu) ( CPUMIsGuestNXEnabled(pVCpu)) /** @todo shadow this variable */84 # define GST_IS_NX_ACTIVE(pVCpu) (pgmGstIsNoExecuteActive(pVCpu)) 85 85 # if PGM_GST_TYPE == PGM_TYPE_PROT /* (comment at top of PGMAllBth.h) */ 86 86 # define BTH_IS_NP_ACTIVE(pVM) (pVM->pgm.s.fNestedPaging) … … 127 127 //# define GST_IS_BIG_PDPE_VALID(pVCpu, Pdpe) (false) 128 128 //# define GST_IS_PML4E_VALID(pVCpu, Pml4e) (false) 129 # define GST_IS_PSE_ACTIVE(pVCpu) (CPUMIsGuestPageSizeExtEnabled(pVCpu)) /** @todo ( (pVCpu)->pgm.s.fGst32BitPageSizeExtension ) */129 # define GST_IS_PSE_ACTIVE(pVCpu) pgmGstIsPageSizeExtActive(pVCpu) 130 130 # define GST_IS_NX_ACTIVE(pVCpu) (false) 131 131 # define BTH_IS_NP_ACTIVE(pVM) (false) … … 186 186 # define GST_PT_MASK X86_PT_PAE_MASK 187 187 # define GST_IS_PSE_ACTIVE(pVCpu) (true) 188 # define GST_IS_NX_ACTIVE(pVCpu) ( CPUMIsGuestNXEnabled(pVCpu)) /** @todo shadow this variable */188 # define GST_IS_NX_ACTIVE(pVCpu) (pgmGstIsNoExecuteActive(pVCpu)) 189 189 # define BTH_IS_NP_ACTIVE(pVM) (false) 190 190 #endif 191 191 192 -
trunk/src/VBox/VMM/PGMInline.h
r30895 r31069 553 553 554 554 #endif /* !IN_RC */ 555 556 557 /** 558 * Checks if the no-execute (NX) feature is active (EFER.NXE=1). 559 * 560 * This is inlined so that we can perform consistency checks in debug builds. 561 * 562 * @returns true if it is, false if it isn't. 563 * @param pVCpu The current CPU. 564 */ 565 DECL_FORCE_INLINE(bool) pgmGstIsNoExecuteActive(PVMCPU pVCpu) 566 { 567 /** @todo shadow this variable */ 568 return CPUMIsGuestNXEnabled(pVCpu); 569 } 570 571 572 /** 573 * Checks if the page size extension (PSE) is currently enabled (CR4.PSE=1). 574 * 575 * This is inlined so that we can perform consistency checks in debug builds. 576 * 577 * @returns true if it is, false if it isn't. 578 * @param pVCpu The current CPU. 579 */ 580 DECL_FORCE_INLINE(bool) pgmGstIsPageSizeExtActive(PVMCPU pVCpu) 581 { 582 /** @todo ( (pVCpu)->pgm.s.fGst32BitPageSizeExtension ) */ 583 return CPUMIsGuestPageSizeExtEnabled(pVCpu); 584 } 585 555 586 556 587 /** -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r31067 r31069 406 406 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) 407 407 if ( PdeSrc.b.u1Size 408 # if PGM_GST_TYPE == PGM_TYPE_32BIT 409 && CPUMIsGuestPageSizeExtEnabled(pVCpu) 410 # endif 411 ) 408 && GST_IS_PSE_ACTIVE(pVCpu)) 412 409 GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(pVM, PdeSrc) 413 410 | ((RTGCPHYS)pvFault & (GST_BIG_PAGE_OFFSET_MASK ^ PAGE_OFFSET_MASK)); … … 1138 1135 PdeSrc.u = 0; 1139 1136 # endif /* PGM_GST_TYPE != PGM_TYPE_32BIT */ 1140 1141 # if PGM_GST_TYPE == PGM_TYPE_32BIT 1142 const bool fIsBigPage = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu); 1143 # else 1144 const bool fIsBigPage = PdeSrc.b.u1Size; 1145 # endif 1137 const bool fIsBigPage = PdeSrc.b.u1Size && GST_IS_PSE_ACTIVE(pVCpu); 1146 1138 1147 1139 # ifdef IN_RING3 … … 1761 1753 * Check that the page is present and that the shadow PDE isn't out of sync. 1762 1754 */ 1763 # if PGM_GST_TYPE == PGM_TYPE_32BIT 1764 const bool fBigPage = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu); 1765 # else 1766 const bool fBigPage = PdeSrc.b.u1Size; 1767 # endif 1755 const bool fBigPage = PdeSrc.b.u1Size && GST_IS_PSE_ACTIVE(pVCpu); 1768 1756 const bool fPdeValid = !fBigPage ? GST_IS_PDE_VALID(pVCpu, PdeSrc) : GST_IS_BIG_PDE_VALID(pVCpu, PdeSrc); 1769 1757 RTGCPHYS GCPhys; … … 1790 1778 && (PdeSrc.n.u1Write == PdeDst.n.u1Write || !PdeDst.n.u1Write) 1791 1779 # if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE) 1792 && (PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute || ! CPUMIsGuestNXEnabled(pVCpu))1780 && (PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute || !GST_IS_NX_ACTIVE(pVCpu)) 1793 1781 # endif 1794 1782 ) … … 2261 2249 bool fWriteFault = !!(uErr & X86_TRAP_PF_RW); 2262 2250 # if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE) 2263 bool fMaybeNXEFault = (uErr & X86_TRAP_PF_ID) && CPUMIsGuestNXEnabled(pVCpu);2251 bool fMaybeNXEFault = (uErr & X86_TRAP_PF_ID) && GST_IS_NX_ACTIVE(pVCpu); 2264 2252 # endif 2265 2253 bool fMaybeWriteProtFault = fWriteFault && (fUserLevelFault || CPUMIsGuestR0WriteProtEnabled(pVCpu)); … … 2337 2325 if (!pPdeSrc->n.u1Present) 2338 2326 return PGM_BTH_NAME(CheckPageFaultReturnNP)(pVCpu, uErr, GCPtrPage, 2); 2339 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2340 bool const fBigPage = pPdeSrc->b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu); 2341 # else 2342 bool const fBigPage = pPdeSrc->b.u1Size; 2343 # endif 2327 bool const fBigPage = pPdeSrc->b.u1Size && GST_IS_PSE_ACTIVE(pVCpu); 2344 2328 if (!fBigPage ? !GST_IS_PDE_VALID(pVCpu, *pPdeSrc) : !GST_IS_BIG_PDE_VALID(pVCpu, *pPdeSrc)) 2345 2329 return PGM_BTH_NAME(CheckPageFaultReturnRSVD)(pVCpu, uErr, GCPtrPage, 2); … … 2455 2439 PGM_BTH_DECL(int, CheckDirtyPageFault)(PVMCPU pVCpu, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCPTR GCPtrPage) 2456 2440 { 2457 # if PGM_GST_TYPE == PGM_TYPE_32BIT2458 const bool fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);2459 # else2460 const bool fBigPagesSupported = true;2461 # endif2462 2441 PVM pVM = pVCpu->CTX_SUFF(pVM); 2463 2442 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); … … 2468 2447 * Handle big page. 2469 2448 */ 2470 if (pPdeSrc->b.u1Size && fBigPagesSupported)2449 if (pPdeSrc->b.u1Size && GST_IS_PSE_ACTIVE(pVCpu)) 2471 2450 { 2472 2451 if ( pPdeDst->n.u1Present … … 2754 2733 */ 2755 2734 PSHWPT pPTDst; 2756 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2757 const bool fPageTable = !PdeSrc.b.u1Size || !CPUMIsGuestPageSizeExtEnabled(pVCpu); 2758 # else 2759 const bool fPageTable = !PdeSrc.b.u1Size; 2760 # endif 2735 const bool fPageTable = !PdeSrc.b.u1Size || !GST_IS_PSE_ACTIVE(pVCpu); 2761 2736 PPGMPOOLPAGE pShwPage; 2762 2737 RTGCPHYS GCPhys; … … 2774 2749 PGMPOOLACCESS enmAccess; 2775 2750 # if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE) 2776 const bool fNoExecute = PdeSrc.n.u1NoExecute && CPUMIsGuestNXEnabled(pVCpu);2751 const bool fNoExecute = PdeSrc.n.u1NoExecute && GST_IS_NX_ACTIVE(pVCpu); 2777 2752 # else 2778 2753 const bool fNoExecute = false; … … 3779 3754 || PGM_GST_TYPE == PGM_TYPE_AMD64 3780 3755 3781 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3782 bool fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu); 3783 # else 3784 bool fBigPagesSupported = true; 3785 # endif 3756 bool fBigPagesSupported = GST_IS_PSE_ACTIVE(pVCpu); 3786 3757 PPGMCPU pPGM = &pVCpu->pgm.s; 3787 3758 RTGCPHYS GCPhysGst; /* page address derived from the guest page tables. */ -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r30369 r31069 213 213 { 214 214 *pfFlags = (Pde.u & ~SHW_PDE_PG_MASK); 215 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) 215 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) /** @todo why do we have to check the guest state here? */ 216 216 if ((Pde.u & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu)) 217 217 *pfFlags |= X86_PTE_PAE_NX; … … 266 266 *pfFlags = (Pte.u & ~SHW_PTE_PG_MASK) 267 267 & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US)); 268 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) 268 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) /** @todo why do we have to check the guest state here? */ 269 269 /* The NX bit is determined by a bitwise OR between the PT and PD */ 270 270 if (((Pte.u | Pde.u) & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu))
Note:
See TracChangeset
for help on using the changeset viewer.