Changeset 55900 in vbox
- Timestamp:
- May 18, 2015 10:17:35 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pgm.h
r55899 r55900 74 74 /** Pointer to a relocation callback function. */ 75 75 typedef FNPGMRELOCATE *PFNPGMRELOCATE; 76 77 78 /** 79 * Memory access origin. 80 */ 81 typedef enum PGMACCESSORIGIN 82 { 83 /** Invalid zero value. */ 84 PGMACCESSORIGIN_INVALID = 0, 85 /** IEM is access memory. */ 86 PGMACCESSORIGIN_IEM, 87 /** HM is access memory. */ 88 PGMACCESSORIGIN_HM, 89 /** Some device is access memory. */ 90 PGMACCESSORIGIN_DEVICE, 91 /** Someone debugging is access memory. */ 92 PGMACCESSORIGIN_DEBUGGER, 93 /** SELM is access memory. */ 94 PGMACCESSORIGIN_SELM, 95 /** FTM is access memory. */ 96 PGMACCESSORIGIN_FTM, 97 /** REM is access memory. */ 98 PGMACCESSORIGIN_REM, 99 /** IOM is access memory. */ 100 PGMACCESSORIGIN_IOM, 101 /** End of valid values. */ 102 PGMACCESSORIGIN_END, 103 /** Type size hack. */ 104 PGMACCESSORIGIN_32BIT_HACK = 0x7fffffff 105 } PGMACCESSORIGIN; 76 106 77 107 … … 182 212 * @returns VBox status code (appropriate for GC return). 183 213 * @param pVM VM Handle. 214 * @param pVCpu Pointer to the cross context CPU context for the 215 * calling EMT. 184 216 * @param uErrorCode CPU Error code (X86_TRAP_PF_XXX). 185 217 * @param pRegFrame Trap register frame. … … 189 221 * (If it's a EIP range this is the EIP, if not it's pvFault.) 190 222 * @param pvUser User argument. 191 * @todo Add pVCpu, possibly replacing pVM.192 223 */ 193 224 typedef DECLCALLBACK(int) FNPGMRCVIRTPFHANDLER(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, … … 212 243 * @param cbBuf How much it's reading/writing. 213 244 * @param enmAccessType The access type. 245 * @param enmOrigin Who is calling. 214 246 * @param pvUser User argument. 215 * @todo Add pVCpu, possibly replacing pVM. 216 */ 217 typedef DECLCALLBACK(int) FNPGMR3VIRTHANDLER(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 218 PGMACCESSTYPE enmAccessType, void *pvUser); 247 */ 248 typedef DECLCALLBACK(int) FNPGMR3VIRTHANDLER(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 249 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser); 219 250 /** Pointer to PGM access callback. */ 220 251 typedef FNPGMR3VIRTHANDLER *PFNPGMR3VIRTHANDLER; 221 252 222 223 253 /** 224 254 * \#PF Handler callback for invalidation of virtual access handler ranges. 225 255 * 226 256 * @param pVM VM Handle. 257 * @param pVCpu Pointer to the cross context CPU context for the 258 * calling EMT. 227 259 * @param GCPtr The virtual address the guest has changed. 228 260 * @param pvUser User argument. 229 261 */ 230 typedef DECLCALLBACK(int) FNPGMR3VIRTINVALIDATE(PVM pVM, RTGCPTR GCPtr, void *pvUser);262 typedef DECLCALLBACK(int) FNPGMR3VIRTINVALIDATE(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvUser); 231 263 /** Pointer to PGM invalidation callback. */ 232 264 typedef FNPGMR3VIRTINVALIDATE *PFNPGMR3VIRTINVALIDATE; 265 233 266 234 267 /** … … 244 277 /** Pointer to PGMR3PhysEnumDirtyFTPages callback. */ 245 278 typedef FNPGMENUMDIRTYFTPAGES *PFNPGMENUMDIRTYFTPAGES; 279 246 280 247 281 /** … … 400 434 VMMDECL(int) PGMPhysGCPtr2GCPhys(PVMCPU pVCpu, RTGCPTR GCPtr, PRTGCPHYS pGCPhys); 401 435 VMMDECL(void) PGMPhysReleasePageMappingLock(PVM pVM, PPGMPAGEMAPLOCK pLock); 402 /** Memory access origin. */403 typedef enum PGMACCESSORIGIN404 {405 PGMACCESSORIGIN_INVALID = 0,406 PGMACCESSORIGIN_IEM,407 PGMACCESSORIGIN_HM,408 PGMACCESSORIGIN_DEVICE,409 PGMACCESSORIGIN_DEBUGGER,410 PGMACCESSORIGIN_SELM,411 PGMACCESSORIGIN_FTM,412 PGMACCESSORIGIN_IOM,413 PGMACCESSORIGIN_REM,414 PGMACCESSORIGIN_END,415 PGMACCESSORIGIN_32BIT_HACK = 0x7fffffff416 } PGMACCESSORIGIN;417 436 VMMDECL(int) PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, PGMACCESSORIGIN enmOrigin); 418 437 VMMDECL(int) PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, PGMACCESSORIGIN enmOrigin); -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r55899 r55900 2082 2082 * @param pvBuf Where to put the bits we read. 2083 2083 * @param cb How much to read - less or equal to a page. 2084 */ 2085 static int pgmPhysReadHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void *pvBuf, size_t cb) 2084 * @param enmOrigin The origin of this call. 2085 */ 2086 static int pgmPhysReadHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void *pvBuf, size_t cb, PGMACCESSORIGIN enmOrigin) 2086 2087 { 2087 2088 /* … … 2108 2109 * Deal with any physical handlers. 2109 2110 */ 2111 PVMCPU pVCpu = VMMGetCpu(pVM); 2110 2112 #ifdef IN_RING3 2111 2113 PPGMPHYSHANDLER pPhys = NULL; … … 2174 2176 2175 2177 STAM_PROFILE_START(&pVirt->Stat, h); 2176 rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, (void *)pvSrc, pvBuf, cb, PGMACCESSTYPE_READ,2178 rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, (void *)pvSrc, pvBuf, cb, PGMACCESSTYPE_READ, enmOrigin, 2177 2179 pVirt->CTX_SUFF(pvUser)); 2178 2180 STAM_PROFILE_STOP(&pVirt->Stat, h); … … 2254 2256 || PGM_PAGE_IS_SPECIAL_ALIAS_MMIO(pPage))) 2255 2257 { 2256 int rc = pgmPhysReadHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb );2258 int rc = pgmPhysReadHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb, enmOrigin); 2257 2259 if (RT_FAILURE(rc)) 2258 2260 { … … 2337 2339 * @param pvBuf What to write. 2338 2340 * @param cbWrite How much to write - less or equal to a page. 2339 */ 2340 static int pgmPhysWriteHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const *pvBuf, size_t cbWrite) 2341 * @param enmOrigin The origin of this call. 2342 */ 2343 static int pgmPhysWriteHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const *pvBuf, size_t cbWrite, 2344 PGMACCESSORIGIN enmOrigin) 2341 2345 { 2342 2346 PGMPAGEMAPLOCK PgMpLck; … … 2351 2355 * the heavy usage of full page handlers in the page pool. 2352 2356 */ 2357 PVMCPU pVCpu = VMMGetCpu(pVM); 2353 2358 if ( !PGM_PAGE_HAS_ACTIVE_VIRTUAL_HANDLERS(pPage) 2354 2359 || PGM_PAGE_IS_MMIO_OR_SPECIAL_ALIAS(pPage) /* screw virtual handlers on MMIO pages */) … … 2461 2466 2462 2467 STAM_PROFILE_START(&pCur->Stat, h); 2463 rc = pCurType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,2464 pCur->CTX_SUFF(pvUser));2468 rc = pCurType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, 2469 enmOrigin, pCur->CTX_SUFF(pvUser)); 2465 2470 STAM_PROFILE_STOP(&pCur->Stat, h); 2466 2471 } … … 2649 2654 + (GCPhys & PAGE_OFFSET_MASK); 2650 2655 STAM_PROFILE_START(&pVirt->Stat, h); 2651 rc = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,2652 pVirt->CTX_SUFF(pvUser));2656 rc = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, 2657 enmOrigin, pVirt->CTX_SUFF(pvUser)); 2653 2658 STAM_PROFILE_STOP(&pVirt->Stat, h); 2654 2659 AssertLogRelMsg(rc == VINF_SUCCESS || rc == VINF_PGM_HANDLER_DO_DEFAULT, ("rc=%Rrc GCPhys=%RGp pPage=%R[pgmpage] %s\n", rc, GCPhys, pPage, pVirt->pszDesc)); … … 2704 2709 + (GCPhys & PAGE_OFFSET_MASK); 2705 2710 STAM_PROFILE_START(&pVirt->Stat, h2); 2706 int rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE,2707 pVirt->CTX_SUFF(pvUser));2711 int rc2 = pVirtType->CTX_SUFF(pfnHandler)(pVM, pVCpu, GCPtr, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, 2712 enmOrigin, pVirt->CTX_SUFF(pvUser)); 2708 2713 STAM_PROFILE_STOP(&pVirt->Stat, h2); 2709 2714 if (rc2 == VINF_SUCCESS && rc == VINF_PGM_HANDLER_DO_DEFAULT) … … 2801 2806 || PGM_PAGE_IS_SPECIAL_ALIAS_MMIO(pPage)) 2802 2807 { 2803 int rc = pgmPhysWriteHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb );2808 int rc = pgmPhysWriteHandler(pVM, pPage, pRam->GCPhys + off, pvBuf, cb, enmOrigin); 2804 2809 if (RT_FAILURE(rc)) 2805 2810 { -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r55897 r55900 2172 2172 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 2173 2173 * @param pVM Pointer to the VM. 2174 * @param pVCpu Pointer to the cross context CPU context for the 2175 * calling EMT. 2174 2176 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 2175 2177 * @param pvPtr The HC mapping of that address. … … 2177 2179 * @param cbBuf How much it's reading/writing. 2178 2180 * @param enmAccessType The access type. 2181 * @param enmOrigin Who is making this write. 2179 2182 * @param pvUser User argument. 2180 2183 */ 2181 static DECLCALLBACK(int) csamR3CodePageWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf,2182 PGMACCESSTYPE enmAccessType, void *pvUser)2184 static DECLCALLBACK(int) csamR3CodePageWriteHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 2185 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 2183 2186 { 2184 2187 int rc; … … 2199 2202 else 2200 2203 { 2204 AssertFailed(); /* PGM should make sure this does not happen anymore! */ 2201 2205 /* Queue the write instead otherwise we'll get concurrency issues. */ 2202 2206 /** @note in theory not correct to let it write the data first before disabling a patch! … … 2216 2220 * 2217 2221 * @param pVM Pointer to the VM. 2222 * @param pVCpu Pointer to the cross context CPU context for the 2223 * calling EMT. 2218 2224 * @param GCPtr The virtual address the guest has changed. 2219 2225 */ 2220 static DECLCALLBACK(int) csamR3CodePageInvalidate(PVM pVM, RTGCPTR GCPtr, void *pvUser)2226 static DECLCALLBACK(int) csamR3CodePageInvalidate(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvUser) 2221 2227 { 2222 2228 g_fInCsamR3CodePageInvalidate = true; -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r55897 r55900 984 984 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 985 985 * @param pVM Pointer to the VM. 986 * @param pVCpu Pointer to the cross context CPU context for the 987 * calling EMT. 986 988 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 987 989 * @param pvPtr The HC mapping of that address. … … 989 991 * @param cbBuf How much it's reading/writing. 990 992 * @param enmAccessType The access type. 991 * @param pvUser User argument. 992 */ 993 static DECLCALLBACK(int) patmR3VirtPageHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 994 PGMACCESSTYPE enmAccessType, void *pvUser) 993 * @param enmOrigin Who is making this write. 994 * @param pvUser The address of the guest page we're monitoring. 995 */ 996 static DECLCALLBACK(int) patmR3VirtPageHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 997 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 995 998 { 996 999 Assert(enmAccessType == PGMACCESSTYPE_WRITE); NOREF(enmAccessType); 997 NOREF(p vPtr); NOREF(pvBuf); NOREF(cbBuf); NOREF(pvUser);1000 NOREF(pVCpu); NOREF(pvPtr); NOREF(pvBuf); NOREF(cbBuf); NOREF(enmOrigin); NOREF(pvUser); 998 1001 999 1002 /** @todo could be the wrong virtual address (alias) */ -
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r55897 r55900 1491 1491 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 1492 1492 * @param pVM Pointer to the VM. 1493 * @param pVCpu Pointer to the cross context CPU context for the 1494 * calling EMT. 1493 1495 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 1494 1496 * @param pvPtr The HC mapping of that address. … … 1496 1498 * @param cbBuf How much it's reading/writing. 1497 1499 * @param enmAccessType The access type. 1498 * @param pvUser User argument. 1499 */ 1500 static DECLCALLBACK(int) selmR3GuestGDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1501 PGMACCESSTYPE enmAccessType, void *pvUser) 1500 * @param enmOrigin Who is making this write. 1501 * @param pvUser Unused. 1502 */ 1503 static DECLCALLBACK(int) selmR3GuestGDTWriteHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1504 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 1502 1505 { 1503 1506 Assert(enmAccessType == PGMACCESSTYPE_WRITE); NOREF(enmAccessType); 1504 1507 Log(("selmR3GuestGDTWriteHandler: write to %RGv size %d\n", GCPtr, cbBuf)); NOREF(GCPtr); NOREF(cbBuf); 1505 NOREF(pvPtr); NOREF(pvBuf); NOREF( pvUser);1506 1507 VMCPU_FF_SET( VMMGetCpu(pVM), VMCPU_FF_SELM_SYNC_GDT);1508 NOREF(pvPtr); NOREF(pvBuf); NOREF(enmOrigin); NOREF(pvUser); 1509 1510 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT); 1508 1511 return VINF_PGM_HANDLER_DO_DEFAULT; 1509 1512 } … … 1520 1523 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 1521 1524 * @param pVM Pointer to the VM. 1525 * @param pVCpu Pointer to the cross context CPU context for the 1526 * calling EMT. 1522 1527 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 1523 1528 * @param pvPtr The HC mapping of that address. … … 1525 1530 * @param cbBuf How much it's reading/writing. 1526 1531 * @param enmAccessType The access type. 1527 * @param pvUser User argument. 1528 */ 1529 static DECLCALLBACK(int) selmR3GuestLDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1530 PGMACCESSTYPE enmAccessType, void *pvUser) 1532 * @param enmOrigin Who is making this write. 1533 * @param pvUser Unused. 1534 */ 1535 static DECLCALLBACK(int) selmR3GuestLDTWriteHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1536 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 1531 1537 { 1532 1538 Assert(enmAccessType == PGMACCESSTYPE_WRITE); NOREF(enmAccessType); 1533 1539 Log(("selmR3GuestLDTWriteHandler: write to %RGv size %d\n", GCPtr, cbBuf)); NOREF(GCPtr); NOREF(cbBuf); 1534 NOREF(pvPtr); NOREF(pvBuf); NOREF( pvUser);1535 1536 VMCPU_FF_SET( VMMGetCpu(pVM), VMCPU_FF_SELM_SYNC_LDT);1540 NOREF(pvPtr); NOREF(pvBuf); NOREF(enmOrigin); NOREF(pvUser); 1541 1542 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 1537 1543 return VINF_PGM_HANDLER_DO_DEFAULT; 1538 1544 } … … 1550 1556 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 1551 1557 * @param pVM Pointer to the VM. 1558 * @param pVCpu Pointer to the cross context CPU context for the 1559 * calling EMT. 1552 1560 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 1553 1561 * @param pvPtr The HC mapping of that address. … … 1555 1563 * @param cbBuf How much it's reading/writing. 1556 1564 * @param enmAccessType The access type. 1557 * @param pvUser User argument. 1558 */ 1559 static DECLCALLBACK(int) selmR3GuestTSSWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1560 PGMACCESSTYPE enmAccessType, void *pvUser) 1565 * @param enmOrigin Who is making this write. 1566 * @param pvUser Unused. 1567 */ 1568 static DECLCALLBACK(int) selmR3GuestTSSWriteHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1569 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 1561 1570 { 1562 1571 Assert(enmAccessType == PGMACCESSTYPE_WRITE); NOREF(enmAccessType); 1563 1572 Log(("selmR3GuestTSSWriteHandler: write %.*Rhxs to %RGv size %d\n", RT_MIN(8, cbBuf), pvBuf, GCPtr, cbBuf)); 1564 NOREF(pvBuf); NOREF(GCPtr); NOREF(cbBuf); NOREF( pvUser);NOREF(pvPtr);1573 NOREF(pvBuf); NOREF(GCPtr); NOREF(cbBuf); NOREF(enmOrigin); NOREF(pvUser); NOREF(pvPtr); 1565 1574 1566 1575 /** @todo This can be optimized by checking for the ESP0 offset and tracking TR … … 1569 1578 * changes while we're in REM. */ 1570 1579 1571 VMCPU_FF_SET( VMMGetCpu(pVM), VMCPU_FF_SELM_SYNC_TSS);1580 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 1572 1581 return VINF_PGM_HANDLER_DO_DEFAULT; 1573 1582 } -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r55897 r55900 442 442 static DECLCALLBACK(int) trpmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 443 443 #ifdef TRPM_TRACK_GUEST_IDT_CHANGES 444 static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);444 static FNPGMR3VIRTHANDLER trpmR3GuestIDTWriteHandler; 445 445 #endif 446 446 … … 1181 1181 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 1182 1182 * @param pVM Pointer to the VM. 1183 * @param pVCpu Pointer to the cross context CPU context for the 1184 * calling EMT. 1183 1185 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 1184 1186 * @param pvPtr The HC mapping of that address. … … 1186 1188 * @param cbBuf How much it's reading/writing. 1187 1189 * @param enmAccessType The access type. 1190 * @param enmOrigin The origin of this call. 1188 1191 * @param pvUser User argument. 1189 1192 */ 1190 static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf,1191 PGMACCESSTYPE enmAccessType, void *pvUser)1193 static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, 1194 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 1192 1195 { 1193 1196 Assert(enmAccessType == PGMACCESSTYPE_WRITE); NOREF(enmAccessType); 1194 1197 Log(("trpmR3GuestIDTWriteHandler: write to %RGv size %d\n", GCPtr, cbBuf)); NOREF(GCPtr); NOREF(cbBuf); 1195 NOREF(pvPtr); NOREF(pvUser); NOREF(pvBuf); 1198 NOREF(pvPtr); NOREF(pvUser); NOREF(pvBuf); NOREF(enmOrigin); NOREF(pvUser); 1196 1199 Assert(!HMIsEnabled(pVM)); 1197 1200 1198 VMCPU_FF_SET( VMMGetCpu(pVM), VMCPU_FF_TRPM_SYNC_IDT);1201 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 1199 1202 return VINF_PGM_HANDLER_DO_DEFAULT; 1200 1203 } -
trunk/src/VBox/VMM/VMMRC/CSAMRC.cpp
r55895 r55900 57 57 * @returns VBox status code (appropriate for GC return). 58 58 * @param pVM Pointer to the VM. 59 * @param uErrorCode CPU Error code. 59 * @param pVCpu Pointer to the cross context CPU context for the calling 60 * EMT. 61 * @param uErrorCode CPU Error code. 60 62 * @param pRegFrame Trap register frame. 61 63 * @param pvFault The fault address (cr2). … … 65 67 * @param pvUser Ignored. 66 68 */ 67 DECLEXPORT(int) csamRCCodePageWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,69 DECLEXPORT(int) csamRCCodePageWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 68 70 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 69 71 { … … 71 73 bool fPatchCode = PATMIsPatchGCAddr(pVM, pRegFrame->eip); 72 74 int rc; 73 PVMCPU pVCpu = VMMGetCpu0(pVM);74 75 NOREF(uErrorCode); 75 76 -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r55895 r55900 50 50 * @returns VBox status code (appropriate for trap handling and GC return). 51 51 * @param pVM Pointer to the VM. 52 * @param uErrorCode CPU Error code. 52 * @param pVCpu Pointer to the cross context CPU context for the 53 * calling EMT. 54 * @param uErrorCode CPU Error code. 53 55 * @param pRegFrame Trap register frame. 54 56 * @param pvFault The fault address (cr2). … … 56 58 * @param offRange The offset of the access into this range. 57 59 * (If it's a EIP range this is the EIP, if not it's pvFault.) 60 * @param pvUser The physical address of the guest page being monitored. 58 61 */ 59 DECLEXPORT(int) patmRCVirtPagePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,62 DECLEXPORT(int) patmRCVirtPagePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 60 63 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 61 64 { 62 NOREF( uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange);65 NOREF(pVCpu); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 63 66 pVM->patm.s.pvFaultMonitor = (RTRCPTR)(RTRCUINTPTR)pvFault; 64 67 return VINF_PATM_CHECK_PATCH_PAGE; -
trunk/src/VBox/VMM/VMMRC/SELMRC.cpp
r55895 r55900 228 228 * @returns VBox status code (appropriate for trap handling and GC return). 229 229 * @param pVM Pointer to the VM. 230 * @param pVCpu Pointer to the cross context CPU context for the 231 * calling EMT. 230 232 * @param uErrorCode CPU Error code. 231 233 * @param pRegFrame Trap register frame. … … 235 237 * (If it's a EIP range this is the EIP, if not it's pvFault.) 236 238 */ 237 DECLEXPORT(int) selmRCGuestGDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,239 DECLEXPORT(int) selmRCGuestGDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 238 240 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 239 241 { 240 PVMCPU pVCpu = VMMGetCpu0(pVM);241 242 LogFlow(("selmRCGuestGDTWritePfHandler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange)); 242 243 NOREF(pvRange); NOREF(pvUser); … … 322 323 * @returns VBox status code (appropriate for trap handling and GC return). 323 324 * @param pVM Pointer to the VM. 325 * @param pVCpu Pointer to the cross context CPU context for the 326 * calling EMT. 324 327 * @param uErrorCode CPU Error code. 325 328 * @param pRegFrame Trap register frame. … … 330 333 * @param pvUser Unused. 331 334 */ 332 DECLEXPORT(int) selmRCGuestLDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,335 DECLEXPORT(int) selmRCGuestLDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 333 336 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 334 337 { … … 337 340 NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 338 341 339 VMCPU_FF_SET( VMMGetCpu0(pVM), VMCPU_FF_SELM_SYNC_LDT);342 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 340 343 STAM_COUNTER_INC(&pVM->selm.s.StatRCWriteGuestLDT); 341 344 return VINF_EM_RAW_EMULATE_INSTR_LDT_FAULT; … … 377 380 * @returns VBox status code (appropriate for trap handling and GC return). 378 381 * @param pVM Pointer to the VM. 382 * @param pVCpu Pointer to the cross context CPU context for the 383 * calling EMT. 379 384 * @param uErrorCode CPU Error code. 380 385 * @param pRegFrame Trap register frame. … … 385 390 * @param pvUser Unused. 386 391 */ 387 DECLEXPORT(int) selmRCGuestTSSWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,392 DECLEXPORT(int) selmRCGuestTSSWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 388 393 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 389 394 { 390 PVMCPU pVCpu = VMMGetCpu0(pVM);391 395 LogFlow(("selmRCGuestTSSWritePfHandler errcode=%x fault=%RGv offRange=%08x\n", (uint32_t)uErrorCode, pvFault, offRange)); 392 396 NOREF(pvRange); NOREF(pvUser); … … 532 536 * @returns VBox status code (appropriate for trap handling and GC return). 533 537 * @param pVM Pointer to the VM. 538 * @param pVCpu Pointer to the cross context CPU context for the 539 * calling EMT. 534 540 * @param uErrorCode CPU Error code. 535 541 * @param pRegFrame Trap register frame. … … 540 546 * @param pvUser Unused. 541 547 */ 542 DECLEXPORT(int) selmRCShadowGDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,548 DECLEXPORT(int) selmRCShadowGDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 543 549 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 544 550 { 545 551 LogRel(("FATAL ERROR: selmRCShadowGDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 546 NOREF(pVM); NOREF( uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser);552 NOREF(pVM); NOREF(pVCpu); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 547 553 return VERR_SELM_SHADOW_GDT_WRITE; 548 554 } … … 556 562 * @returns VBox status code (appropriate for trap handling and GC return). 557 563 * @param pVM Pointer to the VM. 564 * @param pVCpu Pointer to the cross context CPU context for the 565 * calling EMT. 558 566 * @param uErrorCode CPU Error code. 559 567 * @param pRegFrame Trap register frame. … … 564 572 * @param pvUser Unused. 565 573 */ 566 DECLEXPORT(int) selmRCShadowLDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,574 DECLEXPORT(int) selmRCShadowLDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 567 575 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 568 576 { 569 577 LogRel(("FATAL ERROR: selmRCShadowLDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 570 578 Assert(pvFault - (uintptr_t)pVM->selm.s.pvLdtRC < (unsigned)(65536U + PAGE_SIZE)); 571 NOREF(pVM); NOREF( uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser);579 NOREF(pVM); NOREF(pVCpu); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 572 580 return VERR_SELM_SHADOW_LDT_WRITE; 573 581 } … … 581 589 * @returns VBox status code (appropriate for trap handling and GC return). 582 590 * @param pVM Pointer to the VM. 591 * @param pVCpu Pointer to the cross context CPU context for the 592 * calling EMT. 583 593 * @param uErrorCode CPU Error code. 584 594 * @param pRegFrame Trap register frame. … … 589 599 * @param pvUser Unused. 590 600 */ 591 DECLEXPORT(int) selmRCShadowTSSWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,601 DECLEXPORT(int) selmRCShadowTSSWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 592 602 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 593 603 { 594 604 LogRel(("FATAL ERROR: selmRCShadowTSSWritePfHandler: eip=%08X pvFault=%RGv pvRange=%RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 595 NOREF(pVM); NOREF( uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser);605 NOREF(pVM); NOREF(pVCpu); NOREF(uErrorCode); NOREF(pRegFrame); NOREF(pvFault); NOREF(pvRange); NOREF(offRange); NOREF(pvUser); 596 606 return VERR_SELM_SHADOW_TSS_WRITE; 597 607 } -
trunk/src/VBox/VMM/VMMRC/TRPMRC.cpp
r55895 r55900 95 95 * @returns VBox status code (appropriate for trap handling and GC return). 96 96 * @param pVM Pointer to the VM. 97 * @param pVCpu Pointer to the cross context CPU context for the 98 * calling EMT. 97 99 * @param uErrorCode CPU Error code. 98 100 * @param pRegFrame Trap register frame. … … 103 105 * @param pvUser Unused. 104 106 */ 105 DECLEXPORT(int) trpmRCGuestIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,107 DECLEXPORT(int) trpmRCGuestIDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 106 108 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 107 109 { 108 PVMCPU pVCpu = VMMGetCpu0(pVM);109 110 uint16_t cbIDT; 110 111 RTGCPTR GCPtrIDT = (RTGCPTR)CPUMGetGuestIDTR(pVCpu, &cbIDT); … … 160 161 * @returns VBox status code (appropriate for trap handling and GC return). 161 162 * @param pVM Pointer to the VM. 162 * @param uErrorCode CPU Error code. 163 * @param pVCpu Pointer to the cross context CPU context for the 164 * calling EMT. 165 * @param uErrorCode CPU Error code. 163 166 * @param pRegFrame Trap register frame. 164 167 * @param pvFault The fault address (cr2). … … 168 171 * @param pvUser Unused. 169 172 */ 170 DECLEXPORT(int) trpmRCShadowIDTWritePfHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault,173 DECLEXPORT(int) trpmRCShadowIDTWritePfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 171 174 RTGCPTR pvRange, uintptr_t offRange, void *pvUser) 172 175 { 173 PVMCPU pVCpu = VMMGetCpu0(pVM);174 176 LogRel(("FATAL ERROR: trpmRCShadowIDTWritePfHandler: eip=%08X pvFault=%RGv pvRange=%08RGv\r\n", pRegFrame->eip, pvFault, pvRange)); 175 177 NOREF(uErrorCode); NOREF(offRange); NOREF(pvUser);
Note:
See TracChangeset
for help on using the changeset viewer.