- Timestamp:
- Jul 19, 2018 3:51:20 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r72744 r73246 149 149 #endif /* IN_RING0 */ 150 150 #ifndef IN_RC 151 151 152 /** 152 153 * Flushes the guest TLB. … … 371 372 372 373 /** 373 * Return the shadow paging mode for nested paging/ept 374 * 375 * @returns shadow paging mode 376 * @param pVM The cross context VM structure. 377 */ 378 VMM_INT_DECL(PGMMODE) HMGetShwPagingMode(PVM pVM) 379 { 380 Assert(HMIsNestedPagingActive(pVM)); 381 if (pVM->hm.s.svm.fSupported) 382 return PGMMODE_NESTED; 383 384 Assert(pVM->hm.s.vmx.fSupported); 385 return PGMMODE_EPT; 386 } 374 * Checks if AMD-V is active. 375 * 376 * @returns true if AMD-V is active. 377 * @param pVM The cross context VM structure. 378 * 379 * @remarks Works before hmR3InitFinalizeR0. 380 */ 381 VMM_INT_DECL(bool) HMIsSvmActive(PVM pVM) 382 { 383 return pVM->hm.s.svm.fSupported && HMIsEnabled(pVM); 384 } 385 386 387 /** 388 * Checks if VT-x is active. 389 * 390 * @returns true if AMD-V is active. 391 * @param pVM The cross context VM structure. 392 * 393 * @remarks Works before hmR3InitFinalizeR0. 394 */ 395 VMM_INT_DECL(bool) HMIsVmxActive(PVM pVM) 396 { 397 return pVM->hm.s.vmx.fSupported && HMIsEnabled(pVM); 398 } 399 387 400 #endif /* !IN_RC */ 388 389 401 390 402 /** -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r73200 r73246 258 258 259 259 /* 260 * Shadow - Nested paging mode261 */ 262 # define PGM_SHW_TYPE PGM_TYPE_NESTED 263 # define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED (name)260 * Shadow - 32-bit nested paging mode. 261 */ 262 # define PGM_SHW_TYPE PGM_TYPE_NESTED_32BIT 263 # define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_32BIT(name) 264 264 # include "PGMAllShw.h" 265 265 … … 267 267 # define PGM_GST_TYPE PGM_TYPE_REAL 268 268 # define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 269 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ REAL(name)269 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_REAL(name) 270 270 # include "PGMGstDefs.h" 271 271 # include "PGMAllBth.h" … … 277 277 # define PGM_GST_TYPE PGM_TYPE_PROT 278 278 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 279 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ PROT(name)279 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_PROT(name) 280 280 # include "PGMGstDefs.h" 281 281 # include "PGMAllBth.h" … … 287 287 # define PGM_GST_TYPE PGM_TYPE_32BIT 288 288 # define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 289 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT (name)289 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_32BIT(name) 290 290 # include "PGMGstDefs.h" 291 291 # include "PGMAllBth.h" … … 297 297 # define PGM_GST_TYPE PGM_TYPE_PAE 298 298 # define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 299 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ PAE(name)299 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_PAE(name) 300 300 # include "PGMGstDefs.h" 301 301 # include "PGMAllBth.h" … … 308 308 # define PGM_GST_TYPE PGM_TYPE_AMD64 309 309 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 310 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ AMD64(name)310 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_AMD64(name) 311 311 # include "PGMGstDefs.h" 312 312 # include "PGMAllBth.h" … … 321 321 322 322 /* 323 * Shadow - EPT 323 * Shadow - PAE nested paging mode. 324 */ 325 # define PGM_SHW_TYPE PGM_TYPE_NESTED_PAE 326 # define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_PAE(name) 327 # include "PGMAllShw.h" 328 329 /* Guest - real mode */ 330 # define PGM_GST_TYPE PGM_TYPE_REAL 331 # define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 332 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_REAL(name) 333 # include "PGMGstDefs.h" 334 # include "PGMAllBth.h" 335 # undef PGM_BTH_NAME 336 # undef PGM_GST_TYPE 337 # undef PGM_GST_NAME 338 339 /* Guest - protected mode */ 340 # define PGM_GST_TYPE PGM_TYPE_PROT 341 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 342 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_PROT(name) 343 # include "PGMGstDefs.h" 344 # include "PGMAllBth.h" 345 # undef PGM_BTH_NAME 346 # undef PGM_GST_TYPE 347 # undef PGM_GST_NAME 348 349 /* Guest - 32-bit mode */ 350 # define PGM_GST_TYPE PGM_TYPE_32BIT 351 # define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 352 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_32BIT(name) 353 # include "PGMGstDefs.h" 354 # include "PGMAllBth.h" 355 # undef PGM_BTH_NAME 356 # undef PGM_GST_TYPE 357 # undef PGM_GST_NAME 358 359 /* Guest - PAE mode */ 360 # define PGM_GST_TYPE PGM_TYPE_PAE 361 # define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 362 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_PAE(name) 363 # include "PGMGstDefs.h" 364 # include "PGMAllBth.h" 365 # undef PGM_BTH_NAME 366 # undef PGM_GST_TYPE 367 # undef PGM_GST_NAME 368 369 # ifdef VBOX_WITH_64_BITS_GUESTS 370 /* Guest - AMD64 mode */ 371 # define PGM_GST_TYPE PGM_TYPE_AMD64 372 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 373 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_AMD64(name) 374 # include "PGMGstDefs.h" 375 # include "PGMAllBth.h" 376 # undef PGM_BTH_NAME 377 # undef PGM_GST_TYPE 378 # undef PGM_GST_NAME 379 # endif /* VBOX_WITH_64_BITS_GUESTS */ 380 381 # undef PGM_SHW_TYPE 382 # undef PGM_SHW_NAME 383 384 385 /* 386 * Shadow - AMD64 nested paging mode. 387 */ 388 # define PGM_SHW_TYPE PGM_TYPE_NESTED_AMD64 389 # define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_AMD64(name) 390 # include "PGMAllShw.h" 391 392 /* Guest - real mode */ 393 # define PGM_GST_TYPE PGM_TYPE_REAL 394 # define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 395 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_REAL(name) 396 # include "PGMGstDefs.h" 397 # include "PGMAllBth.h" 398 # undef PGM_BTH_NAME 399 # undef PGM_GST_TYPE 400 # undef PGM_GST_NAME 401 402 /* Guest - protected mode */ 403 # define PGM_GST_TYPE PGM_TYPE_PROT 404 # define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 405 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_PROT(name) 406 # include "PGMGstDefs.h" 407 # include "PGMAllBth.h" 408 # undef PGM_BTH_NAME 409 # undef PGM_GST_TYPE 410 # undef PGM_GST_NAME 411 412 /* Guest - 32-bit mode */ 413 # define PGM_GST_TYPE PGM_TYPE_32BIT 414 # define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 415 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_32BIT(name) 416 # include "PGMGstDefs.h" 417 # include "PGMAllBth.h" 418 # undef PGM_BTH_NAME 419 # undef PGM_GST_TYPE 420 # undef PGM_GST_NAME 421 422 /* Guest - PAE mode */ 423 # define PGM_GST_TYPE PGM_TYPE_PAE 424 # define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 425 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_PAE(name) 426 # include "PGMGstDefs.h" 427 # include "PGMAllBth.h" 428 # undef PGM_BTH_NAME 429 # undef PGM_GST_TYPE 430 # undef PGM_GST_NAME 431 432 # ifdef VBOX_WITH_64_BITS_GUESTS 433 /* Guest - AMD64 mode */ 434 # define PGM_GST_TYPE PGM_TYPE_AMD64 435 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 436 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_AMD64(name) 437 # include "PGMGstDefs.h" 438 # include "PGMAllBth.h" 439 # undef PGM_BTH_NAME 440 # undef PGM_GST_TYPE 441 # undef PGM_GST_NAME 442 # endif /* VBOX_WITH_64_BITS_GUESTS */ 443 444 # undef PGM_SHW_TYPE 445 # undef PGM_SHW_NAME 446 447 448 /* 449 * Shadow - EPT. 324 450 */ 325 451 # define PGM_SHW_TYPE PGM_TYPE_EPT … … 400 526 PGMMODEDATAGST const g_aPgmGuestModeData[PGM_GUEST_MODE_DATA_ARRAY_SIZE] = 401 527 { 402 /* NULL entry. */ 403 { UINT32_MAX, NULL, NULL, NULL, NULL, NULL }, 528 { UINT32_MAX, NULL, NULL, NULL, NULL, NULL }, /* 0 */ 404 529 { 405 530 PGM_TYPE_REAL, … … 472 597 473 598 599 /** The shadow mode data array. */ 600 PGMMODEDATASHW const g_aPgmShadowModeData[PGM_SHADOW_MODE_DATA_ARRAY_SIZE] = 601 { 602 { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* 0 */ 603 { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* PGM_TYPE_REAL */ 604 { UINT8_MAX, NULL, NULL, NULL, NULL, NULL }, /* PGM_TYPE_PROT */ 605 { 606 PGM_TYPE_32BIT, 607 PGM_SHW_NAME_32BIT(GetPage), 608 PGM_SHW_NAME_32BIT(ModifyPage), 609 #ifdef IN_RING3 610 PGM_SHW_NAME_32BIT(Enter), 611 PGM_SHW_NAME_32BIT(Exit), 612 PGM_SHW_NAME_32BIT(Relocate), 613 #else 614 NULL, NULL, NULL, 615 #endif 616 }, 617 { 618 PGM_TYPE_PAE, 619 PGM_SHW_NAME_PAE(GetPage), 620 PGM_SHW_NAME_PAE(ModifyPage), 621 #ifdef IN_RING3 622 PGM_SHW_NAME_PAE(Enter), 623 PGM_SHW_NAME_PAE(Exit), 624 PGM_SHW_NAME_PAE(Relocate), 625 #else 626 NULL, NULL, NULL, 627 #endif 628 }, 629 #ifndef IN_RC 630 { 631 PGM_TYPE_AMD64, 632 PGM_SHW_NAME_AMD64(GetPage), 633 PGM_SHW_NAME_AMD64(ModifyPage), 634 # ifdef IN_RING3 635 PGM_SHW_NAME_AMD64(Enter), 636 PGM_SHW_NAME_AMD64(Exit), 637 PGM_SHW_NAME_AMD64(Relocate), 638 # else 639 NULL, NULL, NULL, 640 # endif 641 }, 642 { 643 PGM_TYPE_NESTED_32BIT, 644 PGM_SHW_NAME_NESTED_32BIT(GetPage), 645 PGM_SHW_NAME_NESTED_32BIT(ModifyPage), 646 # ifdef IN_RING3 647 PGM_SHW_NAME_NESTED_32BIT(Enter), 648 PGM_SHW_NAME_NESTED_32BIT(Exit), 649 PGM_SHW_NAME_NESTED_32BIT(Relocate), 650 # else 651 NULL, NULL, NULL, 652 # endif 653 }, 654 { 655 PGM_TYPE_NESTED_PAE, 656 PGM_SHW_NAME_NESTED_PAE(GetPage), 657 PGM_SHW_NAME_NESTED_PAE(ModifyPage), 658 # ifdef IN_RING3 659 PGM_SHW_NAME_NESTED_PAE(Enter), 660 PGM_SHW_NAME_NESTED_PAE(Exit), 661 PGM_SHW_NAME_NESTED_PAE(Relocate), 662 # else 663 NULL, NULL, NULL, 664 # endif 665 }, 666 { 667 PGM_TYPE_NESTED_AMD64, 668 PGM_SHW_NAME_NESTED_AMD64(GetPage), 669 PGM_SHW_NAME_NESTED_AMD64(ModifyPage), 670 # ifdef IN_RING3 671 PGM_SHW_NAME_NESTED_AMD64(Enter), 672 PGM_SHW_NAME_NESTED_AMD64(Exit), 673 PGM_SHW_NAME_NESTED_AMD64(Relocate), 674 # else 675 NULL, NULL, NULL, 676 # endif 677 }, 678 { 679 PGM_TYPE_EPT, 680 PGM_SHW_NAME_EPT(GetPage), 681 PGM_SHW_NAME_EPT(ModifyPage), 682 # ifdef IN_RING3 683 PGM_SHW_NAME_EPT(Enter), 684 PGM_SHW_NAME_EPT(Exit), 685 PGM_SHW_NAME_EPT(Relocate), 686 # else 687 NULL, NULL, NULL, 688 # endif 689 }, 690 #endif /* IN_RC */ 691 }; 692 693 474 694 #ifndef IN_RING3 475 695 /** … … 912 1132 VMMDECL(int) PGMShwGetPage(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys) 913 1133 { 914 pgmLock(pVCpu->CTX_SUFF(pVM)); 915 int rc = PGM_SHW_PFN(GetPage, pVCpu)(pVCpu, GCPtr, pfFlags, pHCPhys); 916 pgmUnlock(pVCpu->CTX_SUFF(pVM)); 1134 PVM pVM = pVCpu->CTX_SUFF(pVM); 1135 pgmLock(pVM); 1136 1137 uintptr_t idxShw = pVCpu->pgm.s.idxShadowModeData; 1138 AssertReturn(idxShw < RT_ELEMENTS(g_aPgmShadowModeData), VERR_PGM_MODE_IPE); 1139 AssertReturn(g_aPgmShadowModeData[idxShw].pfnGetPage, VERR_PGM_MODE_IPE); 1140 int rc = g_aPgmShadowModeData[idxShw].pfnGetPage(pVCpu, GCPtr, pfFlags, pHCPhys); 1141 1142 pgmUnlock(pVM); 917 1143 return rc; 918 1144 } … … 942 1168 PVM pVM = pVCpu->CTX_SUFF(pVM); 943 1169 pgmLock(pVM); 944 int rc = PGM_SHW_PFN(ModifyPage, pVCpu)(pVCpu, GCPtr, PAGE_SIZE, fFlags, fMask, fOpFlags); 1170 1171 uintptr_t idxShw = pVCpu->pgm.s.idxShadowModeData; 1172 AssertReturn(idxShw < RT_ELEMENTS(g_aPgmShadowModeData), VERR_PGM_MODE_IPE); 1173 AssertReturn(g_aPgmShadowModeData[idxShw].pfnModifyPage, VERR_PGM_MODE_IPE); 1174 int rc = g_aPgmShadowModeData[idxShw].pfnModifyPage(pVCpu, GCPtr, PAGE_SIZE, fFlags, fMask, fOpFlags); 1175 945 1176 pgmUnlock(pVM); 946 1177 return rc; … … 1544 1775 case PGMMODE_AMD64_NX: 1545 1776 #endif 1546 case PGMMODE_NESTED: 1777 case PGMMODE_NESTED_32BIT: 1778 case PGMMODE_NESTED_PAE: 1779 case PGMMODE_NESTED_AMD64: 1547 1780 case PGMMODE_EPT: 1548 1781 default: … … 2084 2317 return pVM->pgm.s.HCPhysInterPaePML4; 2085 2318 2319 case PGMMODE_NESTED_32BIT: 2320 case PGMMODE_NESTED_PAE: 2321 case PGMMODE_NESTED_AMD64: 2086 2322 case PGMMODE_EPT: 2087 case PGMMODE_NESTED:2088 2323 return 0; /* not relevant */ 2089 2324 … … 2611 2846 switch (enmMode) 2612 2847 { 2613 case PGMMODE_REAL: return "Real"; 2614 case PGMMODE_PROTECTED: return "Protected"; 2615 case PGMMODE_32_BIT: return "32-bit"; 2616 case PGMMODE_PAE: return "PAE"; 2617 case PGMMODE_PAE_NX: return "PAE+NX"; 2618 case PGMMODE_AMD64: return "AMD64"; 2619 case PGMMODE_AMD64_NX: return "AMD64+NX"; 2620 case PGMMODE_NESTED: return "Nested"; 2621 case PGMMODE_EPT: return "EPT"; 2622 default: return "unknown mode value"; 2848 case PGMMODE_REAL: return "Real"; 2849 case PGMMODE_PROTECTED: return "Protected"; 2850 case PGMMODE_32_BIT: return "32-bit"; 2851 case PGMMODE_PAE: return "PAE"; 2852 case PGMMODE_PAE_NX: return "PAE+NX"; 2853 case PGMMODE_AMD64: return "AMD64"; 2854 case PGMMODE_AMD64_NX: return "AMD64+NX"; 2855 case PGMMODE_NESTED_32BIT: return "Nested-32"; 2856 case PGMMODE_NESTED_PAE: return "Nested-PAE"; 2857 case PGMMODE_NESTED_AMD64: return "Nested-AMD64"; 2858 case PGMMODE_EPT: return "EPT"; 2859 default: return "unknown mode value"; 2623 2860 } 2624 2861 } … … 3046 3283 3047 3284 #endif /* VBOX_STRICT */ 3285 -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r70977 r73246 3 3 * VBox - Page Manager, Shadow+Guest Paging Template - All context code. 4 4 * 5 * @remarks The nested page tables on AMD makes use of PGM_SHW_TYPE in6 * {PGM_TYPE_AMD64, PGM_TYPE_PAE and PGM_TYPE_32BIT} and PGM_GST_TYPE7 * set to PGM_TYPE_PROT. Half of the code in this file is not8 * exercised with PGM_SHW_TYPE set to PGM_TYPE_NESTED.9 *10 5 * @remarks Extended page tables (intel) are built with PGM_GST_TYPE set to 11 6 * PGM_TYPE_PROT (and PGM_SHW_TYPE set to PGM_TYPE_EPT). 7 * bird: WTF does this mean these days? Looking at PGMAll.cpp it's 12 8 * 13 9 * @remarks This file is one big \#ifdef-orgy! … … 62 58 * remove redundant checks inside functions. 63 59 */ 64 #if PGM_GST_TYPE == PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT60 #if PGM_GST_TYPE == PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_PAE && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 65 61 # error "Invalid combination; PAE guest implies PAE shadow" 66 62 #endif 67 63 68 64 #if (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \ 69 && !(PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT)65 && !(PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE)) 70 66 # error "Invalid combination; real or protected mode without paging implies 32 bits or PAE shadow paging." 71 67 #endif 72 68 73 69 #if (PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE) \ 74 && !(PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT)70 && !(PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE)) 75 71 # error "Invalid combination; 32 bits guest paging or PAE implies 32 bits or PAE shadow paging." 76 72 #endif 77 73 78 #if (PGM_GST_TYPE == PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT) \74 #if (PGM_GST_TYPE == PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_AMD64 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE)) \ 79 75 || (PGM_SHW_TYPE == PGM_TYPE_AMD64 && PGM_GST_TYPE != PGM_TYPE_AMD64 && PGM_GST_TYPE != PGM_TYPE_PROT) 80 76 # error "Invalid combination; AMD64 guest implies AMD64 shadow and vice versa" … … 138 134 139 135 136 #if !PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) 140 137 /** 141 138 * Deal with a guest page fault. … … 437 434 return rcStrict; 438 435 } /* if any kind of handler */ 436 # endif /* !PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) */ 439 437 440 438 … … 458 456 # if ( PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT \ 459 457 || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64) \ 460 && PGM_SHW_TYPE != PGM_TYPE_NESTED\458 && !PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) \ 461 459 && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT) 462 460 int rc; … … 1213 1211 { 1214 1212 #if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) \ 1215 && PGM_SHW_TYPE != PGM_TYPE_NESTED \ 1216 && PGM_SHW_TYPE != PGM_TYPE_EPT 1213 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 1217 1214 int rc; 1218 1215 PVM pVM = pVCpu->CTX_SUFF(pVM); … … 1936 1933 PGM_LOCK_ASSERT_OWNER(pVM); 1937 1934 1938 #if ( PGM_GST_TYPE == PGM_TYPE_32BIT 1939 || PGM_GST_TYPE == PGM_TYPE_PAE 1935 #if ( PGM_GST_TYPE == PGM_TYPE_32BIT \ 1936 || PGM_GST_TYPE == PGM_TYPE_PAE \ 1940 1937 || PGM_GST_TYPE == PGM_TYPE_AMD64) \ 1941 && PGM_SHW_TYPE != PGM_TYPE_NESTED \ 1942 && PGM_SHW_TYPE != PGM_TYPE_EPT 1938 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 1943 1939 1944 1940 /* … … 2276 2272 2277 2273 #elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \ 2278 && PGM_SHW_TYPE != PGM_TYPE_NESTED\2274 && !PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) \ 2279 2275 && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT) \ 2280 2276 && !defined(IN_RC) … … 2687 2683 || PGM_GST_TYPE == PGM_TYPE_PAE \ 2688 2684 || PGM_GST_TYPE == PGM_TYPE_AMD64) \ 2689 && PGM_SHW_TYPE != PGM_TYPE_NESTED \ 2690 && PGM_SHW_TYPE != PGM_TYPE_EPT 2691 2685 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 2692 2686 int rc = VINF_SUCCESS; 2693 2687 … … 3151 3145 3152 3146 #elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \ 3153 && PGM_SHW_TYPE != PGM_TYPE_NESTED\3147 && !PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) \ 3154 3148 && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT) \ 3155 3149 && !defined(IN_RC) … … 3391 3385 || PGM_GST_TYPE == PGM_TYPE_PAE \ 3392 3386 || PGM_GST_TYPE == PGM_TYPE_AMD64 ) \ 3393 && PGM_SHW_TYPE != PGM_TYPE_NESTED \ 3394 && PGM_SHW_TYPE != PGM_TYPE_EPT 3395 3387 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3396 3388 /* 3397 3389 * Check that all Guest levels thru the PDE are present, getting the … … 3506 3498 return rc; 3507 3499 3508 #elif PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT3500 #elif PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3509 3501 NOREF(pVCpu); NOREF(GCPtrPage); 3510 3502 return VINF_SUCCESS; /* ignore */ … … 3541 3533 || PGM_GST_TYPE == PGM_TYPE_PAE \ 3542 3534 || PGM_GST_TYPE == PGM_TYPE_AMD64 ) \ 3543 && PGM_SHW_TYPE != PGM_TYPE_NESTED \ 3544 && PGM_SHW_TYPE != PGM_TYPE_EPT 3535 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3545 3536 3546 3537 # ifdef VBOX_WITH_RAW_MODE_NOT_R0 … … 3700 3691 return rc; 3701 3692 3702 #else /* PGM_ SHW_TYPE == PGM_TYPE_EPT || PGM_SHW_TYPE == PGM_TYPE_NESTED*/3693 #else /* PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) */ 3703 3694 3704 3695 AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_GST_TYPE, PGM_SHW_TYPE)); 3705 3696 return VERR_PGM_NOT_USED_IN_MODE; 3706 #endif /* PGM_ SHW_TYPE == PGM_TYPE_EPT || PGM_SHW_TYPE == PGM_TYPE_NESTED*/3697 #endif /* PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) */ 3707 3698 } 3708 3699 … … 3729 3720 LogFlow(("SyncCR3 FF=%d fGlobal=%d\n", !!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3), fGlobal)); 3730 3721 3731 #if PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT3722 #if !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3732 3723 3733 3724 pgmLock(pVM); … … 3754 3745 #endif /* !NESTED && !EPT */ 3755 3746 3756 #if PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT3747 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3757 3748 /* 3758 3749 * Nested / EPT - almost no work. … … 3769 3760 return VINF_SUCCESS; 3770 3761 3771 #else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT&& PGM_SHW_TYPE != PGM_TYPE_AMD64 */3762 #else /* !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) && PGM_SHW_TYPE != PGM_TYPE_AMD64 */ 3772 3763 3773 3764 # ifndef PGM_WITHOUT_MAPPINGS … … 3796 3787 # endif 3797 3788 return VINF_SUCCESS; 3798 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT&& PGM_SHW_TYPE != PGM_TYPE_AMD64 */3789 #endif /* !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) && PGM_SHW_TYPE != PGM_TYPE_AMD64 */ 3799 3790 } 3800 3791 … … 3821 3812 { 3822 3813 NOREF(pVCpu); NOREF(cr3); NOREF(cr4); NOREF(GCPtr); NOREF(cb); 3823 #if PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT3814 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 3824 3815 return 0; 3825 3816 #else … … 4563 4554 # endif /* GST is in {32BIT, PAE, AMD64} */ 4564 4555 return cErrors; 4565 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT*/4556 #endif /* !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) */ 4566 4557 } 4567 4558 #endif /* VBOX_STRICT */ … … 4893 4884 return rc; 4894 4885 } 4886 -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r69474 r73246 53 53 #undef SHW_PDPE_PG_MASK 54 54 55 #if PGM_SHW_TYPE == PGM_TYPE_32BIT 55 #if PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT 56 56 # define SHWPT X86PT 57 57 # define PSHWPT PX86PT … … 151 151 # define SHW_PT_MASK X86_PT_PAE_MASK 152 152 153 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 153 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_NESTED_AMD64 154 154 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 155 155 # define SHW_PDPT_MASK X86_PDPT_MASK_AMD64 … … 157 157 # define SHW_TOTAL_PD_ENTRIES (X86_PG_AMD64_ENTRIES * X86_PG_AMD64_PDPE_ENTRIES) 158 158 159 # el se /* 32 bits PAE mode */159 # elif PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_SHW_TYPE == PGM_TYPE_NESTED_PAE 160 160 # define SHW_PDPT_SHIFT X86_PDPT_SHIFT 161 161 # define SHW_PDPT_MASK X86_PDPT_MASK_PAE … … 163 163 # define SHW_TOTAL_PD_ENTRIES (X86_PG_PAE_ENTRIES * X86_PG_PAE_PDPE_ENTRIES) 164 164 165 # else 166 # error "Misconfigured PGM_SHW_TYPE or something..." 165 167 # endif 166 168 #endif … … 174 176 PGM_SHW_DECL(int, GetPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys); 175 177 PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags); 178 #ifdef IN_RING3 /* for now */ 179 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode); 180 PGM_SHW_DECL(int, Exit)(PVMCPU pVCpu); 181 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); 182 #endif 176 183 RT_C_DECLS_END 177 184 … … 191 198 PGM_SHW_DECL(int, GetPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys) 192 199 { 193 #if PGM_SHW_TYPE == PGM_TYPE_NESTED194 NOREF(pVCpu); NOREF(GCPtr); NOREF(pfFlags); NOREF(pHCPhys);195 return VERR_PAGE_TABLE_NOT_PRESENT;196 197 #else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */198 200 PVM pVM = pVCpu->CTX_SUFF(pVM); 199 201 … … 203 205 * Get the PDE. 204 206 */ 205 # if PGM_SHW_TYPE == PGM_TYPE_AMD64207 #if PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_NESTED_AMD64 206 208 X86PDEPAE Pde; 207 209 … … 235 237 Pde.n.u1NoExecute |= Pml4e.n.u1NoExecute | Pdpe.lm.u1NoExecute; 236 238 237 # elif PGM_SHW_TYPE == PGM_TYPE_PAE239 #elif PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_SHW_TYPE == PGM_TYPE_NESTED_PAE 238 240 X86PDEPAE Pde = pgmShwGetPaePDE(pVCpu, GCPtr); 239 241 240 # 242 #elif PGM_SHW_TYPE == PGM_TYPE_EPT 241 243 const unsigned iPd = ((GCPtr >> SHW_PD_SHIFT) & SHW_PD_MASK); 242 244 PEPTPD pPDDst; … … 252 254 Pde = pPDDst->a[iPd]; 253 255 254 # else /* PGM_TYPE_32BIT */256 #elif PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT 255 257 X86PDE Pde = pgmShwGet32BitPDE(pVCpu, GCPtr); 256 # endif 258 #else 259 # error "Misconfigured PGM_SHW_TYPE or something..." 260 #endif 257 261 if (!Pde.n.u1Present) 258 262 return VERR_PAGE_TABLE_NOT_PRESENT; 259 263 260 /* *Deal with large pages. */264 /* Deal with large pages. */ 261 265 if (Pde.b.u1Size) 262 266 { … … 269 273 { 270 274 *pfFlags = (Pde.u & ~SHW_PDE_PG_MASK); 271 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) /** @todo why do we have to check the guest state here? */ 272 if ((Pde.u & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu)) 275 #if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) || PGM_SHW_TYPE == PGM_TYPE_NESTED_PAE || PGM_SHW_TYPE == PGM_TYPE_NESTED_AMD64 276 if ( (Pde.u & X86_PTE_PAE_NX) 277 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) 278 && CPUMIsGuestNXEnabled(pVCpu) /** @todo why do we have to check the guest state here? */ 279 # endif 280 ) 273 281 *pfFlags |= X86_PTE_PAE_NX; 274 # 282 #endif 275 283 } 276 284 … … 293 301 else /* mapping: */ 294 302 { 295 # ifPGM_SHW_TYPE == PGM_TYPE_AMD64 \296 297 303 #if PGM_SHW_TYPE == PGM_TYPE_AMD64 \ 304 || PGM_SHW_TYPE == PGM_TYPE_EPT \ 305 || defined(PGM_WITHOUT_MAPPINGS) 298 306 AssertFailed(); /* can't happen */ 299 307 pPT = NULL; /* shut up MSC */ 300 # 308 #else 301 309 Assert(pgmMapAreMappingsEnabled(pVM)); 302 310 303 311 PPGMMAPPING pMap = pgmGetMapping(pVM, (RTGCPTR)GCPtr); 304 312 AssertMsgReturn(pMap, ("GCPtr=%RGv\n", GCPtr), VERR_PGM_MAPPING_IPE); 305 # if PGM_SHW_TYPE == PGM_TYPE_32BIT313 # if PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT 306 314 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTX_SUFF(pPT); 307 # 315 # else /* PAE */ 308 316 pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTX_SUFF(paPaePTs); 309 # endif310 317 # endif 318 #endif 311 319 } 312 320 const unsigned iPt = (GCPtr >> SHW_PT_SHIFT) & SHW_PT_MASK; … … 324 332 *pfFlags = (SHW_PTE_GET_U(Pte) & ~SHW_PTE_PG_MASK) 325 333 & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US)); 326 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) /** @todo why do we have to check the guest state here? */ 334 335 #if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) || PGM_SHW_TYPE == PGM_TYPE_NESTED_PAE || PGM_SHW_TYPE == PGM_TYPE_NESTED_AMD64 327 336 /* The NX bit is determined by a bitwise OR between the PT and PD */ 328 if (((SHW_PTE_GET_U(Pte) | Pde.u) & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu)) 337 if ( ((SHW_PTE_GET_U(Pte) | Pde.u) & X86_PTE_PAE_NX) 338 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) 339 && CPUMIsGuestNXEnabled(pVCpu) /** @todo why do we have to check the guest state here? */ 340 # endif 341 ) 329 342 *pfFlags |= X86_PTE_PAE_NX; 330 # 343 #endif 331 344 } 332 345 … … 335 348 336 349 return VINF_SUCCESS; 337 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */338 350 } 339 351 … … 356 368 PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags) 357 369 { 358 # if PGM_SHW_TYPE == PGM_TYPE_NESTED359 NOREF(pVCpu); NOREF(GCPtr); NOREF(cb); NOREF(fFlags); NOREF(fMask); NOREF(fOpFlags);360 return VERR_PAGE_TABLE_NOT_PRESENT;361 362 # else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */363 370 PVM pVM = pVCpu->CTX_SUFF(pVM); 364 371 int rc; … … 374 381 * Get the PDE. 375 382 */ 376 # if PGM_SHW_TYPE == PGM_TYPE_AMD64383 #if PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_NESTED_AMD64 377 384 X86PDEPAE Pde; 378 385 /* PML4 */ … … 399 406 Pde = pPd->a[iPd]; 400 407 401 # elif PGM_SHW_TYPE == PGM_TYPE_PAE408 #elif PGM_SHW_TYPE == PGM_TYPE_PAE || PGM_SHW_TYPE == PGM_TYPE_NESTED_PAE 402 409 X86PDEPAE Pde = pgmShwGetPaePDE(pVCpu, GCPtr); 403 410 404 # 411 #elif PGM_SHW_TYPE == PGM_TYPE_EPT 405 412 const unsigned iPd = ((GCPtr >> SHW_PD_SHIFT) & SHW_PD_MASK); 406 413 PEPTPD pPDDst; … … 416 423 Pde = pPDDst->a[iPd]; 417 424 418 # else /* PGM_TYPE_32BIT */425 #else /* PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT */ 419 426 X86PDE Pde = pgmShwGet32BitPDE(pVCpu, GCPtr); 420 # 427 #endif 421 428 if (!Pde.n.u1Present) 422 429 return VERR_PAGE_TABLE_NOT_PRESENT; … … 474 481 475 482 SHW_PTE_ATOMIC_SET2(pPT->a[iPTE], NewPte); 476 # 483 #if PGM_SHW_TYPE == PGM_TYPE_EPT 477 484 HMInvalidatePhysPage(pVM, (RTGCPHYS)GCPtr); 478 # 485 #else 479 486 PGM_INVL_PG_ALL_VCPU(pVM, GCPtr); 480 # 487 #endif 481 488 } 482 489 … … 489 496 } 490 497 } 491 # endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */492 498 } 493 499 -
trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp
r70948 r73246 544 544 case PGMMODE_AMD64_NX: 545 545 return DBGFPGDMP_FLAGS_PSE | DBGFPGDMP_FLAGS_PAE | DBGFPGDMP_FLAGS_LME | DBGFPGDMP_FLAGS_NXE; 546 case PGMMODE_NESTED: 547 return DBGFPGDMP_FLAGS_NP; 546 case PGMMODE_NESTED_32BIT: 547 return DBGFPGDMP_FLAGS_NP; /** @todo fix nested paging dumping*/ 548 case PGMMODE_NESTED_PAE: 549 return DBGFPGDMP_FLAGS_NP; /** @todo fix nested paging dumping*/ 550 case PGMMODE_NESTED_AMD64: 551 return DBGFPGDMP_FLAGS_NP; /** @todo fix nested paging dumping*/ 548 552 case PGMMODE_EPT: 549 553 return DBGFPGDMP_FLAGS_EPT; -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r73199 r73246 983 983 984 984 /* 985 * Shadow - Nested paging mode986 */ 987 #define PGM_SHW_TYPE PGM_TYPE_NESTED 988 #define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED (name)989 #define PGM_SHW_NAME_RC_STR(name) PGM_SHW_NAME_RC_NESTED_ STR(name)990 #define PGM_SHW_NAME_R0_STR(name) PGM_SHW_NAME_R0_NESTED_ STR(name)985 * Shadow - 32-bit nested paging mode 986 */ 987 #define PGM_SHW_TYPE PGM_TYPE_NESTED_32BIT 988 #define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_32BIT(name) 989 #define PGM_SHW_NAME_RC_STR(name) PGM_SHW_NAME_RC_NESTED_32BIT_STR(name) 990 #define PGM_SHW_NAME_R0_STR(name) PGM_SHW_NAME_R0_NESTED_32BIT_STR(name) 991 991 #include "PGMShw.h" 992 992 … … 996 996 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_REAL_STR(name) 997 997 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_REAL_STR(name) 998 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ REAL(name)999 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_ REAL_STR(name)1000 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_ REAL_STR(name)998 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_REAL(name) 999 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_REAL_STR(name) 1000 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_REAL_STR(name) 1001 1001 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1002 1002 #include "PGMGstDefs.h" … … 1016 1016 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PROT_STR(name) 1017 1017 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PROT_STR(name) 1018 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ PROT(name)1019 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_ PROT_STR(name)1020 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_ PROT_STR(name)1018 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_PROT(name) 1019 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_PROT_STR(name) 1020 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_PROT_STR(name) 1021 1021 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1022 1022 #include "PGMGstDefs.h" … … 1036 1036 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_32BIT_STR(name) 1037 1037 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_32BIT_STR(name) 1038 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT (name)1039 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_ STR(name)1040 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_ STR(name)1038 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_32BIT(name) 1039 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_32BIT_STR(name) 1040 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_32BIT_STR(name) 1041 1041 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_32BIT_PT 1042 1042 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB … … 1058 1058 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PAE_STR(name) 1059 1059 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PAE_STR(name) 1060 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_ PAE(name)1061 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_ PAE_STR(name)1062 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_ PAE_STR(name)1060 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_PAE(name) 1061 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_PAE_STR(name) 1062 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_PAE_STR(name) 1063 1063 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1064 1064 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB … … 1081 1081 # define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_AMD64_STR(name) 1082 1082 # define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_AMD64_STR(name) 1083 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64(name) 1084 # define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_STR(name) 1085 # define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_STR(name) 1083 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_32BIT_AMD64(name) 1084 # define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_32BIT_AMD64_STR(name) 1085 # define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_32BIT_AMD64_STR(name) 1086 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1087 # define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 1088 # include "PGMGstDefs.h" 1089 # include "PGMBth.h" 1090 # undef BTH_PGMPOOLKIND_PT_FOR_BIG 1091 # undef BTH_PGMPOOLKIND_PT_FOR_PT 1092 # undef PGM_BTH_NAME 1093 # undef PGM_BTH_NAME_RC_STR 1094 # undef PGM_BTH_NAME_R0_STR 1095 # undef PGM_GST_TYPE 1096 # undef PGM_GST_NAME 1097 # undef PGM_GST_NAME_RC_STR 1098 # undef PGM_GST_NAME_R0_STR 1099 #endif /* VBOX_WITH_64_BITS_GUESTS */ 1100 1101 #undef PGM_SHW_TYPE 1102 #undef PGM_SHW_NAME 1103 #undef PGM_SHW_NAME_RC_STR 1104 #undef PGM_SHW_NAME_R0_STR 1105 1106 1107 /* 1108 * Shadow - PAE nested paging mode 1109 */ 1110 #define PGM_SHW_TYPE PGM_TYPE_NESTED_PAE 1111 #define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_PAE(name) 1112 #define PGM_SHW_NAME_RC_STR(name) PGM_SHW_NAME_RC_NESTED_PAE_STR(name) 1113 #define PGM_SHW_NAME_R0_STR(name) PGM_SHW_NAME_R0_NESTED_PAE_STR(name) 1114 #include "PGMShw.h" 1115 1116 /* Guest - real mode */ 1117 #define PGM_GST_TYPE PGM_TYPE_REAL 1118 #define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 1119 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_REAL_STR(name) 1120 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_REAL_STR(name) 1121 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_REAL(name) 1122 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_PAE_REAL_STR(name) 1123 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_PAE_REAL_STR(name) 1124 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1125 #include "PGMGstDefs.h" 1126 #include "PGMBth.h" 1127 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1128 #undef PGM_BTH_NAME 1129 #undef PGM_BTH_NAME_RC_STR 1130 #undef PGM_BTH_NAME_R0_STR 1131 #undef PGM_GST_TYPE 1132 #undef PGM_GST_NAME 1133 #undef PGM_GST_NAME_RC_STR 1134 #undef PGM_GST_NAME_R0_STR 1135 1136 /* Guest - protected mode */ 1137 #define PGM_GST_TYPE PGM_TYPE_PROT 1138 #define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 1139 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PROT_STR(name) 1140 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PROT_STR(name) 1141 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_PROT(name) 1142 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_PAE_PROT_STR(name) 1143 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_PAE_PROT_STR(name) 1144 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1145 #include "PGMGstDefs.h" 1146 #include "PGMBth.h" 1147 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1148 #undef PGM_BTH_NAME 1149 #undef PGM_BTH_NAME_RC_STR 1150 #undef PGM_BTH_NAME_R0_STR 1151 #undef PGM_GST_TYPE 1152 #undef PGM_GST_NAME 1153 #undef PGM_GST_NAME_RC_STR 1154 #undef PGM_GST_NAME_R0_STR 1155 1156 /* Guest - 32-bit mode */ 1157 #define PGM_GST_TYPE PGM_TYPE_32BIT 1158 #define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 1159 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_32BIT_STR(name) 1160 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_32BIT_STR(name) 1161 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_32BIT(name) 1162 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_PAE_32BIT_STR(name) 1163 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_PAE_32BIT_STR(name) 1164 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_32BIT_PT 1165 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB 1166 #include "PGMGstDefs.h" 1167 #include "PGMBth.h" 1168 #undef BTH_PGMPOOLKIND_PT_FOR_BIG 1169 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1170 #undef PGM_BTH_NAME 1171 #undef PGM_BTH_NAME_RC_STR 1172 #undef PGM_BTH_NAME_R0_STR 1173 #undef PGM_GST_TYPE 1174 #undef PGM_GST_NAME 1175 #undef PGM_GST_NAME_RC_STR 1176 #undef PGM_GST_NAME_R0_STR 1177 1178 /* Guest - PAE mode */ 1179 #define PGM_GST_TYPE PGM_TYPE_PAE 1180 #define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 1181 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PAE_STR(name) 1182 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PAE_STR(name) 1183 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_PAE(name) 1184 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_PAE_PAE_STR(name) 1185 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_PAE_PAE_STR(name) 1186 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1187 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 1188 #include "PGMGstDefs.h" 1189 #include "PGMBth.h" 1190 #undef BTH_PGMPOOLKIND_PT_FOR_BIG 1191 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1192 #undef PGM_BTH_NAME 1193 #undef PGM_BTH_NAME_RC_STR 1194 #undef PGM_BTH_NAME_R0_STR 1195 #undef PGM_GST_TYPE 1196 #undef PGM_GST_NAME 1197 #undef PGM_GST_NAME_RC_STR 1198 #undef PGM_GST_NAME_R0_STR 1199 1200 #ifdef VBOX_WITH_64_BITS_GUESTS 1201 /* Guest - AMD64 mode */ 1202 # define PGM_GST_TYPE PGM_TYPE_AMD64 1203 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 1204 # define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_AMD64_STR(name) 1205 # define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_AMD64_STR(name) 1206 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_PAE_AMD64(name) 1207 # define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_PAE_AMD64_STR(name) 1208 # define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_PAE_AMD64_STR(name) 1209 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1210 # define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 1211 # include "PGMGstDefs.h" 1212 # include "PGMBth.h" 1213 # undef BTH_PGMPOOLKIND_PT_FOR_BIG 1214 # undef BTH_PGMPOOLKIND_PT_FOR_PT 1215 # undef PGM_BTH_NAME 1216 # undef PGM_BTH_NAME_RC_STR 1217 # undef PGM_BTH_NAME_R0_STR 1218 # undef PGM_GST_TYPE 1219 # undef PGM_GST_NAME 1220 # undef PGM_GST_NAME_RC_STR 1221 # undef PGM_GST_NAME_R0_STR 1222 #endif /* VBOX_WITH_64_BITS_GUESTS */ 1223 1224 #undef PGM_SHW_TYPE 1225 #undef PGM_SHW_NAME 1226 #undef PGM_SHW_NAME_RC_STR 1227 #undef PGM_SHW_NAME_R0_STR 1228 1229 1230 /* 1231 * Shadow - AMD64 nested paging mode 1232 */ 1233 #define PGM_SHW_TYPE PGM_TYPE_NESTED_AMD64 1234 #define PGM_SHW_NAME(name) PGM_SHW_NAME_NESTED_AMD64(name) 1235 #define PGM_SHW_NAME_RC_STR(name) PGM_SHW_NAME_RC_NESTED_AMD64_STR(name) 1236 #define PGM_SHW_NAME_R0_STR(name) PGM_SHW_NAME_R0_NESTED_AMD64_STR(name) 1237 #include "PGMShw.h" 1238 1239 /* Guest - real mode */ 1240 #define PGM_GST_TYPE PGM_TYPE_REAL 1241 #define PGM_GST_NAME(name) PGM_GST_NAME_REAL(name) 1242 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_REAL_STR(name) 1243 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_REAL_STR(name) 1244 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_REAL(name) 1245 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_REAL_STR(name) 1246 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_REAL_STR(name) 1247 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1248 #include "PGMGstDefs.h" 1249 #include "PGMBth.h" 1250 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1251 #undef PGM_BTH_NAME 1252 #undef PGM_BTH_NAME_RC_STR 1253 #undef PGM_BTH_NAME_R0_STR 1254 #undef PGM_GST_TYPE 1255 #undef PGM_GST_NAME 1256 #undef PGM_GST_NAME_RC_STR 1257 #undef PGM_GST_NAME_R0_STR 1258 1259 /* Guest - protected mode */ 1260 #define PGM_GST_TYPE PGM_TYPE_PROT 1261 #define PGM_GST_NAME(name) PGM_GST_NAME_PROT(name) 1262 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PROT_STR(name) 1263 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PROT_STR(name) 1264 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_PROT(name) 1265 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_PROT_STR(name) 1266 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_PROT_STR(name) 1267 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PHYS 1268 #include "PGMGstDefs.h" 1269 #include "PGMBth.h" 1270 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1271 #undef PGM_BTH_NAME 1272 #undef PGM_BTH_NAME_RC_STR 1273 #undef PGM_BTH_NAME_R0_STR 1274 #undef PGM_GST_TYPE 1275 #undef PGM_GST_NAME 1276 #undef PGM_GST_NAME_RC_STR 1277 #undef PGM_GST_NAME_R0_STR 1278 1279 /* Guest - 32-bit mode */ 1280 #define PGM_GST_TYPE PGM_TYPE_32BIT 1281 #define PGM_GST_NAME(name) PGM_GST_NAME_32BIT(name) 1282 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_32BIT_STR(name) 1283 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_32BIT_STR(name) 1284 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_32BIT(name) 1285 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_32BIT_STR(name) 1286 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_32BIT_STR(name) 1287 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_32BIT_PT 1288 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB 1289 #include "PGMGstDefs.h" 1290 #include "PGMBth.h" 1291 #undef BTH_PGMPOOLKIND_PT_FOR_BIG 1292 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1293 #undef PGM_BTH_NAME 1294 #undef PGM_BTH_NAME_RC_STR 1295 #undef PGM_BTH_NAME_R0_STR 1296 #undef PGM_GST_TYPE 1297 #undef PGM_GST_NAME 1298 #undef PGM_GST_NAME_RC_STR 1299 #undef PGM_GST_NAME_R0_STR 1300 1301 /* Guest - PAE mode */ 1302 #define PGM_GST_TYPE PGM_TYPE_PAE 1303 #define PGM_GST_NAME(name) PGM_GST_NAME_PAE(name) 1304 #define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_PAE_STR(name) 1305 #define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_PAE_STR(name) 1306 #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_PAE(name) 1307 #define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_PAE_STR(name) 1308 #define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_PAE_STR(name) 1309 #define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1310 #define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB 1311 #include "PGMGstDefs.h" 1312 #include "PGMBth.h" 1313 #undef BTH_PGMPOOLKIND_PT_FOR_BIG 1314 #undef BTH_PGMPOOLKIND_PT_FOR_PT 1315 #undef PGM_BTH_NAME 1316 #undef PGM_BTH_NAME_RC_STR 1317 #undef PGM_BTH_NAME_R0_STR 1318 #undef PGM_GST_TYPE 1319 #undef PGM_GST_NAME 1320 #undef PGM_GST_NAME_RC_STR 1321 #undef PGM_GST_NAME_R0_STR 1322 1323 #ifdef VBOX_WITH_64_BITS_GUESTS 1324 /* Guest - AMD64 mode */ 1325 # define PGM_GST_TYPE PGM_TYPE_AMD64 1326 # define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name) 1327 # define PGM_GST_NAME_RC_STR(name) PGM_GST_NAME_RC_AMD64_STR(name) 1328 # define PGM_GST_NAME_R0_STR(name) PGM_GST_NAME_R0_AMD64_STR(name) 1329 # define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64_AMD64(name) 1330 # define PGM_BTH_NAME_RC_STR(name) PGM_BTH_NAME_RC_NESTED_AMD64_AMD64_STR(name) 1331 # define PGM_BTH_NAME_R0_STR(name) PGM_BTH_NAME_R0_NESTED_AMD64_AMD64_STR(name) 1086 1332 # define BTH_PGMPOOLKIND_PT_FOR_PT PGMPOOLKIND_PAE_PT_FOR_PAE_PT 1087 1333 # define BTH_PGMPOOLKIND_PT_FOR_BIG PGMPOOLKIND_PAE_PT_FOR_PAE_2MB … … 2355 2601 pgmR3ModeDataSwitch(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode); 2356 2602 2357 PGM_SHW_PFN(Relocate, pVCpu)(pVCpu, offDelta); 2603 uintptr_t idxShw = pVCpu->pgm.s.idxShadowModeData; 2604 if ( idxShw < RT_ELEMENTS(g_aPgmShadowModeData) 2605 && g_aPgmShadowModeData[idxShw].pfnRelocate) 2606 g_aPgmShadowModeData[idxShw].pfnRelocate(pVCpu, offDelta); 2358 2607 2359 2608 uintptr_t const idxGst = pVCpu->pgm.s.idxGuestModeData; … … 2994 3243 switch (pgmMode) 2995 3244 { 2996 case PGMMODE_REAL: return PGM_TYPE_REAL;2997 case PGMMODE_PROTECTED: return PGM_TYPE_PROT;2998 case PGMMODE_32_BIT: return PGM_TYPE_32BIT;3245 case PGMMODE_REAL: return PGM_TYPE_REAL; 3246 case PGMMODE_PROTECTED: return PGM_TYPE_PROT; 3247 case PGMMODE_32_BIT: return PGM_TYPE_32BIT; 2999 3248 case PGMMODE_PAE: 3000 case PGMMODE_PAE_NX: return PGM_TYPE_PAE;3249 case PGMMODE_PAE_NX: return PGM_TYPE_PAE; 3001 3250 case PGMMODE_AMD64: 3002 case PGMMODE_AMD64_NX: return PGM_TYPE_AMD64; 3003 case PGMMODE_NESTED: return PGM_TYPE_NESTED; 3004 case PGMMODE_EPT: return PGM_TYPE_EPT; 3251 case PGMMODE_AMD64_NX: return PGM_TYPE_AMD64; 3252 case PGMMODE_NESTED_32BIT: return PGM_TYPE_NESTED_32BIT; 3253 case PGMMODE_NESTED_PAE: return PGM_TYPE_NESTED_PAE; 3254 case PGMMODE_NESTED_AMD64: return PGM_TYPE_NESTED_AMD64; 3255 case PGMMODE_EPT: return PGM_TYPE_EPT; 3005 3256 default: 3006 3257 AssertFatalMsgFailed(("pgmMode=%d\n", pgmMode)); … … 3078 3329 pModeData->uShwType = PGM_TYPE_32BIT; 3079 3330 pModeData->uGstType = PGM_TYPE_REAL; 3080 rc = PGM_SHW_NAME_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3081 3331 rc = PGM_BTH_NAME_32BIT_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3082 3332 … … 3084 3334 pModeData->uShwType = PGM_TYPE_32BIT; 3085 3335 pModeData->uGstType = PGM_TYPE_PROT; 3086 rc = PGM_SHW_NAME_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3087 3336 rc = PGM_BTH_NAME_32BIT_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3088 3337 … … 3090 3339 pModeData->uShwType = PGM_TYPE_32BIT; 3091 3340 pModeData->uGstType = PGM_TYPE_32BIT; 3092 rc = PGM_SHW_NAME_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3093 3341 rc = PGM_BTH_NAME_32BIT_32BIT(InitData)(pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3094 3342 … … 3096 3344 pModeData->uShwType = PGM_TYPE_PAE; 3097 3345 pModeData->uGstType = PGM_TYPE_REAL; 3098 rc = PGM_SHW_NAME_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3099 3346 rc = PGM_BTH_NAME_PAE_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3100 3347 … … 3102 3349 pModeData->uShwType = PGM_TYPE_PAE; 3103 3350 pModeData->uGstType = PGM_TYPE_PROT; 3104 rc = PGM_SHW_NAME_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3105 3351 rc = PGM_BTH_NAME_PAE_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3106 3352 … … 3108 3354 pModeData->uShwType = PGM_TYPE_PAE; 3109 3355 pModeData->uGstType = PGM_TYPE_32BIT; 3110 rc = PGM_SHW_NAME_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3111 3356 rc = PGM_BTH_NAME_PAE_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3112 3357 … … 3114 3359 pModeData->uShwType = PGM_TYPE_PAE; 3115 3360 pModeData->uGstType = PGM_TYPE_PAE; 3116 rc = PGM_SHW_NAME_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3117 3361 rc = PGM_BTH_NAME_PAE_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3118 3362 … … 3121 3365 pModeData->uShwType = PGM_TYPE_AMD64; 3122 3366 pModeData->uGstType = PGM_TYPE_AMD64; 3123 rc = PGM_SHW_NAME_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3124 3367 rc = PGM_BTH_NAME_AMD64_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3125 3368 #endif 3126 3369 3127 /* The nested paging mode. */3128 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED , PGM_TYPE_REAL)];3129 pModeData->uShwType = PGM_TYPE_NESTED ;3370 /* The 32-bit nested paging mode. */ 3371 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_32BIT, PGM_TYPE_REAL)]; 3372 pModeData->uShwType = PGM_TYPE_NESTED_32BIT; 3130 3373 pModeData->uGstType = PGM_TYPE_REAL; 3131 rc = PGM_BTH_NAME_NESTED_ REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3132 3133 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED , PGMMODE_PROTECTED)];3134 pModeData->uShwType = PGM_TYPE_NESTED ;3374 rc = PGM_BTH_NAME_NESTED_32BIT_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3375 3376 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_32BIT, PGMMODE_PROTECTED)]; 3377 pModeData->uShwType = PGM_TYPE_NESTED_32BIT; 3135 3378 pModeData->uGstType = PGM_TYPE_PROT; 3136 rc = PGM_BTH_NAME_NESTED_ PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3137 3138 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED , PGM_TYPE_32BIT)];3139 pModeData->uShwType = PGM_TYPE_NESTED ;3379 rc = PGM_BTH_NAME_NESTED_32BIT_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3380 3381 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_32BIT, PGM_TYPE_32BIT)]; 3382 pModeData->uShwType = PGM_TYPE_NESTED_32BIT; 3140 3383 pModeData->uGstType = PGM_TYPE_32BIT; 3141 rc = PGM_BTH_NAME_NESTED_32BIT (InitData)(pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3142 3143 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED , PGM_TYPE_PAE)];3144 pModeData->uShwType = PGM_TYPE_NESTED ;3384 rc = PGM_BTH_NAME_NESTED_32BIT_32BIT(InitData)(pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3385 3386 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_32BIT, PGM_TYPE_PAE)]; 3387 pModeData->uShwType = PGM_TYPE_NESTED_32BIT; 3145 3388 pModeData->uGstType = PGM_TYPE_PAE; 3146 rc = PGM_BTH_NAME_NESTED_ PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3389 rc = PGM_BTH_NAME_NESTED_32BIT_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3147 3390 3148 3391 #ifdef VBOX_WITH_64_BITS_GUESTS 3149 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED , PGM_TYPE_AMD64)];3150 pModeData->uShwType = PGM_TYPE_NESTED ;3392 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_32BIT, PGM_TYPE_AMD64)]; 3393 pModeData->uShwType = PGM_TYPE_NESTED_32BIT; 3151 3394 pModeData->uGstType = PGM_TYPE_AMD64; 3152 rc = PGM_BTH_NAME_NESTED_ AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3395 rc = PGM_BTH_NAME_NESTED_32BIT_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3153 3396 #endif 3154 3397 3155 /* The shadow part of the nested callback mode depends on the host paging mode (AMD-V only). */ 3156 switch (pVM->pgm.s.enmHostMode) 3157 { 3158 #if HC_ARCH_BITS == 32 3159 case SUPPAGINGMODE_32_BIT: 3160 case SUPPAGINGMODE_32_BIT_GLOBAL: 3161 for (unsigned i = PGM_TYPE_REAL; i <= PGM_TYPE_PAE; i++) 3162 { 3163 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED, i)]; 3164 rc = PGM_SHW_NAME_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3165 } 3166 # ifdef VBOX_WITH_64_BITS_GUESTS 3167 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED, PGM_TYPE_AMD64)]; 3168 rc = PGM_SHW_NAME_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3169 # endif 3170 break; 3171 3172 case SUPPAGINGMODE_PAE: 3173 case SUPPAGINGMODE_PAE_NX: 3174 case SUPPAGINGMODE_PAE_GLOBAL: 3175 case SUPPAGINGMODE_PAE_GLOBAL_NX: 3176 for (unsigned i = PGM_TYPE_REAL; i <= PGM_TYPE_PAE; i++) 3177 { 3178 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED, i)]; 3179 rc = PGM_SHW_NAME_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3180 } 3181 # ifdef VBOX_WITH_64_BITS_GUESTS 3182 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED, PGM_TYPE_AMD64)]; 3183 rc = PGM_SHW_NAME_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3184 # endif 3185 break; 3186 #endif /* HC_ARCH_BITS == 32 */ 3187 3188 #if HC_ARCH_BITS == 64 || defined(RT_OS_DARWIN) 3189 case SUPPAGINGMODE_AMD64: 3190 case SUPPAGINGMODE_AMD64_GLOBAL: 3191 case SUPPAGINGMODE_AMD64_NX: 3192 case SUPPAGINGMODE_AMD64_GLOBAL_NX: 3193 # ifdef VBOX_WITH_64_BITS_GUESTS 3194 for (unsigned i = PGM_TYPE_REAL; i <= PGM_TYPE_AMD64; i++) 3195 # else 3196 for (unsigned i = PGM_TYPE_REAL; i <= PGM_TYPE_PAE; i++) 3197 # endif 3198 { 3199 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED, i)]; 3200 rc = PGM_SHW_NAME_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3201 } 3202 break; 3203 #endif /* HC_ARCH_BITS == 64 || RT_OS_DARWIN */ 3204 3205 default: 3206 AssertFailed(); 3207 break; 3208 } 3398 /* The PAE nested paging mode. */ 3399 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_PAE, PGM_TYPE_REAL)]; 3400 pModeData->uShwType = PGM_TYPE_NESTED_PAE; 3401 pModeData->uGstType = PGM_TYPE_REAL; 3402 rc = PGM_BTH_NAME_NESTED_PAE_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3403 3404 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_PAE, PGMMODE_PROTECTED)]; 3405 pModeData->uShwType = PGM_TYPE_NESTED_PAE; 3406 pModeData->uGstType = PGM_TYPE_PROT; 3407 rc = PGM_BTH_NAME_NESTED_PAE_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3408 3409 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_PAE, PGM_TYPE_32BIT)]; 3410 pModeData->uShwType = PGM_TYPE_NESTED_PAE; 3411 pModeData->uGstType = PGM_TYPE_32BIT; 3412 rc = PGM_BTH_NAME_NESTED_PAE_32BIT(InitData)(pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3413 3414 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_PAE, PGM_TYPE_PAE)]; 3415 pModeData->uShwType = PGM_TYPE_NESTED_PAE; 3416 pModeData->uGstType = PGM_TYPE_PAE; 3417 rc = PGM_BTH_NAME_NESTED_PAE_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3418 3419 #ifdef VBOX_WITH_64_BITS_GUESTS 3420 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_PAE, PGM_TYPE_AMD64)]; 3421 pModeData->uShwType = PGM_TYPE_NESTED_PAE; 3422 pModeData->uGstType = PGM_TYPE_AMD64; 3423 rc = PGM_BTH_NAME_NESTED_PAE_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3424 #endif 3425 3426 /* The AMD64 nested paging mode. */ 3427 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_AMD64, PGM_TYPE_REAL)]; 3428 pModeData->uShwType = PGM_TYPE_NESTED_AMD64; 3429 pModeData->uGstType = PGM_TYPE_REAL; 3430 rc = PGM_BTH_NAME_NESTED_AMD64_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3431 3432 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_AMD64, PGMMODE_PROTECTED)]; 3433 pModeData->uShwType = PGM_TYPE_NESTED_AMD64; 3434 pModeData->uGstType = PGM_TYPE_PROT; 3435 rc = PGM_BTH_NAME_NESTED_AMD64_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3436 3437 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_AMD64, PGM_TYPE_32BIT)]; 3438 pModeData->uShwType = PGM_TYPE_NESTED_AMD64; 3439 pModeData->uGstType = PGM_TYPE_32BIT; 3440 rc = PGM_BTH_NAME_NESTED_AMD64_32BIT(InitData)(pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3441 3442 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_AMD64, PGM_TYPE_PAE)]; 3443 pModeData->uShwType = PGM_TYPE_NESTED_AMD64; 3444 pModeData->uGstType = PGM_TYPE_PAE; 3445 rc = PGM_BTH_NAME_NESTED_AMD64_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3446 3447 #ifdef VBOX_WITH_64_BITS_GUESTS 3448 pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_NESTED_AMD64, PGM_TYPE_AMD64)]; 3449 pModeData->uShwType = PGM_TYPE_NESTED_AMD64; 3450 pModeData->uGstType = PGM_TYPE_AMD64; 3451 rc = PGM_BTH_NAME_NESTED_AMD64_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3452 #endif 3209 3453 3210 3454 /* Extended paging (EPT) / Intel VT-x */ … … 3212 3456 pModeData->uShwType = PGM_TYPE_EPT; 3213 3457 pModeData->uGstType = PGM_TYPE_REAL; 3214 rc = PGM_SHW_NAME_EPT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3215 3458 rc = PGM_BTH_NAME_EPT_REAL(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3216 3459 … … 3218 3461 pModeData->uShwType = PGM_TYPE_EPT; 3219 3462 pModeData->uGstType = PGM_TYPE_PROT; 3220 rc = PGM_SHW_NAME_EPT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3221 3463 rc = PGM_BTH_NAME_EPT_PROT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3222 3464 … … 3224 3466 pModeData->uShwType = PGM_TYPE_EPT; 3225 3467 pModeData->uGstType = PGM_TYPE_32BIT; 3226 rc = PGM_SHW_NAME_EPT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3227 3468 rc = PGM_BTH_NAME_EPT_32BIT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3228 3469 … … 3230 3471 pModeData->uShwType = PGM_TYPE_EPT; 3231 3472 pModeData->uGstType = PGM_TYPE_PAE; 3232 rc = PGM_SHW_NAME_EPT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3233 3473 rc = PGM_BTH_NAME_EPT_PAE(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3234 3474 … … 3237 3477 pModeData->uShwType = PGM_TYPE_EPT; 3238 3478 pModeData->uGstType = PGM_TYPE_AMD64; 3239 rc = PGM_SHW_NAME_EPT(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);3240 3479 rc = PGM_BTH_NAME_EPT_AMD64(InitData)( pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc); 3241 3480 #endif … … 3267 3506 NOREF(idxGst); 3268 3507 3269 pVCpu->pgm.s.idxShadowModeData = pgmModeToType(enmShw); 3508 uintptr_t idxShw = pVCpu->pgm.s.idxShadowModeData = pgmModeToType(enmShw); 3509 Assert(g_aPgmShadowModeData[idxShw].uType == idxShw); 3510 AssertPtr(g_aPgmShadowModeData[idxShw].pfnGetPage); 3511 AssertPtr(g_aPgmShadowModeData[idxShw].pfnModifyPage); 3512 AssertPtr(g_aPgmShadowModeData[idxShw].pfnExit); 3513 AssertPtr(g_aPgmShadowModeData[idxShw].pfnEnter); 3514 AssertPtr(g_aPgmShadowModeData[idxShw].pfnRelocate); 3515 NOREF(idxShw); 3516 3270 3517 pVCpu->pgm.s.idxBothModeData = pgmModeDataIndexByMode(enmShw, enmGst); 3271 3518 … … 3277 3524 Assert(pModeData->uGstType == pgmModeToType(enmGst)); 3278 3525 Assert(pModeData->uShwType == pgmModeToType(enmShw)); 3279 3280 /* shadow */3281 pVCpu->pgm.s.pfnR3ShwRelocate = pModeData->pfnR3ShwRelocate;3282 pVCpu->pgm.s.pfnR3ShwExit = pModeData->pfnR3ShwExit;3283 pVCpu->pgm.s.pfnR3ShwGetPage = pModeData->pfnR3ShwGetPage;3284 Assert(pVCpu->pgm.s.pfnR3ShwGetPage);3285 pVCpu->pgm.s.pfnR3ShwModifyPage = pModeData->pfnR3ShwModifyPage;3286 3287 pVCpu->pgm.s.pfnRCShwGetPage = pModeData->pfnRCShwGetPage;3288 pVCpu->pgm.s.pfnRCShwModifyPage = pModeData->pfnRCShwModifyPage;3289 3290 pVCpu->pgm.s.pfnR0ShwGetPage = pModeData->pfnR0ShwGetPage;3291 pVCpu->pgm.s.pfnR0ShwModifyPage = pModeData->pfnR0ShwModifyPage;3292 3526 3293 3527 /* both */ … … 3341 3575 static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher) 3342 3576 { 3343 /** @todo NEM: Shadow paging. */3344 3577 VMMSWITCHER enmSwitcher = VMMSWITCHER_INVALID; 3345 3578 switch (enmGuestMode) … … 3510 3743 return PGMMODE_INVALID; 3511 3744 } 3512 /* Override the shadow mode is nested paging is active. */ 3745 3746 /* 3747 * Override the shadow mode when NEM or nested paging is active. 3748 */ 3513 3749 if (VM_IS_NEM_ENABLED(pVM)) 3514 3750 { 3515 3751 pVM->pgm.s.fNestedPaging = true; 3516 enmShadowMode = PGMMODE_ NESTED;3752 enmShadowMode = PGMMODE_EPT; /* whatever harmless... */ 3517 3753 } 3518 3754 else 3519 3755 { 3520 pVM->pgm.s.fNestedPaging = HMIsNestedPagingActive(pVM); 3521 if (pVM->pgm.s.fNestedPaging) 3522 enmShadowMode = HMGetShwPagingMode(pVM); 3756 bool fNestedPaging = HMIsNestedPagingActive(pVM); 3757 pVM->pgm.s.fNestedPaging = fNestedPaging; 3758 if (fNestedPaging) 3759 { 3760 if (HMIsVmxActive(pVM)) 3761 enmShadowMode = PGMMODE_EPT; 3762 else 3763 { 3764 /* The nested SVM paging depends on the host one. */ 3765 Assert(HMIsSvmActive(pVM)); 3766 if ( enmGuestMode == PGMMODE_AMD64 3767 || enmGuestMode == PGMMODE_AMD64_NX) 3768 enmShadowMode = PGMMODE_NESTED_AMD64; 3769 else 3770 switch (pVM->pgm.s.enmHostMode) 3771 { 3772 case SUPPAGINGMODE_32_BIT: 3773 case SUPPAGINGMODE_32_BIT_GLOBAL: 3774 enmShadowMode = PGMMODE_NESTED_32BIT; 3775 break; 3776 3777 case SUPPAGINGMODE_PAE: 3778 case SUPPAGINGMODE_PAE_GLOBAL: 3779 case SUPPAGINGMODE_PAE_NX: 3780 case SUPPAGINGMODE_PAE_GLOBAL_NX: 3781 enmShadowMode = PGMMODE_NESTED_PAE; 3782 break; 3783 3784 #if HC_ARCH_BITS == 64 || defined(RT_OS_DARWIN) 3785 case SUPPAGINGMODE_AMD64: 3786 case SUPPAGINGMODE_AMD64_GLOBAL: 3787 case SUPPAGINGMODE_AMD64_NX: 3788 case SUPPAGINGMODE_AMD64_GLOBAL_NX: 3789 enmShadowMode = PGMMODE_NESTED_AMD64; 3790 break; 3791 #endif 3792 default: 3793 AssertLogRelFailedReturn(PGMMODE_INVALID); 3794 } 3795 } 3796 } 3523 3797 } 3524 3798 … … 3542 3816 VMMR3DECL(int) PGMR3ChangeMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmGuestMode) 3543 3817 { 3544 #if HC_ARCH_BITS == 323545 bool fIsOldGuestPagingMode64Bits = (pVCpu->pgm.s.enmGuestMode >= PGMMODE_AMD64);3546 #endif3547 bool fIsNewGuestPagingMode64Bits = (enmGuestMode >= PGMMODE_AMD64);3548 3549 3818 Log(("PGMR3ChangeMode: Guest mode: %s -> %s\n", PGMGetModeName(pVCpu->pgm.s.enmGuestMode), PGMGetModeName(enmGuestMode))); 3550 3819 STAM_REL_COUNTER_INC(&pVCpu->pgm.s.cGuestModeChanges); … … 3576 3845 * Exit old mode(s). 3577 3846 */ 3578 #if HC_ARCH_BITS == 323579 /* The nested shadow paging mode for AMD-V does change when running 64 bits guests on 32 bits hosts; typically PAE <-> AMD64 */3580 const bool fForceShwEnterExit = ( fIsOldGuestPagingMode64Bits != fIsNewGuestPagingMode64Bits3581 && enmShadowMode == PGMMODE_NESTED);3582 #else3583 const bool fForceShwEnterExit = false;3584 #endif3585 3847 /* shadow */ 3586 if ( enmShadowMode != pVCpu->pgm.s.enmShadowMode 3587 || fForceShwEnterExit) 3848 if (enmShadowMode != pVCpu->pgm.s.enmShadowMode) 3588 3849 { 3589 3850 LogFlow(("PGMR3ChangeMode: Shadow mode: %s -> %s\n", PGMGetModeName(pVCpu->pgm.s.enmShadowMode), PGMGetModeName(enmShadowMode))); 3590 if (PGM_SHW_PFN(Exit, pVCpu)) 3851 uintptr_t idxOldShw = pVCpu->pgm.s.idxShadowModeData; 3852 if ( idxOldShw < RT_ELEMENTS(g_aPgmShadowModeData) 3853 && g_aPgmShadowModeData[idxOldShw].pfnExit) 3591 3854 { 3592 int rc = PGM_SHW_PFN(Exit, pVCpu)(pVCpu); 3593 if (RT_FAILURE(rc)) 3594 { 3595 AssertMsgFailed(("Exit failed for shadow mode %d: %Rrc\n", pVCpu->pgm.s.enmShadowMode, rc)); 3596 return rc; 3597 } 3855 int rc = g_aPgmShadowModeData[idxOldShw].pfnExit(pVCpu); 3856 AssertMsgRCReturn(rc, ("Exit failed for shadow mode %d: %Rrc\n", pVCpu->pgm.s.enmShadowMode, rc), rc); 3598 3857 } 3599 3600 3858 } 3601 3859 else … … 3620 3878 * Enter new shadow mode (if changed). 3621 3879 */ 3622 if ( enmShadowMode != pVCpu->pgm.s.enmShadowMode 3623 || fForceShwEnterExit) 3880 if (enmShadowMode != pVCpu->pgm.s.enmShadowMode) 3624 3881 { 3625 3882 int rc; 3883 bool const fIsNewGuestPagingMode64Bits = enmGuestMode >= PGMMODE_AMD64; 3626 3884 pVCpu->pgm.s.enmShadowMode = enmShadowMode; 3627 3885 switch (enmShadowMode) … … 3638 3896 rc = PGM_SHW_NAME_AMD64(Enter)(pVCpu, fIsNewGuestPagingMode64Bits); 3639 3897 break; 3640 case PGMMODE_NESTED: 3641 rc = PGM_SHW_NAME_NESTED(Enter)(pVCpu, fIsNewGuestPagingMode64Bits); 3898 case PGMMODE_NESTED_32BIT: 3899 rc = PGM_SHW_NAME_NESTED_32BIT(Enter)(pVCpu, fIsNewGuestPagingMode64Bits); 3900 break; 3901 case PGMMODE_NESTED_PAE: 3902 rc = PGM_SHW_NAME_NESTED_PAE(Enter)(pVCpu, fIsNewGuestPagingMode64Bits); 3903 break; 3904 case PGMMODE_NESTED_AMD64: 3905 rc = PGM_SHW_NAME_NESTED_AMD64(Enter)(pVCpu, fIsNewGuestPagingMode64Bits); 3642 3906 break; 3643 3907 case PGMMODE_EPT: … … 3683 3947 rc2 = PGM_BTH_NAME_PAE_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3684 3948 break; 3685 case PGMMODE_NESTED: 3686 rc2 = PGM_BTH_NAME_NESTED_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3949 case PGMMODE_NESTED_32BIT: 3950 rc2 = PGM_BTH_NAME_NESTED_32BIT_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3951 break; 3952 case PGMMODE_NESTED_PAE: 3953 rc2 = PGM_BTH_NAME_NESTED_PAE_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3954 break; 3955 case PGMMODE_NESTED_AMD64: 3956 rc2 = PGM_BTH_NAME_NESTED_AMD64_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3687 3957 break; 3688 3958 case PGMMODE_EPT: … … 3707 3977 rc2 = PGM_BTH_NAME_PAE_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3708 3978 break; 3709 case PGMMODE_NESTED: 3710 rc2 = PGM_BTH_NAME_NESTED_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3979 case PGMMODE_NESTED_32BIT: 3980 rc2 = PGM_BTH_NAME_NESTED_32BIT_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3981 break; 3982 case PGMMODE_NESTED_PAE: 3983 rc2 = PGM_BTH_NAME_NESTED_PAE_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3984 break; 3985 case PGMMODE_NESTED_AMD64: 3986 rc2 = PGM_BTH_NAME_NESTED_AMD64_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3711 3987 break; 3712 3988 case PGMMODE_EPT: … … 3732 4008 rc2 = PGM_BTH_NAME_PAE_32BIT(Enter)(pVCpu, GCPhysCR3); 3733 4009 break; 3734 case PGMMODE_NESTED: 3735 rc2 = PGM_BTH_NAME_NESTED_32BIT(Enter)(pVCpu, GCPhysCR3); 4010 case PGMMODE_NESTED_32BIT: 4011 rc2 = PGM_BTH_NAME_NESTED_32BIT_32BIT(Enter)(pVCpu, GCPhysCR3); 4012 break; 4013 case PGMMODE_NESTED_PAE: 4014 rc2 = PGM_BTH_NAME_NESTED_PAE_32BIT(Enter)(pVCpu, GCPhysCR3); 4015 break; 4016 case PGMMODE_NESTED_AMD64: 4017 rc2 = PGM_BTH_NAME_NESTED_AMD64_32BIT(Enter)(pVCpu, GCPhysCR3); 3736 4018 break; 3737 4019 case PGMMODE_EPT: … … 3763 4045 rc2 = PGM_BTH_NAME_PAE_PAE(Enter)(pVCpu, GCPhysCR3); 3764 4046 break; 3765 case PGMMODE_NESTED: 3766 rc2 = PGM_BTH_NAME_NESTED_PAE(Enter)(pVCpu, GCPhysCR3); 4047 case PGMMODE_NESTED_32BIT: 4048 rc2 = PGM_BTH_NAME_NESTED_32BIT_PAE(Enter)(pVCpu, GCPhysCR3); 4049 break; 4050 case PGMMODE_NESTED_PAE: 4051 rc2 = PGM_BTH_NAME_NESTED_PAE_PAE(Enter)(pVCpu, GCPhysCR3); 4052 break; 4053 case PGMMODE_NESTED_AMD64: 4054 rc2 = PGM_BTH_NAME_NESTED_AMD64_PAE(Enter)(pVCpu, GCPhysCR3); 3767 4055 break; 3768 4056 case PGMMODE_EPT: … … 3789 4077 rc2 = PGM_BTH_NAME_AMD64_AMD64(Enter)(pVCpu, GCPhysCR3); 3790 4078 break; 3791 case PGMMODE_NESTED: 3792 rc2 = PGM_BTH_NAME_NESTED_AMD64(Enter)(pVCpu, GCPhysCR3); 4079 case PGMMODE_NESTED_32BIT: 4080 rc2 = PGM_BTH_NAME_NESTED_32BIT_AMD64(Enter)(pVCpu, GCPhysCR3); 4081 break; 4082 case PGMMODE_NESTED_PAE: 4083 rc2 = PGM_BTH_NAME_NESTED_PAE_AMD64(Enter)(pVCpu, GCPhysCR3); 4084 break; 4085 case PGMMODE_NESTED_AMD64: 4086 rc2 = PGM_BTH_NAME_NESTED_AMD64_AMD64(Enter)(pVCpu, GCPhysCR3); 3793 4087 break; 3794 4088 case PGMMODE_EPT: … … 3842 4136 3843 4137 /* Exit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */ 3844 rc = PGM_SHW_PFN(Exit, pVCpu)(pVCpu); 3845 AssertRC(rc); 4138 uintptr_t idxShw = pVCpu->pgm.s.idxShadowModeData; 4139 if ( idxShw < RT_ELEMENTS(g_aPgmShadowModeData) 4140 && g_aPgmShadowModeData[idxShw].pfnExit) 4141 { 4142 rc = g_aPgmShadowModeData[idxShw].pfnExit(pVCpu); 4143 AssertMsgRCReturn(rc, ("Exit failed for shadow mode %d: %Rrc\n", pVCpu->pgm.s.enmShadowMode, rc), rc); 4144 } 4145 3846 4146 Assert(pVCpu->pgm.s.pShwPageCR3R3 == NULL); 3847 4147 return rc; … … 3865 4165 3866 4166 Assert(pVCpu->pgm.s.pShwPageCR3R3 != NULL); 3867 AssertMsg( pVCpu->pgm.s.enmShadowMode >= PGMMODE_NESTED 4167 AssertMsg( pVCpu->pgm.s.enmShadowMode >= PGMMODE_NESTED_32BIT 3868 4168 || CPUMGetHyperCR3(pVCpu) == PGMGetHyperCR3(pVCpu), 3869 4169 ("%RHp != %RHp %s\n", (RTHCPHYS)CPUMGetHyperCR3(pVCpu), PGMGetHyperCR3(pVCpu), PGMGetModeName(pVCpu->pgm.s.enmShadowMode))); -
trunk/src/VBox/VMM/VMMR3/PGMBth.h
r71222 r73246 68 68 if (VM_IS_RAW_MODE_ENABLED(pVM)) 69 69 { 70 #if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT/* No AMD64 for traditional virtualization, only VT-x and AMD-V. */70 #if PGM_SHW_TYPE != PGM_TYPE_AMD64 && !PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */ 71 71 /* RC */ 72 72 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(Trap0eHandler), &pModeData->pfnRCBthTrap0eHandler); … … 88 88 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_BTH_NAME_RC_STR(UnmapCR3), &pModeData->pfnRCBthUnmapCR3); 89 89 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_BTH_NAME_RC_STR(UnmapCR3), rc), rc); 90 #endif /* Not AMD64 shadow paging. */90 #endif /* Not AMD64 or nested/ept shadow paging. */ 91 91 } 92 92 -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r73097 r73246 491 491 * required. */ 492 492 bool fCanUseHighMemory = HMIsNestedPagingActive(pVM) 493 && HM GetShwPagingMode(pVM) == PGMMODE_EPT;493 && HMIsVmxActive(pVM); 494 494 495 495 pgmLock(pVM); -
trunk/src/VBox/VMM/VMMR3/PGMShw.h
r71222 r73246 111 111 RT_C_DECLS_BEGIN 112 112 /* r3 */ 113 PGM_SHW_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0);114 113 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode); 115 114 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); … … 123 122 124 123 /** 125 * Initializes the guest bit of the paging mode data.126 *127 * @returns VBox status code.128 * @param pVM The cross context VM structure.129 * @param pModeData The pointer table to initialize (our members only).130 * @param fResolveGCAndR0 Indicate whether or not GC and Ring-0 symbols can be resolved now.131 * This is used early in the init process to avoid trouble with PDM132 * not being initialized yet.133 */134 PGM_SHW_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0)135 {136 #if PGM_SHW_TYPE != PGM_TYPE_NESTED137 Assert(pModeData->uShwType == PGM_SHW_TYPE || pModeData->uShwType == PGM_TYPE_NESTED);138 #else139 Assert(pModeData->uShwType == PGM_SHW_TYPE);140 #endif141 142 /* Ring-3 */143 pModeData->pfnR3ShwRelocate = PGM_SHW_NAME(Relocate);144 pModeData->pfnR3ShwExit = PGM_SHW_NAME(Exit);145 pModeData->pfnR3ShwGetPage = PGM_SHW_NAME(GetPage);146 pModeData->pfnR3ShwModifyPage = PGM_SHW_NAME(ModifyPage);147 148 if (fResolveGCAndR0)149 {150 int rc;151 152 if (VM_IS_RAW_MODE_ENABLED(pVM))153 {154 #if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */155 /* GC */156 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(GetPage), &pModeData->pfnRCShwGetPage);157 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_RC_STR(GetPage), rc), rc);158 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(ModifyPage), &pModeData->pfnRCShwModifyPage);159 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_RC_STR(ModifyPage), rc), rc);160 #endif /* Not AMD64 shadow paging. */161 }162 163 /* Ring-0 */164 rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(GetPage), &pModeData->pfnR0ShwGetPage);165 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_R0_STR(GetPage), rc), rc);166 rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(ModifyPage), &pModeData->pfnR0ShwModifyPage);167 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_R0_STR(ModifyPage), rc), rc);168 }169 return VINF_SUCCESS;170 }171 172 /**173 124 * Enters the shadow mode. 174 125 * … … 179 130 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode) 180 131 { 181 #if PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT182 183 # if PGM_ SHW_TYPE == PGM_TYPE_NESTED&& HC_ARCH_BITS == 32132 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 133 134 # if PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) && HC_ARCH_BITS == 32 184 135 /* Must distinguish between 32 and 64 bits guest paging modes as we'll use 185 136 a different shadow paging root/mode in both cases. */ … … 239 190 PGM_SHW_DECL(int, Exit)(PVMCPU pVCpu) 240 191 { 192 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 241 193 PVM pVM = pVCpu->pVMR3; 242 243 if ( ( pVCpu->pgm.s.enmShadowMode == PGMMODE_NESTED 244 || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT) 245 && pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)) 194 if (pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)) 246 195 { 247 196 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); … … 265 214 Log(("Leave nested shadow paging mode\n")); 266 215 } 216 #else 217 RT_NOREF_PV(pVCpu); 218 #endif 267 219 return VINF_SUCCESS; 268 220 } -
trunk/src/VBox/VMM/include/PGMInternal.h
r73202 r73246 210 210 #define PGM_TYPE_PAE 4 211 211 #define PGM_TYPE_AMD64 5 212 #define PGM_TYPE_NESTED 6 213 #define PGM_TYPE_EPT 7 212 #define PGM_TYPE_NESTED_32BIT 6 213 #define PGM_TYPE_NESTED_PAE 7 214 #define PGM_TYPE_NESTED_AMD64 8 215 #define PGM_TYPE_EPT 9 214 216 #define PGM_TYPE_MAX PGM_TYPE_EPT 215 217 /** @} */ … … 222 224 #define PGM_WITH_PAGING(uGstType, uShwType) \ 223 225 ( (uGstType) >= PGM_TYPE_32BIT \ 224 && (uShwType) != PGM_TYPE_NESTED \ 225 && (uShwType) != PGM_TYPE_EPT) 226 && (uShwType) < PGM_TYPE_NESTED_32BIT) 226 227 227 228 /** Macro for checking if the guest supports the NX bit. … … 232 233 #define PGM_WITH_NX(uGstType, uShwType) \ 233 234 ( (uGstType) >= PGM_TYPE_PAE \ 234 && (uShwType) != PGM_TYPE_NESTED \ 235 && (uShwType) != PGM_TYPE_EPT) 235 && (uShwType) < PGM_TYPE_NESTED_32BIT) 236 237 /** Macro for checking for nested or EPT. 238 * @param uType PGM_TYPE_* 239 */ 240 #define PGM_TYPE_IS_NESTED(uType) \ 241 ( (uType) == PGM_TYPE_NESTED_32BIT \ 242 || (uType) == PGM_TYPE_NESTED_PAE \ 243 || (uType) == PGM_TYPE_NESTED_AMD64) 244 245 /** Macro for checking for nested or EPT. 246 * @param uType PGM_TYPE_* 247 */ 248 #define PGM_TYPE_IS_NESTED_OR_EPT(uType) \ 249 ( (uType) == PGM_TYPE_NESTED_32BIT \ 250 || (uType) == PGM_TYPE_NESTED_PAE \ 251 || (uType) == PGM_TYPE_NESTED_AMD64 \ 252 || (uType) == PGM_TYPE_EPT) 253 236 254 237 255 … … 2965 2983 #endif 2966 2984 2967 #define PGM_GST_NAME_REAL(name) PGM_CTX(pgm,GstReal##name) 2968 #define PGM_GST_NAME_RC_REAL_STR(name) "pgmRCGstReal" #name 2969 #define PGM_GST_NAME_R0_REAL_STR(name) "pgmR0GstReal" #name 2970 #define PGM_GST_NAME_PROT(name) PGM_CTX(pgm,GstProt##name) 2971 #define PGM_GST_NAME_RC_PROT_STR(name) "pgmRCGstProt" #name 2972 #define PGM_GST_NAME_R0_PROT_STR(name) "pgmR0GstProt" #name 2973 #define PGM_GST_NAME_32BIT(name) PGM_CTX(pgm,Gst32Bit##name) 2974 #define PGM_GST_NAME_RC_32BIT_STR(name) "pgmRCGst32Bit" #name 2975 #define PGM_GST_NAME_R0_32BIT_STR(name) "pgmR0Gst32Bit" #name 2976 #define PGM_GST_NAME_PAE(name) PGM_CTX(pgm,GstPAE##name) 2977 #define PGM_GST_NAME_RC_PAE_STR(name) "pgmRCGstPAE" #name 2978 #define PGM_GST_NAME_R0_PAE_STR(name) "pgmR0GstPAE" #name 2979 #define PGM_GST_NAME_AMD64(name) PGM_CTX(pgm,GstAMD64##name) 2980 #define PGM_GST_NAME_RC_AMD64_STR(name) "pgmRCGstAMD64" #name 2981 #define PGM_GST_NAME_R0_AMD64_STR(name) "pgmR0GstAMD64" #name 2982 #define PGM_GST_DECL(type, name) PGM_CTX_DECL(type) PGM_GST_NAME(name) 2983 2984 #define PGM_SHW_NAME_32BIT(name) PGM_CTX(pgm,Shw32Bit##name) 2985 #define PGM_SHW_NAME_RC_32BIT_STR(name) "pgmRCShw32Bit" #name 2986 #define PGM_SHW_NAME_R0_32BIT_STR(name) "pgmR0Shw32Bit" #name 2987 #define PGM_SHW_NAME_PAE(name) PGM_CTX(pgm,ShwPAE##name) 2988 #define PGM_SHW_NAME_RC_PAE_STR(name) "pgmRCShwPAE" #name 2989 #define PGM_SHW_NAME_R0_PAE_STR(name) "pgmR0ShwPAE" #name 2990 #define PGM_SHW_NAME_AMD64(name) PGM_CTX(pgm,ShwAMD64##name) 2991 #define PGM_SHW_NAME_RC_AMD64_STR(name) "pgmRCShwAMD64" #name 2992 #define PGM_SHW_NAME_R0_AMD64_STR(name) "pgmR0ShwAMD64" #name 2993 #define PGM_SHW_NAME_NESTED(name) PGM_CTX(pgm,ShwNested##name) 2994 #define PGM_SHW_NAME_RC_NESTED_STR(name) "pgmRCShwNested" #name 2995 #define PGM_SHW_NAME_R0_NESTED_STR(name) "pgmR0ShwNested" #name 2996 #define PGM_SHW_NAME_EPT(name) PGM_CTX(pgm,ShwEPT##name) 2997 #define PGM_SHW_NAME_RC_EPT_STR(name) "pgmRCShwEPT" #name 2998 #define PGM_SHW_NAME_R0_EPT_STR(name) "pgmR0ShwEPT" #name 2999 #define PGM_SHW_DECL(type, name) PGM_CTX_DECL(type) PGM_SHW_NAME(name) 3000 #define PGM_SHW_PFN(name, pVCpu) ((pVCpu)->pgm.s.PGM_CTX(pfn,Shw##name)) 2985 #define PGM_GST_NAME_REAL(name) PGM_CTX(pgm,GstReal##name) 2986 #define PGM_GST_NAME_RC_REAL_STR(name) "pgmRCGstReal" #name 2987 #define PGM_GST_NAME_R0_REAL_STR(name) "pgmR0GstReal" #name 2988 #define PGM_GST_NAME_PROT(name) PGM_CTX(pgm,GstProt##name) 2989 #define PGM_GST_NAME_RC_PROT_STR(name) "pgmRCGstProt" #name 2990 #define PGM_GST_NAME_R0_PROT_STR(name) "pgmR0GstProt" #name 2991 #define PGM_GST_NAME_32BIT(name) PGM_CTX(pgm,Gst32Bit##name) 2992 #define PGM_GST_NAME_RC_32BIT_STR(name) "pgmRCGst32Bit" #name 2993 #define PGM_GST_NAME_R0_32BIT_STR(name) "pgmR0Gst32Bit" #name 2994 #define PGM_GST_NAME_PAE(name) PGM_CTX(pgm,GstPAE##name) 2995 #define PGM_GST_NAME_RC_PAE_STR(name) "pgmRCGstPAE" #name 2996 #define PGM_GST_NAME_R0_PAE_STR(name) "pgmR0GstPAE" #name 2997 #define PGM_GST_NAME_AMD64(name) PGM_CTX(pgm,GstAMD64##name) 2998 #define PGM_GST_NAME_RC_AMD64_STR(name) "pgmRCGstAMD64" #name 2999 #define PGM_GST_NAME_R0_AMD64_STR(name) "pgmR0GstAMD64" #name 3000 #define PGM_GST_DECL(type, name) PGM_CTX_DECL(type) PGM_GST_NAME(name) 3001 3002 #define PGM_SHW_NAME_32BIT(name) PGM_CTX(pgm,Shw32Bit##name) 3003 #define PGM_SHW_NAME_RC_32BIT_STR(name) "pgmRCShw32Bit" #name 3004 #define PGM_SHW_NAME_R0_32BIT_STR(name) "pgmR0Shw32Bit" #name 3005 #define PGM_SHW_NAME_PAE(name) PGM_CTX(pgm,ShwPAE##name) 3006 #define PGM_SHW_NAME_RC_PAE_STR(name) "pgmRCShwPAE" #name 3007 #define PGM_SHW_NAME_R0_PAE_STR(name) "pgmR0ShwPAE" #name 3008 #define PGM_SHW_NAME_AMD64(name) PGM_CTX(pgm,ShwAMD64##name) 3009 #define PGM_SHW_NAME_RC_AMD64_STR(name) "pgmRCShwAMD64" #name 3010 #define PGM_SHW_NAME_R0_AMD64_STR(name) "pgmR0ShwAMD64" #name 3011 #define PGM_SHW_NAME_NESTED_32BIT(name) PGM_CTX(pgm,ShwNested32Bit##name) 3012 #define PGM_SHW_NAME_RC_NESTED_32BIT_STR(name) "pgmRCShwNested32Bit" #name 3013 #define PGM_SHW_NAME_R0_NESTED_32BIT_STR(name) "pgmR0ShwNested32Bit" #name 3014 #define PGM_SHW_NAME_NESTED_PAE(name) PGM_CTX(pgm,ShwNestedPAE##name) 3015 #define PGM_SHW_NAME_RC_NESTED_PAE_STR(name) "pgmRCShwNestedPAE" #name 3016 #define PGM_SHW_NAME_R0_NESTED_PAE_STR(name) "pgmR0ShwNestedPAE" #name 3017 #define PGM_SHW_NAME_NESTED_AMD64(name) PGM_CTX(pgm,ShwNestedAMD64##name) 3018 #define PGM_SHW_NAME_RC_NESTED_AMD64_STR(name) "pgmRCShwNestedAMD64" #name 3019 #define PGM_SHW_NAME_R0_NESTED_AMD64_STR(name) "pgmR0ShwNestedAMD64" #name 3020 #define PGM_SHW_NAME_EPT(name) PGM_CTX(pgm,ShwEPT##name) 3021 #define PGM_SHW_NAME_RC_EPT_STR(name) "pgmRCShwEPT" #name 3022 #define PGM_SHW_NAME_R0_EPT_STR(name) "pgmR0ShwEPT" #name 3023 #define PGM_SHW_DECL(type, name) PGM_CTX_DECL(type) PGM_SHW_NAME(name) 3001 3024 3002 3025 /* Shw_Gst */ 3003 #define PGM_BTH_NAME_32BIT_REAL(name) PGM_CTX(pgm,Bth32BitReal##name) 3004 #define PGM_BTH_NAME_32BIT_PROT(name) PGM_CTX(pgm,Bth32BitProt##name) 3005 #define PGM_BTH_NAME_32BIT_32BIT(name) PGM_CTX(pgm,Bth32Bit32Bit##name) 3006 #define PGM_BTH_NAME_PAE_REAL(name) PGM_CTX(pgm,BthPAEReal##name) 3007 #define PGM_BTH_NAME_PAE_PROT(name) PGM_CTX(pgm,BthPAEProt##name) 3008 #define PGM_BTH_NAME_PAE_32BIT(name) PGM_CTX(pgm,BthPAE32Bit##name) 3009 #define PGM_BTH_NAME_PAE_PAE(name) PGM_CTX(pgm,BthPAEPAE##name) 3010 #define PGM_BTH_NAME_AMD64_PROT(name) PGM_CTX(pgm,BthAMD64Prot##name) 3011 #define PGM_BTH_NAME_AMD64_AMD64(name) PGM_CTX(pgm,BthAMD64AMD64##name) 3012 #define PGM_BTH_NAME_NESTED_REAL(name) PGM_CTX(pgm,BthNestedReal##name) 3013 #define PGM_BTH_NAME_NESTED_PROT(name) PGM_CTX(pgm,BthNestedProt##name) 3014 #define PGM_BTH_NAME_NESTED_32BIT(name) PGM_CTX(pgm,BthNested32Bit##name) 3015 #define PGM_BTH_NAME_NESTED_PAE(name) PGM_CTX(pgm,BthNestedPAE##name) 3016 #define PGM_BTH_NAME_NESTED_AMD64(name) PGM_CTX(pgm,BthNestedAMD64##name) 3017 #define PGM_BTH_NAME_EPT_REAL(name) PGM_CTX(pgm,BthEPTReal##name) 3018 #define PGM_BTH_NAME_EPT_PROT(name) PGM_CTX(pgm,BthEPTProt##name) 3019 #define PGM_BTH_NAME_EPT_32BIT(name) PGM_CTX(pgm,BthEPT32Bit##name) 3020 #define PGM_BTH_NAME_EPT_PAE(name) PGM_CTX(pgm,BthEPTPAE##name) 3021 #define PGM_BTH_NAME_EPT_AMD64(name) PGM_CTX(pgm,BthEPTAMD64##name) 3022 3023 #define PGM_BTH_NAME_RC_32BIT_REAL_STR(name) "pgmRCBth32BitReal" #name 3024 #define PGM_BTH_NAME_RC_32BIT_PROT_STR(name) "pgmRCBth32BitProt" #name 3025 #define PGM_BTH_NAME_RC_32BIT_32BIT_STR(name) "pgmRCBth32Bit32Bit" #name 3026 #define PGM_BTH_NAME_RC_PAE_REAL_STR(name) "pgmRCBthPAEReal" #name 3027 #define PGM_BTH_NAME_RC_PAE_PROT_STR(name) "pgmRCBthPAEProt" #name 3028 #define PGM_BTH_NAME_RC_PAE_32BIT_STR(name) "pgmRCBthPAE32Bit" #name 3029 #define PGM_BTH_NAME_RC_PAE_PAE_STR(name) "pgmRCBthPAEPAE" #name 3030 #define PGM_BTH_NAME_RC_AMD64_AMD64_STR(name) "pgmRCBthAMD64AMD64" #name 3031 #define PGM_BTH_NAME_RC_NESTED_REAL_STR(name) "pgmRCBthNestedReal" #name 3032 #define PGM_BTH_NAME_RC_NESTED_PROT_STR(name) "pgmRCBthNestedProt" #name 3033 #define PGM_BTH_NAME_RC_NESTED_32BIT_STR(name) "pgmRCBthNested32Bit" #name 3034 #define PGM_BTH_NAME_RC_NESTED_PAE_STR(name) "pgmRCBthNestedPAE" #name 3035 #define PGM_BTH_NAME_RC_NESTED_AMD64_STR(name) "pgmRCBthNestedAMD64" #name 3036 #define PGM_BTH_NAME_RC_EPT_REAL_STR(name) "pgmRCBthEPTReal" #name 3037 #define PGM_BTH_NAME_RC_EPT_PROT_STR(name) "pgmRCBthEPTProt" #name 3038 #define PGM_BTH_NAME_RC_EPT_32BIT_STR(name) "pgmRCBthEPT32Bit" #name 3039 #define PGM_BTH_NAME_RC_EPT_PAE_STR(name) "pgmRCBthEPTPAE" #name 3040 #define PGM_BTH_NAME_RC_EPT_AMD64_STR(name) "pgmRCBthEPTAMD64" #name 3041 #define PGM_BTH_NAME_R0_32BIT_REAL_STR(name) "pgmR0Bth32BitReal" #name 3042 #define PGM_BTH_NAME_R0_32BIT_PROT_STR(name) "pgmR0Bth32BitProt" #name 3043 #define PGM_BTH_NAME_R0_32BIT_32BIT_STR(name) "pgmR0Bth32Bit32Bit" #name 3044 #define PGM_BTH_NAME_R0_PAE_REAL_STR(name) "pgmR0BthPAEReal" #name 3045 #define PGM_BTH_NAME_R0_PAE_PROT_STR(name) "pgmR0BthPAEProt" #name 3046 #define PGM_BTH_NAME_R0_PAE_32BIT_STR(name) "pgmR0BthPAE32Bit" #name 3047 #define PGM_BTH_NAME_R0_PAE_PAE_STR(name) "pgmR0BthPAEPAE" #name 3048 #define PGM_BTH_NAME_R0_AMD64_PROT_STR(name) "pgmR0BthAMD64Prot" #name 3049 #define PGM_BTH_NAME_R0_AMD64_AMD64_STR(name) "pgmR0BthAMD64AMD64" #name 3050 #define PGM_BTH_NAME_R0_NESTED_REAL_STR(name) "pgmR0BthNestedReal" #name 3051 #define PGM_BTH_NAME_R0_NESTED_PROT_STR(name) "pgmR0BthNestedProt" #name 3052 #define PGM_BTH_NAME_R0_NESTED_32BIT_STR(name) "pgmR0BthNested32Bit" #name 3053 #define PGM_BTH_NAME_R0_NESTED_PAE_STR(name) "pgmR0BthNestedPAE" #name 3054 #define PGM_BTH_NAME_R0_NESTED_AMD64_STR(name) "pgmR0BthNestedAMD64" #name 3055 #define PGM_BTH_NAME_R0_EPT_REAL_STR(name) "pgmR0BthEPTReal" #name 3056 #define PGM_BTH_NAME_R0_EPT_PROT_STR(name) "pgmR0BthEPTProt" #name 3057 #define PGM_BTH_NAME_R0_EPT_32BIT_STR(name) "pgmR0BthEPT32Bit" #name 3058 #define PGM_BTH_NAME_R0_EPT_PAE_STR(name) "pgmR0BthEPTPAE" #name 3059 #define PGM_BTH_NAME_R0_EPT_AMD64_STR(name) "pgmR0BthEPTAMD64" #name 3026 #define PGM_BTH_NAME_32BIT_REAL(name) PGM_CTX(pgm,Bth32BitReal##name) 3027 #define PGM_BTH_NAME_32BIT_PROT(name) PGM_CTX(pgm,Bth32BitProt##name) 3028 #define PGM_BTH_NAME_32BIT_32BIT(name) PGM_CTX(pgm,Bth32Bit32Bit##name) 3029 #define PGM_BTH_NAME_PAE_REAL(name) PGM_CTX(pgm,BthPAEReal##name) 3030 #define PGM_BTH_NAME_PAE_PROT(name) PGM_CTX(pgm,BthPAEProt##name) 3031 #define PGM_BTH_NAME_PAE_32BIT(name) PGM_CTX(pgm,BthPAE32Bit##name) 3032 #define PGM_BTH_NAME_PAE_PAE(name) PGM_CTX(pgm,BthPAEPAE##name) 3033 #define PGM_BTH_NAME_AMD64_PROT(name) PGM_CTX(pgm,BthAMD64Prot##name) 3034 #define PGM_BTH_NAME_AMD64_AMD64(name) PGM_CTX(pgm,BthAMD64AMD64##name) 3035 #define PGM_BTH_NAME_NESTED_32BIT_REAL(name) PGM_CTX(pgm,BthNested32BitReal##name) 3036 #define PGM_BTH_NAME_NESTED_32BIT_PROT(name) PGM_CTX(pgm,BthNested32BitProt##name) 3037 #define PGM_BTH_NAME_NESTED_32BIT_32BIT(name) PGM_CTX(pgm,BthNested32Bit32Bit##name) 3038 #define PGM_BTH_NAME_NESTED_32BIT_PAE(name) PGM_CTX(pgm,BthNested32BitPAE##name) 3039 #define PGM_BTH_NAME_NESTED_32BIT_AMD64(name) PGM_CTX(pgm,BthNested32BitAMD64##name) 3040 #define PGM_BTH_NAME_NESTED_PAE_REAL(name) PGM_CTX(pgm,BthNestedPAEReal##name) 3041 #define PGM_BTH_NAME_NESTED_PAE_PROT(name) PGM_CTX(pgm,BthNestedPAEProt##name) 3042 #define PGM_BTH_NAME_NESTED_PAE_32BIT(name) PGM_CTX(pgm,BthNestedPAE32Bit##name) 3043 #define PGM_BTH_NAME_NESTED_PAE_PAE(name) PGM_CTX(pgm,BthNestedPAEPAE##name) 3044 #define PGM_BTH_NAME_NESTED_PAE_AMD64(name) PGM_CTX(pgm,BthNestedPAEAMD64##name) 3045 #define PGM_BTH_NAME_NESTED_AMD64_REAL(name) PGM_CTX(pgm,BthNestedAMD64Real##name) 3046 #define PGM_BTH_NAME_NESTED_AMD64_PROT(name) PGM_CTX(pgm,BthNestedAMD64Prot##name) 3047 #define PGM_BTH_NAME_NESTED_AMD64_32BIT(name) PGM_CTX(pgm,BthNestedAMD6432Bit##name) 3048 #define PGM_BTH_NAME_NESTED_AMD64_PAE(name) PGM_CTX(pgm,BthNestedAMD64PAE##name) 3049 #define PGM_BTH_NAME_NESTED_AMD64_AMD64(name) PGM_CTX(pgm,BthNestedAMD64AMD64##name) 3050 #define PGM_BTH_NAME_EPT_REAL(name) PGM_CTX(pgm,BthEPTReal##name) 3051 #define PGM_BTH_NAME_EPT_PROT(name) PGM_CTX(pgm,BthEPTProt##name) 3052 #define PGM_BTH_NAME_EPT_32BIT(name) PGM_CTX(pgm,BthEPT32Bit##name) 3053 #define PGM_BTH_NAME_EPT_PAE(name) PGM_CTX(pgm,BthEPTPAE##name) 3054 #define PGM_BTH_NAME_EPT_AMD64(name) PGM_CTX(pgm,BthEPTAMD64##name) 3055 3056 #define PGM_BTH_NAME_RC_32BIT_REAL_STR(name) "pgmRCBth32BitReal" #name 3057 #define PGM_BTH_NAME_RC_32BIT_PROT_STR(name) "pgmRCBth32BitProt" #name 3058 #define PGM_BTH_NAME_RC_32BIT_32BIT_STR(name) "pgmRCBth32Bit32Bit" #name 3059 #define PGM_BTH_NAME_RC_PAE_REAL_STR(name) "pgmRCBthPAEReal" #name 3060 #define PGM_BTH_NAME_RC_PAE_PROT_STR(name) "pgmRCBthPAEProt" #name 3061 #define PGM_BTH_NAME_RC_PAE_32BIT_STR(name) "pgmRCBthPAE32Bit" #name 3062 #define PGM_BTH_NAME_RC_PAE_PAE_STR(name) "pgmRCBthPAEPAE" #name 3063 #define PGM_BTH_NAME_RC_AMD64_AMD64_STR(name) "pgmRCBthAMD64AMD64" #name 3064 #define PGM_BTH_NAME_RC_NESTED_32BIT_REAL_STR(name) "pgmRCBthNested32BitReal" #name 3065 #define PGM_BTH_NAME_RC_NESTED_32BIT_PROT_STR(name) "pgmRCBthNested32BitProt" #name 3066 #define PGM_BTH_NAME_RC_NESTED_32BIT_32BIT_STR(name) "pgmRCBthNested32Bit32Bit" #name 3067 #define PGM_BTH_NAME_RC_NESTED_32BIT_PAE_STR(name) "pgmRCBthNested32BitPAE" #name 3068 #define PGM_BTH_NAME_RC_NESTED_32BIT_AMD64_STR(name) "pgmRCBthNested32BitAMD64" #name 3069 #define PGM_BTH_NAME_RC_NESTED_PAE_REAL_STR(name) "pgmRCBthNestedPAEReal" #name 3070 #define PGM_BTH_NAME_RC_NESTED_PAE_PROT_STR(name) "pgmRCBthNestedPAEProt" #name 3071 #define PGM_BTH_NAME_RC_NESTED_PAE_32BIT_STR(name) "pgmRCBthNestedPAE32Bit" #name 3072 #define PGM_BTH_NAME_RC_NESTED_PAE_PAE_STR(name) "pgmRCBthNestedPAEPAE" #name 3073 #define PGM_BTH_NAME_RC_NESTED_PAE_AMD64_STR(name) "pgmRCBthNestedPAEAMD64" #name 3074 #define PGM_BTH_NAME_RC_NESTED_AMD64_REAL_STR(name) "pgmRCBthNestedAMD64Real" #name 3075 #define PGM_BTH_NAME_RC_NESTED_AMD64_PROT_STR(name) "pgmRCBthNestedAMD64Prot" #name 3076 #define PGM_BTH_NAME_RC_NESTED_AMD64_32BIT_STR(name) "pgmRCBthNestedAMD6432Bit" #name 3077 #define PGM_BTH_NAME_RC_NESTED_AMD64_PAE_STR(name) "pgmRCBthNestedAMD64PAE" #name 3078 #define PGM_BTH_NAME_RC_NESTED_AMD64_AMD64_STR(name) "pgmRCBthNestedAMD64AMD64" #name 3079 #define PGM_BTH_NAME_RC_EPT_REAL_STR(name) "pgmRCBthEPTReal" #name 3080 #define PGM_BTH_NAME_RC_EPT_PROT_STR(name) "pgmRCBthEPTProt" #name 3081 #define PGM_BTH_NAME_RC_EPT_32BIT_STR(name) "pgmRCBthEPT32Bit" #name 3082 #define PGM_BTH_NAME_RC_EPT_PAE_STR(name) "pgmRCBthEPTPAE" #name 3083 #define PGM_BTH_NAME_RC_EPT_AMD64_STR(name) "pgmRCBthEPTAMD64" #name 3084 3085 #define PGM_BTH_NAME_R0_32BIT_REAL_STR(name) "pgmR0Bth32BitReal" #name 3086 #define PGM_BTH_NAME_R0_32BIT_PROT_STR(name) "pgmR0Bth32BitProt" #name 3087 #define PGM_BTH_NAME_R0_32BIT_32BIT_STR(name) "pgmR0Bth32Bit32Bit" #name 3088 #define PGM_BTH_NAME_R0_PAE_REAL_STR(name) "pgmR0BthPAEReal" #name 3089 #define PGM_BTH_NAME_R0_PAE_PROT_STR(name) "pgmR0BthPAEProt" #name 3090 #define PGM_BTH_NAME_R0_PAE_32BIT_STR(name) "pgmR0BthPAE32Bit" #name 3091 #define PGM_BTH_NAME_R0_PAE_PAE_STR(name) "pgmR0BthPAEPAE" #name 3092 #define PGM_BTH_NAME_R0_AMD64_PROT_STR(name) "pgmR0BthAMD64Prot" #name 3093 #define PGM_BTH_NAME_R0_AMD64_AMD64_STR(name) "pgmR0BthAMD64AMD64" #name 3094 #define PGM_BTH_NAME_R0_NESTED_32BIT_REAL_STR(name) "pgmR0BthNested32BitReal" #name 3095 #define PGM_BTH_NAME_R0_NESTED_32BIT_PROT_STR(name) "pgmR0BthNested32BitProt" #name 3096 #define PGM_BTH_NAME_R0_NESTED_32BIT_32BIT_STR(name) "pgmR0BthNested32Bit32Bit" #name 3097 #define PGM_BTH_NAME_R0_NESTED_32BIT_PAE_STR(name) "pgmR0BthNested32BitPAE" #name 3098 #define PGM_BTH_NAME_R0_NESTED_32BIT_AMD64_STR(name) "pgmR0BthNested32BitAMD64" #name 3099 #define PGM_BTH_NAME_R0_NESTED_PAE_REAL_STR(name) "pgmR0BthNestedPAEReal" #name 3100 #define PGM_BTH_NAME_R0_NESTED_PAE_PROT_STR(name) "pgmR0BthNestedPAEProt" #name 3101 #define PGM_BTH_NAME_R0_NESTED_PAE_32BIT_STR(name) "pgmR0BthNestedPAE32Bit" #name 3102 #define PGM_BTH_NAME_R0_NESTED_PAE_PAE_STR(name) "pgmR0BthNestedPAEPAE" #name 3103 #define PGM_BTH_NAME_R0_NESTED_PAE_AMD64_STR(name) "pgmR0BthNestedPAEAMD64" #name 3104 #define PGM_BTH_NAME_R0_NESTED_AMD64_REAL_STR(name) "pgmR0BthNestedAMD64Real" #name 3105 #define PGM_BTH_NAME_R0_NESTED_AMD64_PROT_STR(name) "pgmR0BthNestedAMD64Prot" #name 3106 #define PGM_BTH_NAME_R0_NESTED_AMD64_32BIT_STR(name) "pgmR0BthNestedAMD6432Bit" #name 3107 #define PGM_BTH_NAME_R0_NESTED_AMD64_PAE_STR(name) "pgmR0BthNestedAMD64PAE" #name 3108 #define PGM_BTH_NAME_R0_NESTED_AMD64_AMD64_STR(name) "pgmR0BthNestedAMD64AMD64" #name 3109 #define PGM_BTH_NAME_R0_EPT_REAL_STR(name) "pgmR0BthEPTReal" #name 3110 #define PGM_BTH_NAME_R0_EPT_PROT_STR(name) "pgmR0BthEPTProt" #name 3111 #define PGM_BTH_NAME_R0_EPT_32BIT_STR(name) "pgmR0BthEPT32Bit" #name 3112 #define PGM_BTH_NAME_R0_EPT_PAE_STR(name) "pgmR0BthEPTPAE" #name 3113 #define PGM_BTH_NAME_R0_EPT_AMD64_STR(name) "pgmR0BthEPTAMD64" #name 3060 3114 3061 3115 #define PGM_BTH_DECL(type, name) PGM_CTX_DECL(type) PGM_BTH_NAME(name) … … 3090 3144 3091 3145 /** 3146 * Function pointers for shadow paging. 3147 */ 3148 typedef struct PGMMODEDATASHW 3149 { 3150 /** The shadow mode type. */ 3151 uint32_t uType; 3152 DECLCALLBACKMEMBER(int, pfnGetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys); 3153 DECLCALLBACKMEMBER(int, pfnModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, 3154 uint64_t fMask, uint32_t fOpFlags); 3155 DECLCALLBACKMEMBER(int, pfnEnter)(PVMCPU pVCpu, bool fIs64BitsPagingMode); 3156 DECLCALLBACKMEMBER(int, pfnExit)(PVMCPU pVCpu); 3157 DECLCALLBACKMEMBER(int, pfnRelocate)(PVMCPU pVCpu, RTGCPTR offDelta); /**< Only in ring-3. */ 3158 } PGMMODEDATASHW; 3159 3160 /** The length of g_aPgmGuestModeData. */ 3161 #ifndef IN_RC 3162 # define PGM_SHADOW_MODE_DATA_ARRAY_SIZE (PGM_TYPE_MAX + 1) 3163 #else 3164 # define PGM_SHADOW_MODE_DATA_ARRAY_SIZE (PGM_TYPE_PAE + 1) 3165 #endif 3166 /** The shadow mode data array. */ 3167 extern PGMMODEDATASHW const g_aPgmShadowModeData[PGM_SHADOW_MODE_DATA_ARRAY_SIZE]; 3168 3169 3170 3171 /** 3092 3172 * Data for each paging mode. 3093 3173 */ … … 3098 3178 /** The shadow mode type. */ 3099 3179 uint32_t uShwType; 3100 3101 /** @name Function pointers for Shadow paging.3102 * @{3103 */3104 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta));3105 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu));3106 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));3107 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));3108 3109 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));3110 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));3111 3112 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));3113 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));3114 /** @} */3115 3180 3116 3181 /** @name Function pointers for Both Shadow and Guest paging. … … 4049 4114 /** @} */ 4050 4115 4051 /** @name Function pointers for Shadow paging.4052 * @{4053 */4054 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta));4055 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu));4056 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));4057 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));4058 4059 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));4060 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));4061 4062 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));4063 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags));4064 4065 /** @} */4066 4067 4116 /** @name Function pointers for Both Shadow and Guest paging. 4068 4117 * @{ -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r73199 r73246 667 667 GEN_CHECK_OFF(PGMCPU, pShwPageCR3R0); 668 668 GEN_CHECK_OFF(PGMCPU, pShwPageCR3RC); 669 GEN_CHECK_OFF(PGMCPU, pfnR3ShwRelocate);670 GEN_CHECK_OFF(PGMCPU, pfnR3ShwExit);671 GEN_CHECK_OFF(PGMCPU, pfnR3ShwGetPage);672 GEN_CHECK_OFF(PGMCPU, pfnR3ShwModifyPage);673 GEN_CHECK_OFF(PGMCPU, pfnRCShwGetPage);674 GEN_CHECK_OFF(PGMCPU, pfnRCShwModifyPage);675 669 GEN_CHECK_OFF(PGMCPU, pfnR3BthMapCR3); 676 670 GEN_CHECK_OFF(PGMCPU, pfnR3BthUnmapCR3);
Note:
See TracChangeset
for help on using the changeset viewer.