Changeset 96735 in vbox
- Timestamp:
- Sep 14, 2022 11:53:46 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pgm.h
r96407 r96735 414 414 #define PGM_PTATTRS_EPT_IGNORE_PAT_SHIFT 19 415 415 #define PGM_PTATTRS_EPT_IGNORE_PAT_MASK RT_BIT_64(PGM_PTATTRS_EPT_IGNORE_PAT_SHIFT) 416 /** Reserved (bits 22:20) unused. */ 417 #define PGM_PTATTRS_RSVD_22_20_SHIFT 20 418 #define PGM_PTATTRS_RSVD_22_20_MASK UINT64_C(0x0000000000700000) 416 /** Leaf paging entry (big or regular) - EPT only. */ 417 #define PGM_PTATTRS_EPT_LEAF_SHIFT 20 418 #define PGM_PTATTRS_EPT_LEAF_MASK RT_BIT_64(PGM_PTATTRS_EPT_LEAF_SHIFT) 419 /** Accessed bit - EPT only. */ 420 #define PGM_PTATTRS_EPT_A_SHIFT 21 421 #define PGM_PTATTRS_EPT_A_MASK RT_BIT_64(PGM_PTATTRS_EPT_A_SHIFT) 422 /** Dirty bit - EPT only. */ 423 #define PGM_PTATTRS_EPT_D_SHIFT 22 424 #define PGM_PTATTRS_EPT_D_MASK RT_BIT_64(PGM_PTATTRS_EPT_D_SHIFT) 419 425 /** Execute access for user-mode linear addresses - EPT only. */ 420 426 #define PGM_PTATTRS_EPT_X_USER_SHIFT 23 421 427 #define PGM_PTATTRS_EPT_X_USER_MASK RT_BIT_64(PGM_PTATTRS_EPT_X_USER_SHIFT) 422 /** Reserved (bit 23) - unused. */ 423 #define PGM_PTATTRS_RSVD_23_SHIFT 24 424 #define PGM_PTATTRS_RSVD_23_MASK UINT64_C(0x0000000001000000) 428 /** Reserved (bits 29:24) - unused. */ 429 #define PGM_PTATTRS_RSVD_29_24_SHIFT 24 430 #define PGM_PTATTRS_RSVD_29_24_MASK UINT64_C(0x000000003f000000) 431 /** Verify Guest Paging - EPT only. */ 432 #define PGM_PTATTRS_EPT_VGP_SHIFT 30 433 #define PGM_PTATTRS_EPT_VGP_MASK RT_BIT_64(PGM_PTATTRS_EPT_VGP_SHIFT) 434 /** Paging-write - EPT only. */ 435 #define PGM_PTATTRS_EPT_PW_SHIFT 31 436 #define PGM_PTATTRS_EPT_PW_MASK RT_BIT_64(PGM_PTATTRS_EPT_PW_SHIFT) 437 /** Reserved (bit 32) - unused. */ 438 #define PGM_PTATTRS_RSVD_32_SHIFT 32 439 #define PGM_PTATTRS_RSVD_32_MASK UINT64_C(0x0000000100000000) 425 440 /** Supervisor shadow stack - EPT only. */ 426 #define PGM_PTATTRS_EPT_SUPER_SHW_STACK_SHIFT 25 427 #define PGM_PTATTRS_EPT_SUPER_SHW_STACK_MASK RT_BIT_64(PGM_PTATTRS_EPT_SUPER_SHW_STACK_SHIFT) 441 #define PGM_PTATTRS_EPT_SSS_SHIFT 33 442 #define PGM_PTATTRS_EPT_SSS_MASK RT_BIT_64(PGM_PTATTRS_EPT_SSS_SHIFT) 443 /** Sub-page write permission - EPT only. */ 444 #define PGM_PTATTRS_EPT_SPP_SHIFT 34 445 #define PGM_PTATTRS_EPT_SPP_MASK RT_BIT_64(PGM_PTATTRS_EPT_SPP_SHIFT) 446 /** Reserved (bit 35) - unused. */ 447 #define PGM_PTATTRS_RSVD_35_SHIFT 35 448 #define PGM_PTATTRS_RSVD_35_MASK UINT64_C(0x0000000800000000) 428 449 /** Suppress \#VE exception - EPT only. */ 429 #define PGM_PTATTRS_EPT_S UPPRESS_VE_XCPT_SHIFT 26430 #define PGM_PTATTRS_EPT_S UPPRESS_VE_XCPT_MASK RT_BIT_64(PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT_SHIFT)431 /** Reserved (bits 62: 27) - unused. */432 #define PGM_PTATTRS_RSVD_62_ 27_SHIFT 27433 #define PGM_PTATTRS_RSVD_62_ 27_MASK UINT64_C(0x7ffffffff8000000)450 #define PGM_PTATTRS_EPT_SVE_SHIFT 36 451 #define PGM_PTATTRS_EPT_SVE_MASK RT_BIT_64(PGM_PTATTRS_EPT_SVE_SHIFT) 452 /** Reserved (bits 62:37) - unused. */ 453 #define PGM_PTATTRS_RSVD_62_37_SHIFT 37 454 #define PGM_PTATTRS_RSVD_62_37_MASK UINT64_C(0x7fffffe000000000) 434 455 /** No-execute bit. */ 435 456 #define PGM_PTATTRS_NX_SHIFT 63 … … 438 459 RT_BF_ASSERT_COMPILE_CHECKS(PGM_PTATTRS_, UINT64_C(0), UINT64_MAX, 439 460 (R, W, US, PWT, PCD, A, D, PAT, G, RSVD_12_9, EPT_R, EPT_W, EPT_X_SUPER, EPT_MEMTYPE, EPT_IGNORE_PAT, 440 RSVD_22_20, EPT_X_USER, RSVD_23, EPT_SUPER_SHW_STACK, EPT_SUPPRESS_VE_XCPT, RSVD_62_27, NX)); 461 EPT_LEAF, EPT_A, EPT_D, EPT_X_USER, RSVD_29_24, EPT_VGP, EPT_PW, RSVD_32, EPT_SSS, EPT_SPP, 462 RSVD_35, EPT_SVE, RSVD_62_37, NX)); 441 463 442 464 /** The bit position where the EPT specific attributes begin. */ 443 465 #define PGM_PTATTRS_EPT_SHIFT PGM_PTATTRS_EPT_R_SHIFT 444 /** The mask of EPT bits (bits 26:ATTR_SHIFT). In the future we might choose to466 /** The mask of EPT bits (bits 36:ATTR_SHIFT). In the future we might choose to 445 467 * use higher unused bits for something else, in that case adjust this mask. */ 446 #define PGM_PTATTRS_EPT_MASK UINT64_C(0x000000 0007ffe000)468 #define PGM_PTATTRS_EPT_MASK UINT64_C(0x0000001fffffe000) 447 469 448 470 /** The mask of all PGM page attribute bits for regular page-tables. */ … … 459 481 460 482 /** The mask of all PGM page attribute bits for EPT. */ 461 #define PGM_PTATTRS_EPT_VALID_MASK ( PGM_PTATTRS_R_MASK \ 462 | PGM_PTATTRS_W_MASK \ 463 | PGM_PTATTRS_A_MASK \ 464 | PGM_PTATTRS_D_MASK \ 465 | PGM_PTATTRS_EPT_R_MASK \ 483 #define PGM_PTATTRS_EPT_VALID_MASK ( PGM_PTATTRS_EPT_R_MASK \ 466 484 | PGM_PTATTRS_EPT_W_MASK \ 467 | PGM_PTATTRS_EPT_X_SUPER \ 468 | PGM_PTATTRS_EPT_MEMTYPE \ 469 | PGM_PTATTRS_EPT_IGNORE_PAT \ 470 | PGM_PTATTRS_EPT_X_USER \ 471 | PGM_PTATTRS_EPT_SUPER_SHW_STACK \ 472 | PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT) 485 | PGM_PTATTRS_EPT_X_SUPER_MASK \ 486 | PGM_PTATTRS_EPT_MEMTYPE_MASK \ 487 | PGM_PTATTRS_EPT_IGNORE_PAT_MASK \ 488 | PGM_PTATTRS_EPT_LEAF_MASK \ 489 | PGM_PTATTRS_EPT_A_MASK \ 490 | PGM_PTATTRS_EPT_D_MASK \ 491 | PGM_PTATTRS_EPT_X_USER_MASK \ 492 | PGM_PTATTRS_EPT_VGP_MASK \ 493 | PGM_PTATTRS_EPT_PW_MASK \ 494 | PGM_PTATTRS_EPT_SSS_MASK \ 495 | PGM_PTATTRS_EPT_SPP_MASK \ 496 | PGM_PTATTRS_EPT_SVE_MASK) 473 497 474 498 /* The mask of all PGM page attribute bits (combined). */ 475 #define PGM_PTATTRS_VALID_MASK (PGM_PTATTRS_PT_VALID_MASK | PGM_PTATTRS_ PT_VALID_MASK)499 #define PGM_PTATTRS_VALID_MASK (PGM_PTATTRS_PT_VALID_MASK | PGM_PTATTRS_EPT_VALID_MASK) 476 500 477 501 /* Verify bits match the regular PT bits. */ … … 962 986 # ifdef VBOX_WITH_NESTED_HWVIRT_VMX_EPT 963 987 VMMR0DECL(VBOXSTRICTRC) PGMR0NestedTrap0eHandlerNestedPaging(PGVMCPU pGVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr, 964 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysNested ,965 bool fIsLinearAddrValid, RTGCPTR GCPtrNested , PPGMPTWALK pWalk);988 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysNestedFault, 989 bool fIsLinearAddrValid, RTGCPTR GCPtrNestedFault, PPGMPTWALK pWalk); 966 990 # endif 967 991 /** @} */ -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r96407 r96735 1237 1237 * @param uErr The trap error code. 1238 1238 * @param pRegFrame Trap register frame. 1239 * @param GCPhysNested 1239 * @param GCPhysNestedFault The nested-guest physical address causing the fault. 1240 1240 * @param fIsLinearAddrValid Whether translation of a nested-guest linear address 1241 * caused this fault. If @c false, GCPtrNested must be1242 * 0.1243 * @param GCPtrNested 1241 * caused this fault. If @c false, GCPtrNestedFault 1242 * must be 0. 1243 * @param GCPtrNestedFault The nested-guest linear address that caused this 1244 1244 * fault. 1245 1245 * @param pWalk Where to store the SLAT walk result. 1246 1246 */ 1247 1247 VMMR0DECL(VBOXSTRICTRC) PGMR0NestedTrap0eHandlerNestedPaging(PGVMCPU pGVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr, 1248 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysNested ,1249 bool fIsLinearAddrValid, RTGCPTR GCPtrNested , PPGMPTWALK pWalk)1248 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysNestedFault, 1249 bool fIsLinearAddrValid, RTGCPTR GCPtrNestedFault, PPGMPTWALK pWalk) 1250 1250 { 1251 1251 Assert(enmShwPagingMode == PGMMODE_EPT); … … 1253 1253 1254 1254 bool fLockTaken; 1255 VBOXSTRICTRC rcStrict = PGM_BTH_NAME_EPT_PROT(NestedTrap0eHandler)(pGVCpu, uErr, pRegFrame, GCPhysNested , fIsLinearAddrValid,1256 GCPtrNested, pWalk, &fLockTaken);1255 VBOXSTRICTRC rcStrict = PGM_BTH_NAME_EPT_PROT(NestedTrap0eHandler)(pGVCpu, uErr, pRegFrame, GCPhysNestedFault, 1256 fIsLinearAddrValid, GCPtrNestedFault, pWalk, &fLockTaken); 1257 1257 if (fLockTaken) 1258 1258 { … … 1260 1260 PGM_UNLOCK(pGVCpu->CTX_SUFF(pVM)); 1261 1261 } 1262 if (rcStrict == VINF_PGM_SYNCPAGE_MODIFIED_PDE) 1263 rcStrict = VINF_SUCCESS; 1262 Assert(rcStrict != VINF_PGM_SYNCPAGE_MODIFIED_PDE); /* This rc isn't used with Nested Paging and nested-EPT. */ 1264 1263 return rcStrict; 1265 1264 }
Note:
See TracChangeset
for help on using the changeset viewer.