Changeset 93597 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Feb 3, 2022 9:45:05 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 149734
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/MMHyper.cpp
r93554 r93597 663 663 664 664 /** 665 * Convert hypervisor HC virtual address to HC physical address.666 *667 * @returns HC physical address.668 * @param pVM The cross context VM structure.669 * @param pvR3 Host context virtual address.670 */671 VMMR3DECL(RTHCPHYS) MMR3HyperHCVirt2HCPhys(PVM pVM, void *pvR3)672 {673 PMMLOOKUPHYPER pLookup = (PMMLOOKUPHYPER)((uint8_t *)pVM->mm.s.pHyperHeapR3 + pVM->mm.s.offLookupHyper);674 for (;;)675 {676 switch (pLookup->enmType)677 {678 case MMLOOKUPHYPERTYPE_LOCKED:679 {680 unsigned off = (uint8_t *)pvR3 - (uint8_t *)pLookup->u.Locked.pvR3;681 if (off < pLookup->cb)682 return pLookup->u.Locked.paHCPhysPages[off >> HOST_PAGE_SHIFT] | (off & HOST_PAGE_OFFSET_MASK);683 break;684 }685 686 case MMLOOKUPHYPERTYPE_HCPHYS:687 {688 unsigned off = (uint8_t *)pvR3 - (uint8_t *)pLookup->u.HCPhys.pvR3;689 if (off < pLookup->cb)690 return pLookup->u.HCPhys.HCPhys + off;691 break;692 }693 694 case MMLOOKUPHYPERTYPE_GCPHYS:695 case MMLOOKUPHYPERTYPE_MMIO2:696 case MMLOOKUPHYPERTYPE_DYNAMIC:697 /* can (or don't want to) convert these kind of records. */698 break;699 700 default:701 AssertMsgFailed(("enmType=%d\n", pLookup->enmType));702 break;703 }704 705 /* next */706 if ((unsigned)pLookup->offNext == NIL_OFFSET)707 break;708 pLookup = (PMMLOOKUPHYPER)((uint8_t *)pLookup + pLookup->offNext);709 }710 711 AssertMsgFailed(("pvR3=%p is not inside the hypervisor memory area!\n", pvR3));712 return NIL_RTHCPHYS;713 }714 715 716 /**717 665 * Info handler for 'hma', it dumps the list of lookup records for the hypervisor memory area. 718 666 *
Note:
See TracChangeset
for help on using the changeset viewer.