- Timestamp:
- Nov 25, 2008 8:48:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/MMAll.cpp
r14597 r14599 44 44 DECLINLINE(PMMLOOKUPHYPER) mmHyperLookupR3(PVM pVM, RTR3PTR R3Ptr, uint32_t *poff) 45 45 { 46 /** @todo cache last lookup this stuff ain't cheap! */46 /** @todo cache last lookup, this stuff ain't cheap! */ 47 47 PMMLOOKUPHYPER pLookup = (PMMLOOKUPHYPER)((uint8_t *)pVM->mm.s.CTX_SUFF(pHyperHeap) + pVM->mm.s.offLookupHyper); 48 48 for (;;) … … 88 88 } 89 89 90 AssertMsgFailed(("R3Ptr=% pis not inside the hypervisor memory area!\n", R3Ptr));90 AssertMsgFailed(("R3Ptr=%RHv is not inside the hypervisor memory area!\n", R3Ptr)); 91 91 return NULL; 92 92 } … … 106 106 AssertCompile(sizeof(RTR0PTR) == sizeof(RTR3PTR)); 107 107 108 /* 109 * Translate Ring-0 VM addresses into Ring-3 VM addresses before feeding it to mmHyperLookupR3. 110 */ 111 /** @todo fix this properly; the ring 0 pVM address differs from the R3 one. (#1865) */ 112 RTR0UINTPTR offVM = (RTR0UINTPTR)R0Ptr - (RTR0UINTPTR)pVM->pVMR0; 113 RTR3PTR R3Ptr = offVM < sizeof(*pVM) 114 ? (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + offVM) 115 : (RTR3PTR)R0Ptr; 116 117 return mmHyperLookupR3(pVM, R3Ptr, poff); 108 /** @todo cache last lookup, this stuff ain't cheap! */ 109 PMMLOOKUPHYPER pLookup = (PMMLOOKUPHYPER)((uint8_t *)pVM->mm.s.CTX_SUFF(pHyperHeap) + pVM->mm.s.offLookupHyper); 110 for (;;) 111 { 112 switch (pLookup->enmType) 113 { 114 case MMLOOKUPHYPERTYPE_LOCKED: 115 { 116 const uint32_t off = (RTR3UINTPTR)R0Ptr - (RTR0UINTPTR)pLookup->u.Locked.pvR0; 117 if (off < pLookup->cb && pLookup->u.Locked.pvR0) 118 { 119 *poff = off; 120 return pLookup; 121 } 122 break; 123 } 124 125 case MMLOOKUPHYPERTYPE_HCPHYS: 126 { 127 const uint32_t off = (RTR0UINTPTR)R0Ptr - (RTR0UINTPTR)pLookup->u.HCPhys.pvR0; 128 if (off < pLookup->cb && pLookup->u.HCPhys.pvR0) 129 { 130 *poff = off; 131 return pLookup; 132 } 133 break; 134 } 135 136 case MMLOOKUPHYPERTYPE_GCPHYS: /* (for now we'll not allow these kind of conversions) */ 137 case MMLOOKUPHYPERTYPE_MMIO2: 138 case MMLOOKUPHYPERTYPE_DYNAMIC: 139 break; 140 141 default: 142 AssertMsgFailed(("enmType=%d\n", pLookup->enmType)); 143 break; 144 } 145 146 /* next */ 147 if (pLookup->offNext == (int32_t)NIL_OFFSET) 148 break; 149 pLookup = (PMMLOOKUPHYPER)((uint8_t *)pLookup + pLookup->offNext); 150 } 151 152 AssertMsgFailed(("R0Ptr=%RHv is not inside the hypervisor memory area!\n", R0Ptr)); 153 return NULL; 118 154 } 119 155 … … 157 193 } 158 194 159 AssertMsgFailed((" GCPtr=%pis not inside the hypervisor memory area!\n", RCPtr));195 AssertMsgFailed(("RCPtr=%RRv is not inside the hypervisor memory area!\n", RCPtr)); 160 196 return NULL; 161 197 }
Note:
See TracChangeset
for help on using the changeset viewer.