Changeset 31066 in vbox
- Timestamp:
- Jul 23, 2010 2:48:24 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r30908 r31066 3118 3118 } 3119 3119 /* Override the shadow mode is nested paging is active. */ 3120 if (HWACCMIsNestedPagingActive(pVM)) 3120 pVM->pgm.s.fNestedPaging = HWACCMIsNestedPagingActive(pVM); 3121 if (pVM->pgm.s.fNestedPaging) 3121 3122 enmShadowMode = HWACCMGetShwPagingMode(pVM); 3122 3123 -
trunk/src/VBox/VMM/PGMBth.h
r28800 r31066 136 136 || PGM_GST_TYPE == PGM_TYPE_PROT)) 137 137 138 PVM pVM = pVCpu->pVMR3; 139 140 Assert(!HWACCMIsNestedPagingActive(pVM)); 138 PVM pVM = pVCpu->pVMR3; 139 140 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 141 Assert(!pVM->pgm.s.fNestedPaging); 141 142 142 143 pgmLock(pVM); -
trunk/src/VBox/VMM/PGMGstDefs.h
r30889 r31066 84 84 # define GST_IS_NX_ACTIVE(pVCpu) (CPUMIsGuestNXEnabled(pVCpu)) /** @todo shadow this variable */ 85 85 # if PGM_GST_TYPE == PGM_TYPE_PROT /* (comment at top of PGMAllBth.h) */ 86 # define BTH_IS_NP_ACTIVE(pVM) HWACCMIsNestedPagingActive(pVM)86 # define BTH_IS_NP_ACTIVE(pVM) (pVM->pgm.s.fNestedPaging) 87 87 # else 88 88 # define BTH_IS_NP_ACTIVE(pVM) (false) -
trunk/src/VBox/VMM/PGMInternal.h
r31054 r31066 2646 2646 * This is used */ 2647 2647 bool fLessThan52PhysicalAddressBits; 2648 /** Alignment padding. */ 2649 bool afAlignment0[1]; 2650 2651 /* 2652 * This will be redefined at least two more times before we're done, I'm sure. 2653 * The current code is only to get on with the coding. 2654 * - 2004-06-10: initial version, bird. 2655 * - 2004-07-02: 1st time, bird. 2656 * - 2004-10-18: 2nd time, bird. 2657 * - 2005-07-xx: 3rd time, bird. 2658 */ 2659 2648 /** Set when nested paging is active. 2649 * This is meant to save calls to HWACCMIsNestedPagingActive and let the 2650 * compilers optimize the code better. Whether we use nested paging or 2651 * not is something we find out during VMM initialization and we won't 2652 * change this later on. */ 2653 bool fNestedPaging; 2660 2654 /** The host paging mode. (This is what SUPLib reports.) */ 2661 2655 SUPPAGINGMODE enmHostMode; … … 3645 3639 int pgmMapDeactivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3); 3646 3640 3647 int pgmShwSyncPaePDPtr(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD); 3648 #ifndef IN_RC 3649 int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E pGstPml4e, PX86PDPE pGstPdpe, PX86PDPAE *ppPD); 3650 #endif 3651 int pgmShwGetEPTPDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PEPTPDPT *ppPdpt, PEPTPD *ppPD); 3641 int pgmShwSyncPaePDPtr(PVMCPU pVCpu, RTGCPTR GCPtr, PCX86PDPE pGstPdpe, PX86PDPAE *ppPD); 3652 3642 3653 3643 int pgmGstLazyMap32BitPD(PVMCPU pVCpu, PX86PD *ppPd); -
trunk/src/VBox/VMM/PGMShw.h
r30326 r31066 188 188 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 189 189 190 Assert(HWACCMIsNestedPagingActive(pVM)); 190 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 191 Assert(pVM->pgm.s.fNestedPaging); 191 192 Assert(!pVCpu->pgm.s.pShwPageCR3R3); 192 193 -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r31054 r31066 70 70 DECLINLINE(int) pgmShwGetLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPT *ppPdpt, PX86PDPAE *ppPD); 71 71 DECLINLINE(int) pgmShwGetPaePoolPagePD(PPGMCPU pPGM, RTGCPTR GCPtr, PPGMPOOLPAGE *ppShwPde); 72 #ifndef IN_RC 73 static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PCX86PML4E pGstPml4e, PCX86PDPE pGstPdpe, PX86PDPAE *ppPD); 74 static int pgmShwGetEPTPDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PEPTPDPT *ppPdpt, PEPTPD *ppPD); 75 #endif 76 72 77 73 78 /* … … 623 628 } 624 629 625 if (!HWACCMIsNestedPagingActive(pVM)) 630 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 631 if (!pVM->pgm.s.fNestedPaging) 626 632 { 627 633 /* … … 912 918 * @param ppPD Receives address of page directory 913 919 */ 914 int pgmShwSyncPaePDPtr(PVMCPU pVCpu, RTGCPTR GCPtr, P X86PDPE pGstPdpe, PX86PDPAE *ppPD)920 int pgmShwSyncPaePDPtr(PVMCPU pVCpu, RTGCPTR GCPtr, PCX86PDPE pGstPdpe, PX86PDPAE *ppPD) 915 921 { 916 922 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; … … 930 936 RTGCPTR64 GCPdPt; 931 937 PGMPOOLKIND enmKind; 938 Assert(pGstPdpe); 939 X86PDPE GstPdpe = *pGstPdpe; 932 940 933 941 # if defined(IN_RC) … … 936 944 # endif 937 945 938 if (HWACCMIsNestedPagingActive(pVM) || !CPUMIsGuestPagingEnabled(pVCpu)) 946 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 947 if (pVM->pgm.s.fNestedPaging || !CPUMIsGuestPagingEnabled(pVCpu)) 939 948 { 940 949 /* AMD-V nested paging or real/protected mode without paging. */ … … 944 953 else 945 954 { 946 Assert(pGstPdpe);947 948 955 if (CPUMGetGuestCR4(pVCpu) & X86_CR4_PAE) 949 956 { 950 if (! pGstPdpe->n.u1Present)957 if (!GstPdpe.n.u1Present) 951 958 { 952 959 /* PD not present; guest must reload CR3 to change it. … … 955 962 Assert(!HWACCMIsEnabled(pVM)); 956 963 957 GCPdPt = pGstPdpe->u & X86_PDPE_PG_MASK;964 GCPdPt = GstPdpe.u & X86_PDPE_PG_MASK; 958 965 enmKind = PGMPOOLKIND_PAE_PD_PHYS; 959 pGstPdpe->n.u1Present = 1;966 GstPdpe.n.u1Present = 1; 960 967 } 961 968 else 962 969 { 963 GCPdPt = pGstPdpe->u & X86_PDPE_PG_MASK;970 GCPdPt = GstPdpe.u & X86_PDPE_PG_MASK; 964 971 enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD; 965 972 } … … 978 985 /* The PD was cached or created; hook it up now. */ 979 986 pPdpe->u |= pShwPage->Core.Key 980 | ( pGstPdpe->u & ~(X86_PDPE_PG_MASK | X86_PDPE_AVL_MASK | X86_PDPE_PCD | X86_PDPE_PWT));987 | (GstPdpe.u & ~(X86_PDPE_PG_MASK | X86_PDPE_AVL_MASK | X86_PDPE_PCD | X86_PDPE_PWT)); 981 988 982 989 # if defined(IN_RC) … … 1051 1058 * @param ppPD Receives address of page directory 1052 1059 */ 1053 int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E pGstPml4e, PX86PDPE pGstPdpe, PX86PDPAE *ppPD)1060 static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PCX86PML4E pGstPml4e, PCX86PDPE pGstPdpe, PX86PDPAE *ppPD) 1054 1061 { 1055 1062 PPGMCPU pPGM = &pVCpu->pgm.s; … … 1058 1065 const unsigned iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 1059 1066 PX86PML4E pPml4e = pgmShwGetLongModePML4EPtr(pPGM, iPml4); 1060 bool fNestedPagingOrNoGstPaging = HWACCMIsNestedPagingActive(pVM) || !CPUMIsGuestPagingEnabled(pVCpu); 1067 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 1068 bool fNestedPagingOrNoGstPaging = pVM->pgm.s.fNestedPaging || !CPUMIsGuestPagingEnabled(pVCpu); 1061 1069 PPGMPOOLPAGE pShwPage; 1062 1070 int rc; … … 1201 1209 * @param ppPD Receives address of page directory 1202 1210 */ 1203 int pgmShwGetEPTPDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PEPTPDPT *ppPdpt, PEPTPD *ppPD)1211 static int pgmShwGetEPTPDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PEPTPDPT *ppPdpt, PEPTPD *ppPD) 1204 1212 { 1205 1213 PPGMCPU pPGM = &pVCpu->pgm.s; … … 1212 1220 int rc; 1213 1221 1214 Assert(HWACCMIsNestedPagingActive(pVM)); 1222 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 1223 Assert(pVM->pgm.s.fNestedPaging); 1215 1224 Assert(PGMIsLockOwner(pVM)); 1216 1225 … … 1829 1838 1830 1839 /* We assume we're only called in nested paging mode. */ 1831 Assert(HWACCMIsNestedPagingActive(pVM) || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT); 1840 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 1841 Assert(pVM->pgm.s.fNestedPaging || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT); 1832 1842 Assert(pVM->pgm.s.fMappingsDisabled); 1833 1843 Assert(!(pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)); -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r30895 r31066 906 906 RTGCPHYS GCPhys2; 907 907 uint64_t fPageGst; 908 if (!HWACCMIsNestedPagingActive(pVM)) 908 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 909 if (!pVM->pgm.s.fNestedPaging) 909 910 { 910 911 rc = PGMGstGetPage(pVCpu, pvFault, &fPageGst, &GCPhys2); … … 1124 1125 unsigned iPDSrc = 0; 1125 1126 # if PGM_GST_TYPE == PGM_TYPE_PAE 1126 X86PDPE PdpeSrc ;1127 PX86PDPAE pPDSrc = pgmGstGetPaePDPtr(pVCpu, GCPtrPage, &iPDSrc, &PdpeSrc );1127 X86PDPE PdpeSrcIgn; 1128 PX86PDPAE pPDSrc = pgmGstGetPaePDPtr(pVCpu, GCPtrPage, &iPDSrc, &PdpeSrcIgn); 1128 1129 # else /* AMD64 */ 1129 PX86PML4E pPml4eSrc ;1130 X86PDPE PdpeSrc ;1131 PX86PDPAE pPDSrc = pgmGstGetLongModePDPtr(pVCpu, GCPtrPage, &pPml4eSrc , &PdpeSrc, &iPDSrc);1130 PX86PML4E pPml4eSrcIgn; 1131 X86PDPE PdpeSrcIgn; 1132 PX86PDPAE pPDSrc = pgmGstGetLongModePDPtr(pVCpu, GCPtrPage, &pPml4eSrcIgn, &PdpeSrcIgn, &iPDSrc); 1132 1133 # endif 1133 1134 GSTPDE PdeSrc; … … 2079 2080 if (PdeDst.n.u1Size) 2080 2081 { 2081 Assert(HWACCMIsNestedPagingActive(pVM)); 2082 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 2083 Assert(pVM->pgm.s.fNestedPaging); 2082 2084 Log(("CPU%d: SyncPage: Pde (big:%RX64) at %RGv changed behind our back!\n", pVCpu->idCpu, PdeDst.u, GCPtrPage)); 2083 2085 return VINF_SUCCESS; … … 3459 3461 LogFlow(("VerifyAccessSyncPage: GCPtrPage=%RGv fPage=%#x uErr=%#x\n", GCPtrPage, fPage, uErr)); 3460 3462 3461 Assert(!HWACCMIsNestedPagingActive(pVM)); 3463 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 3464 Assert(!pVM->pgm.s.fNestedPaging); 3462 3465 #if ( PGM_GST_TYPE == PGM_TYPE_32BIT \ 3463 3466 || PGM_GST_TYPE == PGM_TYPE_REAL \ … … 4651 4654 && PGM_GST_TYPE != PGM_TYPE_PROT)) 4652 4655 4653 Assert(!HWACCMIsNestedPagingActive(pVM)); 4656 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 4657 Assert(!pVM->pgm.s.fNestedPaging); 4654 4658 4655 4659 /* … … 4798 4802 4799 4803 # if PGM_GST_TYPE != PGM_TYPE_REAL 4800 Assert(!HWACCMIsNestedPagingActive(pVM)); 4804 Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); 4805 Assert(!pVM->pgm.s.fNestedPaging); 4801 4806 # endif 4802 4807 -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r30372 r31066 3124 3124 case PGMPOOLKIND_EPT_PD_FOR_PHYS: 3125 3125 { 3126 Assert( HWACCMIsNestedPagingActive(pVM));3126 Assert(pVM->pgm.s.fNestedPaging); 3127 3127 3128 3128 const uint64_t u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PDE4M_P | X86_PDE4M_PS; … … 3158 3158 case PGMPOOLKIND_PAE_PD_PHYS: 3159 3159 { 3160 Assert( HWACCMIsNestedPagingActive(pVM));3160 Assert(pVM->pgm.s.fNestedPaging); 3161 3161 3162 3162 const uint64_t u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PDE4M_P | X86_PDE4M_PS;
Note:
See TracChangeset
for help on using the changeset viewer.