- Timestamp:
- Feb 9, 2009 12:07:16 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMBth.h
r16575 r16579 142 142 Assert(!HWACCMIsNestedPagingActive(pVM)); 143 143 /* We only need shadow paging in real and protected mode for VT-x and AMD-V (excluding nested paging/EPT modes) */ 144 if (HWACCM R3IsActive(pVM))144 if (HWACCMIsEnabled(pVM)) 145 145 { 146 146 /* Free the previous root mapping if still active. */ -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r16428 r16579 872 872 DECLINLINE(int) pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD) 873 873 { 874 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 875 PX86PDPT pPdpt = pgmShwGetPaePDPTPtr(&pVM->pgm.s); 876 PX86PDPE pPdpe = &pPdpt->a[iPdPt]; 877 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 878 bool fNestedPaging = HWACCMIsNestedPagingActive(pVM); 879 bool fPaging = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG); 874 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 875 PX86PDPT pPdpt = pgmShwGetPaePDPTPtr(&pVM->pgm.s); 876 PX86PDPE pPdpe = &pPdpt->a[iPdPt]; 877 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 880 878 PPGMPOOLPAGE pShwPage; 881 879 int rc; … … 885 883 && !(pPdpe->u & X86_PDPE_PG_MASK)) 886 884 { 887 if (!fNestedPaging) 885 bool fNestedPaging = HWACCMIsNestedPagingActive(pVM); 886 bool fPaging = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG); 887 RTGCPTR64 GCPdPt; 888 PGMPOOLKIND enmKind; 889 890 if (fNestedPaging || !fPaging) 891 { 892 /* AMD-V nested paging or real/protected mode without paging */ 893 GCPdPt = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT; 894 enmKind = PGMPOOLKIND_PAE_PD_PHYS; 895 } 896 else 888 897 { 889 898 Assert(pGstPdpe); 890 Assert(!(pPdpe->u & X86_PDPE_PG_MASK)); 891 /* Create a reference back to the PDPT by using the index in its shadow page. */ 892 rc = pgmPoolAlloc(pVM, pGstPdpe->u & X86_PDPE_PG_MASK, PGMPOOLKIND_PAE_PD_FOR_PAE_PD, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 893 } 894 else 895 { 896 /* AMD-V nested paging or real/protected mode without paging */ 897 RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT; 898 899 rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_PAE_PD_PHYS, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 900 } 901 899 900 GCPdPt = pGstPdpe->u & X86_PDPE_PG_MASK; 901 enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD; 902 } 903 904 /* Create a reference back to the PDPT by using the index in its shadow page. */ 905 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 902 906 if (rc == VERR_PGM_POOL_FLUSHED) 903 907 { … … 971 975 PX86PML4E pPml4e = pgmShwGetLongModePML4EPtr(pPGM, iPml4); 972 976 bool fNestedPaging = HWACCMIsNestedPagingActive(pVM); 977 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 978 bool fPaging = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG); 979 #endif 973 980 PPGMPOOLPAGE pShwPage; 974 981 int rc; … … 978 985 && !(pPml4e->u & X86_PML4E_PG_MASK)) 979 986 { 980 Assert(!(pPml4e->u & X86_PML4E_PG_MASK)); 987 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 988 RTGCPTR64 GCPml4; 989 PGMPOOLKIND enmKind; 990 991 Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 992 993 if (fNestedPaging || !fPaging) 994 { 995 /* AMD-V nested paging or real/protected mode without paging */ 996 GCPml4 = (RTGCPTR64)iPml4 << X86_PML4_SHIFT; 997 enmKind = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS; 998 } 999 else 1000 { 1001 Assert(pGstPml4e && pGstPdpe); 1002 1003 GCPml4 = pGstPml4e->u & X86_PML4E_PG_MASK; 1004 enmKind = PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT; 1005 } 1006 1007 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1008 rc = pgmPoolAlloc(pVM, GCPml4, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage); 1009 #else 981 1010 if (!fNestedPaging) 982 1011 { … … 994 1023 PGMPOOLKIND_64BIT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage); 995 1024 } 996 1025 #endif 997 1026 if (rc == VERR_PGM_POOL_FLUSHED) 998 1027 { … … 1021 1050 && !(pPdpe->u & X86_PDPE_PG_MASK)) 1022 1051 { 1052 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1053 RTGCPTR64 GCPdPt; 1054 PGMPOOLKIND enmKind; 1055 1056 if (fNestedPaging || !fPaging) 1057 { 1058 /* AMD-V nested paging or real/protected mode without paging */ 1059 GCPdPt = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT; 1060 enmKind = PGMPOOLKIND_64BIT_PD_FOR_PHYS; 1061 } 1062 else 1063 { 1064 Assert(pGstPdpe); 1065 1066 GCPdPt = pGstPdpe->u & X86_PDPE_PG_MASK; 1067 enmKind = PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD; 1068 } 1069 1070 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1071 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 1072 #else 1023 1073 if (!fNestedPaging) 1024 1074 { … … 1035 1085 rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 1036 1086 } 1037 1087 #endif 1038 1088 if (rc == VERR_PGM_POOL_FLUSHED) 1039 1089 { … … 1134 1184 RTGCPTR64 GCPml4 = (RTGCPTR64)iPml4 << EPT_PML4_SHIFT; 1135 1185 1186 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1187 rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage); 1188 #else 1136 1189 rc = pgmPoolAlloc(pVM, GCPml4 + RT_BIT_64(63) /* hack: make the address unique */, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage); 1190 #endif 1137 1191 if (rc == VERR_PGM_POOL_FLUSHED) 1138 1192 { … … 1168 1222 RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT; 1169 1223 1224 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1225 rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 1226 #else 1170 1227 rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 1228 #endif 1171 1229 if (rc == VERR_PGM_POOL_FLUSHED) 1172 1230 { -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r16428 r16579 1272 1272 */ 1273 1273 case PGMPOOLKIND_32BIT_PT_FOR_PHYS: 1274 case PGMPOOLKIND_32BIT_PD_PHYS: 1274 1275 case PGMPOOLKIND_PAE_PT_FOR_PHYS: 1276 case PGMPOOLKIND_PAE_PD_PHYS: 1277 case PGMPOOLKIND_PAE_PDPT_PHYS: 1275 1278 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1276 1279 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1280 case PGMPOOLKIND_EPT_PT_FOR_PHYS: 1281 case PGMPOOLKIND_EPT_PD_FOR_PHYS: 1277 1282 case PGMPOOLKIND_EPT_PDPT_FOR_PHYS: 1278 case PGMPOOLKIND_EPT_PD_FOR_PHYS: 1279 case PGMPOOLKIND_EPT_PT_FOR_PHYS: 1280 case PGMPOOLKIND_PAE_PD_PHYS: 1281 case PGMPOOLKIND_PAE_PDPT_PHYS: 1282 case PGMPOOLKIND_32BIT_PD_PHYS: 1283 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1284 return false; 1285 #else 1283 1286 return true; 1287 #endif 1284 1288 1285 1289 /*
Note:
See TracChangeset
for help on using the changeset viewer.