Changeset 92285 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Nov 9, 2021 11:20:42 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r92190 r92285 1455 1455 { 1456 1456 /* AMD-V nested paging or real/protected mode without paging. */ 1457 GCPdPt = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT;1457 GCPdPt = GCPtr & ~(RT_BIT_64(X86_PDPT_SHIFT) - 1); 1458 1458 enmKind = PGMPOOLKIND_PAE_PD_PHYS; 1459 1459 } 1460 else 1461 { 1462 if ( CPUMGetGuestCR4(pVCpu) & X86_CR4_PAE)1460 else if (CPUMGetGuestCR4(pVCpu) & X86_CR4_PAE) 1461 { 1462 if (!(uGstPdpe & X86_PDPE_P)) 1463 1463 { 1464 if (!(uGstPdpe & X86_PDPE_P)) 1465 { 1466 /* PD not present; guest must reload CR3 to change it. 1467 * No need to monitor anything in this case. */ 1468 Assert(VM_IS_RAW_MODE_ENABLED(pVM)); 1469 GCPdPt = uGstPdpe & X86_PDPE_PG_MASK; 1470 enmKind = PGMPOOLKIND_PAE_PD_PHYS; 1471 Assert(uGstPdpe & X86_PDPE_P); /* caller should do this already */ 1472 } 1473 else 1474 { 1475 GCPdPt = uGstPdpe & X86_PDPE_PG_MASK; 1476 enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD; 1477 } 1464 /* PD not present; guest must reload CR3 to change it. 1465 * No need to monitor anything in this case. */ 1466 Assert(VM_IS_RAW_MODE_ENABLED(pVM)); 1467 GCPdPt = uGstPdpe & X86_PDPE_PG_MASK; 1468 enmKind = PGMPOOLKIND_PAE_PD_PHYS; 1469 Assert(uGstPdpe & X86_PDPE_P); /* caller should do this already */ 1478 1470 } 1479 1471 else 1480 1472 { 1481 GCPdPt = CPUMGetGuestCR3(pVCpu);1482 enmKind = (PGMPOOLKIND)(PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD + iPdPt);1473 GCPdPt = uGstPdpe & X86_PDPE_PG_MASK; 1474 enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD; 1483 1475 } 1476 } 1477 else 1478 { 1479 GCPdPt = CPUMGetGuestCR3(pVCpu); 1480 enmKind = (PGMPOOLKIND)(PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD + iPdPt); 1484 1481 } 1485 1482 … … 1643 1640 { 1644 1641 /* AMD-V nested paging or real/protected mode without paging */ 1645 GCPdPt = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT;1642 GCPdPt = GCPtr & ~(RT_BIT_64(iPdPt << X86_PDPT_SHIFT) - 1); 1646 1643 enmKind = PGMPOOLKIND_64BIT_PD_FOR_PHYS; 1647 1644 } … … 1740 1737 * PML4 level. 1741 1738 */ 1742 1743 1739 PEPTPML4 pPml4 = (PEPTPML4)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)); 1744 1740 Assert(pPml4); … … 1754 1750 { 1755 1751 RTGCPTR64 GCPml4 = (RTGCPTR64)iPml4 << EPT_PML4_SHIFT; 1756 1757 1752 rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1758 1753 pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, false /*fLockPage*/, … … 1793 1788 if (!(Pdpe.u & (EPT_E_PG_MASK | EPT_E_READ))) 1794 1789 { 1795 RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT;1790 RTGCPTR64 const GCPdPt = GCPtr & ~(RT_BIT_64(EPT_PDPT_SHIFT) - 1); 1796 1791 rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_EPT_PD_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1797 1792 pShwPage->idx, iPdPt, false /*fLockPage*/,
Note:
See TracChangeset
for help on using the changeset viewer.