Changeset 13188 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 11, 2008 1:58:30 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r13122 r13188 185 185 * Shadow - AMD64 mode 186 186 */ 187 # define PGM_SHW_TYPEPGM_TYPE_AMD64188 # define PGM_SHW_NAME(name)PGM_SHW_NAME_AMD64(name)189 # include "PGMAllShw.h"187 # define PGM_SHW_TYPE PGM_TYPE_AMD64 188 # define PGM_SHW_NAME(name) PGM_SHW_NAME_AMD64(name) 189 # include "PGMAllShw.h" 190 190 191 191 /* Guest - protected mode */ 192 # define PGM_GST_TYPEPGM_TYPE_PROT193 # define PGM_GST_NAME(name)PGM_GST_NAME_PROT(name)194 # define PGM_BTH_NAME(name)PGM_BTH_NAME_AMD64_PROT(name)195 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_PAE_PT_FOR_PHYS196 # include "PGMAllBth.h"197 # undef BTH_PGMPOOLKIND_PT_FOR_PT198 # undef PGM_BTH_NAME199 # undef PGM_GST_TYPE200 # undef PGM_GST_NAME201 202 # ifdef VBOX_WITH_64_BITS_GUESTS192 # define PGM_GST_TYPE PGM_TYPE_PROT 193 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 194 # define PGM_BTH_NAME(name) PGM_BTH_NAME_AMD64_PROT(name) 195 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 196 # include "PGMAllBth.h" 197 # undef BTH_PGMPOOLKIND_PT_FOR_PT 198 # undef PGM_BTH_NAME 199 # undef PGM_GST_TYPE 200 # undef PGM_GST_NAME 201 202 # ifdef VBOX_WITH_64_BITS_GUESTS 203 203 /* Guest - AMD64 mode */ 204 #define PGM_GST_TYPE PGM_TYPE_AMD64 205 #define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 206 #define PGM_BTH_NAME(name) PGM_BTH_NAME_AMD64_AMD64(name) 207 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 208 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 209 #include "PGMAllGst.h" 210 #include "PGMAllBth.h" 211 #undef BTH_PGMPOOLKIND_PT_FOR_BIG 212 #undef BTH_PGMPOOLKIND_PT_FOR_PT 213 #undef PGM_BTH_NAME 214 #undef PGM_GST_TYPE 215 #undef PGM_GST_NAME 216 #endif 217 218 #undef PGM_SHW_TYPE 219 #undef PGM_SHW_NAME 204 # define PGM_GST_TYPE PGM_TYPE_AMD64 205 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 206 # define PGM_BTH_NAME(name) PGM_BTH_NAME_AMD64_AMD64(name) 207 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 208 # define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 209 # include "PGMAllGst.h" 210 # include "PGMAllBth.h" 211 # undef BTH_PGMPOOLKIND_PT_FOR_BIG 212 # undef BTH_PGMPOOLKIND_PT_FOR_PT 213 # undef PGM_BTH_NAME 214 # undef PGM_GST_TYPE 215 # undef PGM_GST_NAME 216 # endif /* VBOX_WITH_64_BITS_GUESTS */ 217 218 # undef PGM_SHW_TYPE 219 # undef PGM_SHW_NAME 220 220 221 221 222 /* 222 223 * Shadow - Nested paging mode 223 224 */ 224 # define PGM_SHW_TYPEPGM_TYPE_NESTED225 # define PGM_SHW_NAME(name)PGM_SHW_NAME_NESTED(name)226 # include "PGMAllShw.h"225 # define PGM_SHW_TYPE PGM_TYPE_NESTED 226 # define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED(name) 227 # include "PGMAllShw.h" 227 228 228 229 /* Guest - real mode */ 229 # define PGM_GST_TYPEPGM_TYPE_REAL230 # define PGM_GST_NAME(name)PGM_GST_NAME_REAL(name)231 # define PGM_BTH_NAME(name)PGM_BTH_NAME_NESTED_REAL(name)232 # include "PGMAllBth.h"233 # undef PGM_BTH_NAME234 # undef PGM_GST_TYPE235 # undef PGM_GST_NAME230 # define PGM_GST_TYPE PGM_TYPE_REAL 231 # define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 232 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_REAL(name) 233 # include "PGMAllBth.h" 234 # undef PGM_BTH_NAME 235 # undef PGM_GST_TYPE 236 # undef PGM_GST_NAME 236 237 237 238 /* Guest - protected mode */ 238 # define PGM_GST_TYPEPGM_TYPE_PROT239 # define PGM_GST_NAME(name)PGM_GST_NAME_PROT(name)240 # define PGM_BTH_NAME(name)PGM_BTH_NAME_NESTED_PROT(name)241 # include "PGMAllBth.h"242 # undef PGM_BTH_NAME243 # undef PGM_GST_TYPE244 # undef PGM_GST_NAME239 # define PGM_GST_TYPE PGM_TYPE_PROT 240 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 241 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PROT(name) 242 # include "PGMAllBth.h" 243 # undef PGM_BTH_NAME 244 # undef PGM_GST_TYPE 245 # undef PGM_GST_NAME 245 246 246 247 /* Guest - 32-bit mode */ 247 # define PGM_GST_TYPEPGM_TYPE_32BIT248 # define PGM_GST_NAME(name)PGM_GST_NAME_32BIT(name)249 # define PGM_BTH_NAME(name)PGM_BTH_NAME_NESTED_32BIT(name)250 # include "PGMAllBth.h"251 # undef PGM_BTH_NAME252 # undef PGM_GST_TYPE253 # undef PGM_GST_NAME248 # define PGM_GST_TYPE PGM_TYPE_32BIT 249 # define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 250 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT(name) 251 # include "PGMAllBth.h" 252 # undef PGM_BTH_NAME 253 # undef PGM_GST_TYPE 254 # undef PGM_GST_NAME 254 255 255 256 /* Guest - PAE mode */ 256 # define PGM_GST_TYPEPGM_TYPE_PAE257 # define PGM_GST_NAME(name)PGM_GST_NAME_PAE(name)258 # define PGM_BTH_NAME(name)PGM_BTH_NAME_NESTED_PAE(name)259 # include "PGMAllBth.h"260 # undef PGM_BTH_NAME261 # undef PGM_GST_TYPE262 # undef PGM_GST_NAME263 264 # ifdef VBOX_WITH_64_BITS_GUESTS257 # define PGM_GST_TYPE PGM_TYPE_PAE 258 # define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 259 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE(name) 260 # include "PGMAllBth.h" 261 # undef PGM_BTH_NAME 262 # undef PGM_GST_TYPE 263 # undef PGM_GST_NAME 264 265 # ifdef VBOX_WITH_64_BITS_GUESTS 265 266 /* Guest - AMD64 mode */ 266 #define PGM_GST_TYPE PGM_TYPE_AMD64 267 #define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 268 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64(name) 269 #include "PGMAllBth.h" 270 #undef PGM_BTH_NAME 271 #undef PGM_GST_TYPE 272 #undef PGM_GST_NAME 273 #endif 274 275 #undef PGM_SHW_TYPE 276 #undef PGM_SHW_NAME 267 # define PGM_GST_TYPE PGM_TYPE_AMD64 268 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 269 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64(name) 270 # include "PGMAllBth.h" 271 # undef PGM_BTH_NAME 272 # undef PGM_GST_TYPE 273 # undef PGM_GST_NAME 274 # endif /* VBOX_WITH_64_BITS_GUESTS */ 275 276 # undef PGM_SHW_TYPE 277 # undef PGM_SHW_NAME 278 277 279 278 280 /* 279 281 * Shadow - EPT 280 282 */ 281 # define PGM_SHW_TYPEPGM_TYPE_EPT282 # define PGM_SHW_NAME(name)PGM_SHW_NAME_EPT(name)283 # include "PGMAllShw.h"283 # define PGM_SHW_TYPE PGM_TYPE_EPT 284 # define PGM_SHW_NAME(name) PGM_SHW_NAME_EPT(name) 285 # include "PGMAllShw.h" 284 286 285 287 /* Guest - real mode */ 286 # define PGM_GST_TYPEPGM_TYPE_REAL287 # define PGM_GST_NAME(name)PGM_GST_NAME_REAL(name)288 # define PGM_BTH_NAME(name)PGM_BTH_NAME_EPT_REAL(name)289 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_EPT_PT_FOR_PHYS290 # include "PGMAllBth.h"291 # undef BTH_PGMPOOLKIND_PT_FOR_PT292 # undef PGM_BTH_NAME293 # undef PGM_GST_TYPE294 # undef PGM_GST_NAME288 # define PGM_GST_TYPE PGM_TYPE_REAL 289 # define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 290 # define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_REAL(name) 291 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_EPT_PT_FOR_PHYS 292 # include "PGMAllBth.h" 293 # undef BTH_PGMPOOLKIND_PT_FOR_PT 294 # undef PGM_BTH_NAME 295 # undef PGM_GST_TYPE 296 # undef PGM_GST_NAME 295 297 296 298 /* Guest - protected mode */ 297 # define PGM_GST_TYPEPGM_TYPE_PROT298 # define PGM_GST_NAME(name)PGM_GST_NAME_PROT(name)299 # define PGM_BTH_NAME(name)PGM_BTH_NAME_EPT_PROT(name)300 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_EPT_PT_FOR_PHYS301 # include "PGMAllBth.h"302 # undef BTH_PGMPOOLKIND_PT_FOR_PT303 # undef PGM_BTH_NAME304 # undef PGM_GST_TYPE305 # undef PGM_GST_NAME299 # define PGM_GST_TYPE PGM_TYPE_PROT 300 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 301 # define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_PROT(name) 302 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_EPT_PT_FOR_PHYS 303 # include "PGMAllBth.h" 304 # undef BTH_PGMPOOLKIND_PT_FOR_PT 305 # undef PGM_BTH_NAME 306 # undef PGM_GST_TYPE 307 # undef PGM_GST_NAME 306 308 307 309 /* Guest - 32-bit mode */ 308 # define PGM_GST_TYPEPGM_TYPE_32BIT309 # define PGM_GST_NAME(name)PGM_GST_NAME_32BIT(name)310 # define PGM_BTH_NAME(name)PGM_BTH_NAME_EPT_32BIT(name)311 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_EPT_PT_FOR_PHYS312 # include "PGMAllBth.h"313 # undef BTH_PGMPOOLKIND_PT_FOR_PT314 # undef PGM_BTH_NAME315 # undef PGM_GST_TYPE316 # undef PGM_GST_NAME310 # define PGM_GST_TYPE PGM_TYPE_32BIT 311 # define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 312 # define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_32BIT(name) 313 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_EPT_PT_FOR_PHYS 314 # include "PGMAllBth.h" 315 # undef BTH_PGMPOOLKIND_PT_FOR_PT 316 # undef PGM_BTH_NAME 317 # undef PGM_GST_TYPE 318 # undef PGM_GST_NAME 317 319 318 320 /* Guest - PAE mode */ 319 # define PGM_GST_TYPEPGM_TYPE_PAE320 # define PGM_GST_NAME(name)PGM_GST_NAME_PAE(name)321 # define PGM_BTH_NAME(name)PGM_BTH_NAME_EPT_PAE(name)322 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_EPT_PT_FOR_PHYS323 # include "PGMAllBth.h"324 # undef BTH_PGMPOOLKIND_PT_FOR_PT325 # undef PGM_BTH_NAME326 # undef PGM_GST_TYPE327 # undef PGM_GST_NAME328 329 # ifdef VBOX_WITH_64_BITS_GUESTS321 # define PGM_GST_TYPE PGM_TYPE_PAE 322 # define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 323 # define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_PAE(name) 324 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_EPT_PT_FOR_PHYS 325 # include "PGMAllBth.h" 326 # undef BTH_PGMPOOLKIND_PT_FOR_PT 327 # undef PGM_BTH_NAME 328 # undef PGM_GST_TYPE 329 # undef PGM_GST_NAME 330 331 # ifdef VBOX_WITH_64_BITS_GUESTS 330 332 /* Guest - AMD64 mode */ 331 # define PGM_GST_TYPEPGM_TYPE_AMD64332 # define PGM_GST_NAME(name)PGM_GST_NAME_AMD64(name)333 # define PGM_BTH_NAME(name)PGM_BTH_NAME_EPT_AMD64(name)334 # define BTH_PGMPOOLKIND_PT_FOR_PTPGMPOOLKIND_EPT_PT_FOR_PHYS335 # include "PGMAllBth.h"336 # undef BTH_PGMPOOLKIND_PT_FOR_PT337 # undef PGM_BTH_NAME338 # undef PGM_GST_TYPE339 # undef PGM_GST_NAME340 # endif341 342 # undef PGM_SHW_TYPE343 # undef PGM_SHW_NAME333 # define PGM_GST_TYPE PGM_TYPE_AMD64 334 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 335 # define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_AMD64(name) 336 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_EPT_PT_FOR_PHYS 337 # include "PGMAllBth.h" 338 # undef BTH_PGMPOOLKIND_PT_FOR_PT 339 # undef PGM_BTH_NAME 340 # undef PGM_GST_TYPE 341 # undef PGM_GST_NAME 342 # endif /* VBOX_WITH_64_BITS_GUESTS */ 343 344 # undef PGM_SHW_TYPE 345 # undef PGM_SHW_NAME 344 346 345 347 #endif /* !IN_GC */ … … 644 646 /** @todo merge PGMGCInvalidatePage with this one */ 645 647 646 # ifndef IN_RING3648 # ifndef IN_RING3 647 649 /* 648 650 * Notify the recompiler so it can record this instruction. … … 652 654 if (VBOX_FAILURE(rc)) 653 655 return rc; 654 # endif656 # endif 655 657 656 658 STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); … … 658 660 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); 659 661 660 # ifndef IN_RING0662 # ifndef IN_RING0 661 663 /* 662 664 * Check if we have a pending update of the CR3 monitoring. … … 670 672 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 671 673 } 672 # endif673 674 # ifdef IN_RING3674 # endif 675 676 # ifdef IN_RING3 675 677 /* 676 678 * Inform CSAM about the flush … … 678 680 /** @note this is to check if monitored pages have been changed; when we implement callbacks for virtual handlers, this is no longer required. */ 679 681 CSAMR3FlushPage(pVM, GCPtrPage); 680 # endif682 # endif 681 683 return rc; 682 684 } 683 #endif 685 #endif /* !IN_GC */ 684 686 685 687 … … 780 782 } 781 783 782 /** 783 * Syncs the SHADOW page directory pointer for the specified address. Allocates 784 * backing pages in case the PDPT entry is missing. 784 785 /** 786 * Syncs the SHADOW page directory pointer for the specified address. 787 * 788 * Allocates backing pages in case the PDPT entry is missing. 785 789 * 786 790 * @returns VBox status. … … 833 837 } 834 838 839 835 840 /** 836 841 * Gets the SHADOW page directory pointer for the specified address. … … 864 869 return VINF_SUCCESS; 865 870 } 871 866 872 867 873 #ifndef IN_GC -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r13134 r13188 112 112 113 113 # elif PGM_GST_TYPE == PGM_TYPE_AMD64 114 unsigned iPDSrc;115 PX86PML4E pPml4eSrc;116 X86PDPE PdpeSrc;117 PGSTPD pPDSrc;114 unsigned iPDSrc; 115 PX86PML4E pPml4eSrc; 116 X86PDPE PdpeSrc; 117 PGSTPD pPDSrc; 118 118 119 119 pPDSrc = pgmGstGetLongModePDPtr(&pVM->pgm.s, pvFault, &pPml4eSrc, &PdpeSrc, &iPDSrc); … … 133 133 } 134 134 # endif 135 # else 135 136 # else /* !PGM_WITH_PAGING */ 136 137 PGSTPD pPDSrc = NULL; 137 138 const unsigned iPDSrc = 0; 138 # endif 139 # endif /* !PGM_WITH_PAGING */ 140 139 141 140 142 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 141 143 const unsigned iPDDst = (RTGCUINTPTR)pvFault >> SHW_PD_SHIFT; 142 144 PX86PD pPDDst = pVM->pgm.s.CTXMID(p,32BitPD); 145 143 146 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 144 147 const unsigned iPDDst = (RTGCUINTPTR)pvFault >> SHW_PD_SHIFT; … … 158 161 # if PGM_GST_TYPE == PGM_TYPE_PROT 159 162 /* AMD-V nested paging */ 160 X86PML4E Pml4eSrc;161 X86PDPE PdpeSrc;162 PX86PML4E pPml4eSrc = &Pml4eSrc;163 X86PML4E Pml4eSrc; 164 X86PDPE PdpeSrc; 165 PX86PML4E pPml4eSrc = &Pml4eSrc; 163 166 164 167 /* Fake PML4 & PDPT entry; access control handled on the page table level, so allow everything. */ … … 174 177 } 175 178 Assert(pPDDst); 179 176 180 # elif PGM_SHW_TYPE == PGM_TYPE_EPT 177 181 const unsigned iPDDst = (((RTGCUINTPTR)pvFault >> SHW_PD_SHIFT) & SHW_PD_MASK);
Note:
See TracChangeset
for help on using the changeset viewer.