Changeset 107179 in vbox for trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
- Timestamp:
- Nov 29, 2024 11:23:32 AM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r107171 r107179 1638 1638 1639 1639 1640 #ifndef VBOX_WITH_ONLY_PGM_NEM_MODE 1640 1641 /** 1641 1642 * Resolves an MMIO2 page. … … 1656 1657 AssertReturn(hMmio2 <= cMmio2Ranges, NULL); 1657 1658 AssertCompile(RT_ELEMENTS(pVM->pgm.s.apMmio2RamRanges) == RT_ELEMENTS(pVM->pgm.s.aMmio2Ranges)); 1658 # ifdef IN_RING01659 # ifdef IN_RING0 1659 1660 AssertCompile(RT_ELEMENTS(pVM->pgmr0.s.apMmio2RamRanges) == RT_ELEMENTS(pVM->pgm.s.aMmio2Ranges)); 1660 1661 AssertCompile(RT_ELEMENTS(pVM->pgmr0.s.acMmio2RangePages) == RT_ELEMENTS(pVM->pgm.s.aMmio2Ranges)); 1661 # endif1662 # endif 1662 1663 uint32_t const idxFirst = hMmio2 - 1U; 1663 1664 1664 1665 /* Must check the first one for PGMREGMMIO2RANGE_F_FIRST_CHUNK. */ 1665 1666 AssertReturn(pVM->pgm.s.aMmio2Ranges[idxFirst].fFlags & PGMREGMMIO2RANGE_F_FIRST_CHUNK, NULL); 1666 # ifdef IN_RING01667 # ifdef IN_RING0 1667 1668 AssertReturn(pVM->pgmr0.s.ahMmio2MapObjs[idxFirst] != NIL_RTR0MEMOBJ, NULL); /* Only the first chunk has a backing object. */ 1668 # endif1669 # endif 1669 1670 1670 1671 /* Loop thru the sub-ranges till we find the one covering offMmio2. */ 1671 1672 for (uint32_t idx = idxFirst; idx < cMmio2Ranges; idx++) 1672 1673 { 1673 # ifdef IN_RING31674 # ifdef IN_RING3 1674 1675 AssertReturn(pVM->pgm.s.aMmio2Ranges[idx].pDevInsR3 == pDevIns, NULL); 1675 # else1676 # else 1676 1677 AssertReturn(pVM->pgm.s.aMmio2Ranges[idx].pDevInsR3 == pDevIns->pDevInsForR3, NULL); 1677 # endif1678 # endif 1678 1679 1679 1680 /* Does it match the offset? */ 1680 1681 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apMmio2RamRanges[idx]; 1681 1682 AssertReturn(pRamRange, NULL); 1682 # ifdef IN_RING31683 # ifdef IN_RING3 1683 1684 RTGCPHYS const cbRange = RT_MIN(pRamRange->cb, pVM->pgm.s.aMmio2Ranges[idx].cbReal); 1684 # else1685 # else 1685 1686 RTGCPHYS const cbRange = RT_MIN(pRamRange->cb, (RTGCPHYS)pVM->pgmr0.s.acMmio2RangePages[idx] << GUEST_PAGE_SHIFT); 1686 # endif1687 # endif 1687 1688 if (offMmio2Page < cbRange) 1688 1689 return &pRamRange->aPages[offMmio2Page >> GUEST_PAGE_SHIFT]; … … 1695 1696 return NULL; 1696 1697 } 1698 #endif /* !VBOX_WITH_ONLY_PGM_NEM_MODE */ 1697 1699 1698 1700
Note:
See TracChangeset
for help on using the changeset viewer.