Changeset 55899 in vbox
- Timestamp:
- May 18, 2015 9:47:57 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pgm.h
r55897 r55899 205 205 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 206 206 * @param pVM VM Handle. 207 * @param pVCpu Pointer to the cross context CPU context for the 208 * calling EMT. 207 209 * @param GCPtr The virtual address the guest is writing to. (not correct if it's an alias!) 208 210 * @param pvPtr The HC mapping of that address. … … 398 400 VMMDECL(int) PGMPhysGCPtr2GCPhys(PVMCPU pVCpu, RTGCPTR GCPtr, PRTGCPHYS pGCPhys); 399 401 VMMDECL(void) PGMPhysReleasePageMappingLock(PVM pVM, PPGMPAGEMAPLOCK pLock); 400 VMMDECL(int) PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead); 401 VMMDECL(int) PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite); 402 /** Memory access origin. */ 403 typedef enum PGMACCESSORIGIN 404 { 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 = 0x7fffffff 416 } PGMACCESSORIGIN; 417 VMMDECL(int) PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, PGMACCESSORIGIN enmOrigin); 418 VMMDECL(int) PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, PGMACCESSORIGIN enmOrigin); 419 VMMDECL(int) PGMPhysReadGCPtr(PVMCPU pVCpu, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, PGMACCESSORIGIN enmOrigin); 420 VMMDECL(int) PGMPhysWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb, PGMACCESSORIGIN enmOrigin); 402 421 VMMDECL(int) PGMPhysSimpleReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb); 403 422 VMMDECL(int) PGMPhysSimpleWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb); 404 423 VMMDECL(int) PGMPhysSimpleReadGCPtr(PVMCPU pVCpu, void *pvDst, RTGCPTR GCPtrSrc, size_t cb); 405 424 VMMDECL(int) PGMPhysSimpleWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb); 406 VMMDECL(int) PGMPhysReadGCPtr(PVMCPU pVCpu, void *pvDst, RTGCPTR GCPtrSrc, size_t cb);407 VMMDECL(int) PGMPhysWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb);408 425 VMMDECL(int) PGMPhysSimpleDirtyWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb); 409 426 VMMDECL(int) PGMPhysInterpretedRead(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, void *pvDst, RTGCPTR GCPtrSrc, size_t cb); … … 567 584 568 585 VMMR3DECL(int) PGMR3PhysTlbGCPhys2Ptr(PVM pVM, RTGCPHYS GCPhys, bool fWritable, void **ppv); 569 VMMR3DECL(uint8_t) PGMR3PhysReadU8(PVM pVM, RTGCPHYS GCPhys );570 VMMR3DECL(uint16_t) PGMR3PhysReadU16(PVM pVM, RTGCPHYS GCPhys );571 VMMR3DECL(uint32_t) PGMR3PhysReadU32(PVM pVM, RTGCPHYS GCPhys );572 VMMR3DECL(uint64_t) PGMR3PhysReadU64(PVM pVM, RTGCPHYS GCPhys );573 VMMR3DECL(void) PGMR3PhysWriteU8(PVM pVM, RTGCPHYS GCPhys, uint8_t Value );574 VMMR3DECL(void) PGMR3PhysWriteU16(PVM pVM, RTGCPHYS GCPhys, uint16_t Value );575 VMMR3DECL(void) PGMR3PhysWriteU32(PVM pVM, RTGCPHYS GCPhys, uint32_t Value );576 VMMR3DECL(void) PGMR3PhysWriteU64(PVM pVM, RTGCPHYS GCPhys, uint64_t Value );577 VMMR3DECL(int) PGMR3PhysReadExternal(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead );578 VMMR3DECL(int) PGMR3PhysWriteExternal(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, const char *pszWho);586 VMMR3DECL(uint8_t) PGMR3PhysReadU8(PVM pVM, RTGCPHYS GCPhys, PGMACCESSORIGIN enmOrigin); 587 VMMR3DECL(uint16_t) PGMR3PhysReadU16(PVM pVM, RTGCPHYS GCPhys, PGMACCESSORIGIN enmOrigin); 588 VMMR3DECL(uint32_t) PGMR3PhysReadU32(PVM pVM, RTGCPHYS GCPhys, PGMACCESSORIGIN enmOrigin); 589 VMMR3DECL(uint64_t) PGMR3PhysReadU64(PVM pVM, RTGCPHYS GCPhys, PGMACCESSORIGIN enmOrigin); 590 VMMR3DECL(void) PGMR3PhysWriteU8(PVM pVM, RTGCPHYS GCPhys, uint8_t Value, PGMACCESSORIGIN enmOrigin); 591 VMMR3DECL(void) PGMR3PhysWriteU16(PVM pVM, RTGCPHYS GCPhys, uint16_t Value, PGMACCESSORIGIN enmOrigin); 592 VMMR3DECL(void) PGMR3PhysWriteU32(PVM pVM, RTGCPHYS GCPhys, uint32_t Value, PGMACCESSORIGIN enmOrigin); 593 VMMR3DECL(void) PGMR3PhysWriteU64(PVM pVM, RTGCPHYS GCPhys, uint64_t Value, PGMACCESSORIGIN enmOrigin); 594 VMMR3DECL(int) PGMR3PhysReadExternal(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, PGMACCESSORIGIN enmOrigin); 595 VMMR3DECL(int) PGMR3PhysWriteExternal(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, PGMACCESSORIGIN enmOrigin); 579 596 VMMR3DECL(int) PGMR3PhysGCPhys2CCPtrExternal(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock); 580 597 VMMR3DECL(int) PGMR3PhysGCPhys2CCPtrReadOnlyExternal(PVM pVM, RTGCPHYS GCPhys, void const **ppv, PPGMPAGEMAPLOCK pLock); -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r55316 r55899 1027 1027 1028 1028 if (!pIemCpu->fBypassHandlers) 1029 rc = PGMPhysRead(pVM, GCPhys, pIemCpu->abOpcode, cbToTryRead );1029 rc = PGMPhysRead(pVM, GCPhys, pIemCpu->abOpcode, cbToTryRead, PGMACCESSORIGIN_IEM); 1030 1030 else 1031 1031 rc = PGMPhysSimpleReadGCPhys(pVM, pIemCpu->abOpcode, GCPhys, cbToTryRead); … … 1145 1145 */ 1146 1146 if (!pIemCpu->fBypassHandlers) 1147 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhys, &pIemCpu->abOpcode[pIemCpu->cbOpcode], cbToTryRead );1147 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhys, &pIemCpu->abOpcode[pIemCpu->cbOpcode], cbToTryRead, PGMACCESSORIGIN_IEM); 1148 1148 else 1149 1149 rc = PGMPhysSimpleReadGCPhys(IEMCPU_TO_VM(pIemCpu), &pIemCpu->abOpcode[pIemCpu->cbOpcode], GCPhys, cbToTryRead); … … 6430 6430 pIemCpu->aMemBbMappings[iMemMap].GCPhysFirst, 6431 6431 pbBuf, 6432 cbFirst); 6432 cbFirst, 6433 PGMACCESSORIGIN_IEM); 6433 6434 if (cbSecond && rc == VINF_SUCCESS) 6434 6435 rc = PGMPhysWrite(IEMCPU_TO_VM(pIemCpu), 6435 6436 pIemCpu->aMemBbMappings[iMemMap].GCPhysSecond, 6436 6437 pbBuf + cbFirst, 6437 cbSecond); 6438 cbSecond, 6439 PGMACCESSORIGIN_IEM); 6438 6440 } 6439 6441 else … … 6575 6577 if (!pIemCpu->fBypassHandlers) 6576 6578 { 6577 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysFirst, pbBuf, cbFirstPage );6579 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysFirst, pbBuf, cbFirstPage, PGMACCESSORIGIN_IEM); 6578 6580 if (rc != VINF_SUCCESS) 6579 6581 { … … 6582 6584 return rc; 6583 6585 } 6584 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysSecond, pbBuf + cbFirstPage, cbSecondPage );6586 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysSecond, pbBuf + cbFirstPage, cbSecondPage, PGMACCESSORIGIN_IEM); 6585 6587 if (rc != VINF_SUCCESS) 6586 6588 { … … 6695 6697 int rc; 6696 6698 if (!pIemCpu->fBypassHandlers) 6697 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysFirst, pbBuf, cbMem );6699 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhysFirst, pbBuf, cbMem, PGMACCESSORIGIN_IEM); 6698 6700 else 6699 6701 rc = PGMPhysSimpleReadGCPhys(IEMCPU_TO_VM(pIemCpu), pbBuf, GCPhysFirst, cbMem); -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r55896 r55899 678 678 return rc; 679 679 #else 680 return PGMPhysReadGCPtr(pVCpu, pDest, GCSrc, cb );680 return PGMPhysReadGCPtr(pVCpu, pDest, GCSrc, cb, PGMACCESSORIGIN_IOM); 681 681 #endif 682 682 } … … 696 696 #else 697 697 NOREF(pCtxCore); 698 return PGMPhysWriteGCPtr(pVCpu, GCPtrDst, pvSrc, cb );698 return PGMPhysWriteGCPtr(pVCpu, GCPtrDst, pvSrc, cb, PGMACCESSORIGIN_IOM); 699 699 #endif 700 700 } -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r55896 r55899 2215 2215 * @param pvBuf Where to put the read bits. 2216 2216 * @param cbRead How many bytes to read. 2217 */ 2218 VMMDECL(int) PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 2217 * @param enmOrigin The origin of this call. 2218 */ 2219 VMMDECL(int) PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, PGMACCESSORIGIN enmOrigin) 2219 2220 { 2220 2221 AssertMsgReturn(cbRead > 0, ("don't even think about reading zero bytes!\n"), VINF_SUCCESS); … … 2760 2761 * @param pvBuf What to write. 2761 2762 * @param cbWrite How many bytes to write. 2762 */ 2763 VMMDECL(int) PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 2764 { 2765 AssertMsg(!pVM->pgm.s.fNoMorePhysWrites, ("Calling PGMPhysWrite after pgmR3Save()!\n")); 2763 * @param enmOrigin Who is calling. 2764 */ 2765 VMMDECL(int) PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, PGMACCESSORIGIN enmOrigin) 2766 { 2767 AssertMsg(!pVM->pgm.s.fNoMorePhysWrites, ("Calling PGMPhysWrite after pgmR3Save()! enmOrigin=%d\n", enmOrigin)); 2766 2768 AssertMsgReturn(cbWrite > 0, ("don't even think about writing zero bytes!\n"), VINF_SUCCESS); 2767 2769 LogFlow(("PGMPhysWrite: %RGp %d\n", GCPhys, cbWrite)); … … 3271 3273 * @param GCPtrSrc The source address (GC pointer). 3272 3274 * @param cb The number of bytes to read. 3273 * @thread The vCPU EMT. 3274 */ 3275 VMMDECL(int) PGMPhysReadGCPtr(PVMCPU pVCpu, void *pvDst, RTGCPTR GCPtrSrc, size_t cb) 3275 * @param enmOrigin Who is calling. 3276 * @thread EMT(pVCpu) 3277 */ 3278 VMMDECL(int) PGMPhysReadGCPtr(PVMCPU pVCpu, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, PGMACCESSORIGIN enmOrigin) 3276 3279 { 3277 3280 RTGCPHYS GCPhys; … … 3306 3309 } 3307 3310 3308 return PGMPhysRead(pVM, GCPhys, pvDst, cb );3311 return PGMPhysRead(pVM, GCPhys, pvDst, cb, enmOrigin); 3309 3312 } 3310 3313 … … 3330 3333 if (cbRead < cb) 3331 3334 { 3332 rc = PGMPhysRead(pVM, GCPhys, pvDst, cbRead );3335 rc = PGMPhysRead(pVM, GCPhys, pvDst, cbRead, enmOrigin); 3333 3336 if (RT_FAILURE(rc)) 3334 3337 return rc; 3335 3338 } 3336 3339 else /* Last page (cbRead is PAGE_SIZE, we only need cb!) */ 3337 return PGMPhysRead(pVM, GCPhys, pvDst, cb );3340 return PGMPhysRead(pVM, GCPhys, pvDst, cb, enmOrigin); 3338 3341 3339 3342 /* next */ … … 3360 3363 * @param pvSrc The source address. 3361 3364 * @param cb The number of bytes to write. 3362 */ 3363 VMMDECL(int) PGMPhysWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb) 3365 * @param enmOrigin Who is calling. 3366 */ 3367 VMMDECL(int) PGMPhysWriteGCPtr(PVMCPU pVCpu, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb, PGMACCESSORIGIN enmOrigin) 3364 3368 { 3365 3369 RTGCPHYS GCPhys; … … 3398 3402 } 3399 3403 3400 return PGMPhysWrite(pVM, GCPhys, pvSrc, cb );3404 return PGMPhysWrite(pVM, GCPhys, pvSrc, cb, enmOrigin); 3401 3405 } 3402 3406 … … 3426 3430 if (cbWrite < cb) 3427 3431 { 3428 rc = PGMPhysWrite(pVM, GCPhys, pvSrc, cbWrite );3432 rc = PGMPhysWrite(pVM, GCPhys, pvSrc, cbWrite, enmOrigin); 3429 3433 if (RT_FAILURE(rc)) 3430 3434 return rc; 3431 3435 } 3432 3436 else /* Last page (cbWrite is PAGE_SIZE, we only need cb!) */ 3433 rc = PGMPhysWrite(pVM, GCPhys, pvSrc, cb );3437 rc = PGMPhysWrite(pVM, GCPhys, pvSrc, cb, enmOrigin); 3434 3438 3435 3439 /* next */ -
trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
r52363 r55899 496 496 */ 497 497 X86DESC GstDesc; 498 int rc = PGMPhysReadGCPtr(pVCpu, &GstDesc, GCPtrDesc, sizeof(GstDesc) );498 int rc = PGMPhysReadGCPtr(pVCpu, &GstDesc, GCPtrDesc, sizeof(GstDesc), PGMACCESSORIGIN_IOM); 499 499 if (RT_FAILURE(rc)) 500 500 { -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r55863 r55899 12064 12064 Assert(sizeof(Eflags.u32) >= cbParm); 12065 12065 Eflags.u32 = 0; 12066 rc = PGMPhysRead(pVM, (RTGCPHYS)GCPtrStack, &Eflags.u32, cbParm );12066 rc = PGMPhysRead(pVM, (RTGCPHYS)GCPtrStack, &Eflags.u32, cbParm, PGMACCESSORIGIN_HM); 12067 12067 } 12068 12068 if (RT_FAILURE(rc)) … … 12117 12117 Eflags.Bits.u1VM = 0; 12118 12118 12119 rc = PGMPhysWrite(pVM, (RTGCPHYS)GCPtrStack, &Eflags.u, cbParm );12119 rc = PGMPhysWrite(pVM, (RTGCPHYS)GCPtrStack, &Eflags.u, cbParm, PGMACCESSORIGIN_HM); 12120 12120 if (RT_FAILURE(rc)) 12121 12121 { … … 12152 12152 &GCPtrStack); 12153 12153 if (RT_SUCCESS(rc)) 12154 rc = PGMPhysRead(pVM, (RTGCPHYS)GCPtrStack, &aIretFrame[0], sizeof(aIretFrame) );12154 rc = PGMPhysRead(pVM, (RTGCPHYS)GCPtrStack, &aIretFrame[0], sizeof(aIretFrame), PGMACCESSORIGIN_HM); 12155 12155 if (RT_FAILURE(rc)) 12156 12156 { -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r53797 r55899 205 205 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbRead)); 206 206 207 int rc = PGMPhysRead(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbRead );207 int rc = PGMPhysRead(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE); 208 208 AssertRC(rc); /** @todo track down the users for this bugger. */ 209 209 … … 220 220 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbWrite)); 221 221 222 int rc = PGMPhysWrite(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbWrite );222 int rc = PGMPhysWrite(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE); 223 223 AssertRC(rc); /** @todo track down the users for this bugger. */ 224 224 -
trunk/src/VBox/VMM/VMMR3/FTM.cpp
r47786 r55899 925 925 { 926 926 /* Update the guest memory of the standby VM. */ 927 int rc = PGMR3PhysWriteExternal(pVM, pNode->Core.Key, pNode->pPage, PAGE_SIZE, "FTMemSync");927 int rc = PGMR3PhysWriteExternal(pVM, pNode->Core.Key, pNode->pPage, PAGE_SIZE, PGMACCESSORIGIN_FTM); 928 928 AssertRC(rc); 929 929 } -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r54737 r55899 717 717 int rc; 718 718 if (VM_IS_EMT(pVM)) 719 rc = PGMPhysRead(pVM, GCPhys, pvBuf, cbRead );720 else 721 rc = PGMR3PhysReadExternal(pVM, GCPhys, pvBuf, cbRead );719 rc = PGMPhysRead(pVM, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE); 720 else 721 rc = PGMR3PhysReadExternal(pVM, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE); 722 722 723 723 Log(("pdmR3DevHlp_PhysRead: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); … … 745 745 int rc; 746 746 if (VM_IS_EMT(pVM)) 747 rc = PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite );748 else 749 rc = PGMR3PhysWriteExternal(pVM, GCPhys, pvBuf, cbWrite, pDevIns->pReg->szName);747 rc = PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE); 748 else 749 rc = PGMR3PhysWriteExternal(pVM, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE); 750 750 751 751 Log(("pdmR3DevHlp_PhysWrite: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r55493 r55899 87 87 * EMT worker for PGMR3PhysReadExternal. 88 88 */ 89 static DECLCALLBACK(int) pgmR3PhysReadExternalEMT(PVM pVM, PRTGCPHYS pGCPhys, void *pvBuf, size_t cbRead) 90 { 91 PGMPhysRead(pVM, *pGCPhys, pvBuf, cbRead); 89 static DECLCALLBACK(int) pgmR3PhysReadExternalEMT(PVM pVM, PRTGCPHYS pGCPhys, void *pvBuf, size_t cbRead, 90 PGMACCESSORIGIN enmOrigin) 91 { 92 PGMPhysRead(pVM, *pGCPhys, pvBuf, cbRead, enmOrigin); 92 93 return VINF_SUCCESS; 93 94 } … … 104 105 * @param pvBuf Where to read into. 105 106 * @param cbRead How many bytes to read. 107 * @param enmOrigin Who is calling. 106 108 * 107 109 * @thread Any but EMTs. 108 110 */ 109 VMMR3DECL(int) PGMR3PhysReadExternal(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead )111 VMMR3DECL(int) PGMR3PhysReadExternal(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, PGMACCESSORIGIN enmOrigin) 110 112 { 111 113 VM_ASSERT_OTHER_THREAD(pVM); … … 143 145 pgmUnlock(pVM); 144 146 145 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysReadExternalEMT, 4,146 pVM, &GCPhys, pvBuf, cbRead );147 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysReadExternalEMT, 5, 148 pVM, &GCPhys, pvBuf, cbRead, enmOrigin); 147 149 } 148 150 Assert(!PGM_PAGE_IS_MMIO_OR_SPECIAL_ALIAS(pPage)); … … 215 217 * EMT worker for PGMR3PhysWriteExternal. 216 218 */ 217 static DECLCALLBACK(int) pgmR3PhysWriteExternalEMT(PVM pVM, PRTGCPHYS pGCPhys, const void *pvBuf, size_t cbWrite) 219 static DECLCALLBACK(int) pgmR3PhysWriteExternalEMT(PVM pVM, PRTGCPHYS pGCPhys, const void *pvBuf, size_t cbWrite, 220 PGMACCESSORIGIN enmOrigin) 218 221 { 219 222 /** @todo VERR_EM_NO_MEMORY */ 220 PGMPhysWrite(pVM, *pGCPhys, pvBuf, cbWrite );223 PGMPhysWrite(pVM, *pGCPhys, pvBuf, cbWrite, enmOrigin); 221 224 return VINF_SUCCESS; 222 225 } … … 234 237 * @param pvBuf What to write. 235 238 * @param cbWrite How many bytes to write. 236 * @param pszWho Who is writing. For tracking down who is writing 237 * after we've saved the state. 239 * @param enmOrigin Who is calling. 238 240 * 239 241 * @thread Any but EMTs. 240 242 */ 241 VMMDECL(int) PGMR3PhysWriteExternal(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, const char *pszWho)243 VMMDECL(int) PGMR3PhysWriteExternal(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, PGMACCESSORIGIN enmOrigin) 242 244 { 243 245 VM_ASSERT_OTHER_THREAD(pVM); 244 246 245 247 AssertMsg(!pVM->pgm.s.fNoMorePhysWrites, 246 ("Calling PGMR3PhysWriteExternal after pgmR3Save()! GCPhys=%RGp cbWrite=%#x pszWho=%s\n",247 GCPhys, cbWrite, pszWho));248 ("Calling PGMR3PhysWriteExternal after pgmR3Save()! GCPhys=%RGp cbWrite=%#x enmOrigin=%d\n", 249 GCPhys, cbWrite, enmOrigin)); 248 250 AssertMsgReturn(cbWrite > 0, ("don't even think about writing zero bytes!\n"), VINF_SUCCESS); 249 251 LogFlow(("PGMR3PhysWriteExternal: %RGp %d\n", GCPhys, cbWrite)); … … 287 289 pgmUnlock(pVM); 288 290 289 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysWriteExternalEMT, 4,290 pVM, &GCPhys, pvBuf, cbWrite );291 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysWriteExternalEMT, 5, 292 pVM, &GCPhys, pvBuf, cbWrite, enmOrigin); 291 293 } 292 294 } -
trunk/src/VBox/VMM/VMMR3/PGMPhysRWTmpl.h
r44528 r55899 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 * @param pVM Pointer to the VM. 26 26 * @param GCPhys Physical address start reading from. 27 * @param enmOrigin Who is calling. 27 28 */ 28 VMMDECL(PGMPHYS_DATATYPE) PGMPHYSFN_READNAME(PVM pVM, RTGCPHYS GCPhys )29 VMMDECL(PGMPHYS_DATATYPE) PGMPHYSFN_READNAME(PVM pVM, RTGCPHYS GCPhys, PGMACCESSORIGIN enmOrigin) 29 30 { 30 31 Assert(VM_IS_EMT(pVM)); 31 32 PGMPHYS_DATATYPE val; 32 PGMPhysRead(pVM, GCPhys, &val, sizeof(val) );33 PGMPhysRead(pVM, GCPhys, &val, sizeof(val), enmOrigin); 33 34 return val; 34 35 } … … 44 45 * @param GCPhys Physical address to write to. 45 46 * @param val What to write. 47 * @param enmOrigin Who is calling. 46 48 */ 47 VMMDECL(void) PGMPHYSFN_WRITENAME(PVM pVM, RTGCPHYS GCPhys, PGMPHYS_DATATYPE val )49 VMMDECL(void) PGMPHYSFN_WRITENAME(PVM pVM, RTGCPHYS GCPhys, PGMPHYS_DATATYPE val, PGMACCESSORIGIN enmOrigin) 48 50 { 49 51 Assert(VM_IS_EMT(pVM)); 50 PGMPhysWrite(pVM, GCPhys, &val, sizeof(val) );52 PGMPhysWrite(pVM, GCPhys, &val, sizeof(val), enmOrigin); 51 53 } 52 54 -
trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
r53797 r55899 201 201 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbRead)); 202 202 203 int rc = PGMPhysRead(pDevIns->Internal.s.pVMRC, GCPhys, pvBuf, cbRead );203 int rc = PGMPhysRead(pDevIns->Internal.s.pVMRC, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE); 204 204 AssertRC(rc); /** @todo track down the users for this bugger. */ 205 205 … … 216 216 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbWrite)); 217 217 218 int rc = PGMPhysWrite(pDevIns->Internal.s.pVMRC, GCPhys, pvBuf, cbWrite );218 int rc = PGMPhysWrite(pDevIns->Internal.s.pVMRC, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE); 219 219 AssertRC(rc); /** @todo track down the users for this bugger. */ 220 220 -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r52931 r55899 311 311 /* Write that page to the guest - skip known rom areas for now. */ 312 312 if (GCPhys < 0xa0000 || GCPhys >= 0x100000) /* ASSUME size of a8Page is a power of 2. */ 313 PGMPhysWrite(pVM, GCPhys, &au8Page, cbRead );313 PGMPhysWrite(pVM, GCPhys, &au8Page, cbRead, PGMACCESSORIGIN_DEBUGGER); 314 314 GCPhys += cbRead; 315 315 } -
trunk/src/recompiler/VBoxREMWrapper.cpp
r55493 r55899 832 832 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 833 833 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 834 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 834 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 835 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 835 836 }; 836 837 static const REMPARMDESC g_aArgsPGMPhysSimpleReadGCPtr[] = … … 846 847 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 847 848 { REMPARMDESC_FLAGS_INT, sizeof(const void *), NULL }, 848 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 849 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 850 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 849 851 }; 850 852 static const REMPARMDESC g_aArgsPGMChangeMode[] = … … 864 866 { 865 867 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 866 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL } 868 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 869 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 867 870 }; 868 871 static const REMPARMDESC g_aArgsPGMR3PhysWriteU8[] = … … 870 873 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 871 874 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 872 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 875 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL }, 876 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 873 877 }; 874 878 static const REMPARMDESC g_aArgsPGMR3PhysWriteU16[] = … … 876 880 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 877 881 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 878 { REMPARMDESC_FLAGS_INT, sizeof(uint16_t), NULL } 882 { REMPARMDESC_FLAGS_INT, sizeof(uint16_t), NULL }, 883 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 879 884 }; 880 885 static const REMPARMDESC g_aArgsPGMR3PhysWriteU32[] = … … 882 887 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 883 888 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 884 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 889 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 890 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 885 891 }; 886 892 static const REMPARMDESC g_aArgsPGMR3PhysWriteU64[] = … … 888 894 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 889 895 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 890 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL } 896 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL }, 897 { REMPARMDESC_FLAGS_INT, sizeof(PGMACCESSORIGIN), NULL } 891 898 }; 892 899 static const REMPARMDESC g_aArgsRTMemReallocTag[] = -
trunk/src/recompiler/VBoxRecompiler.c
r55493 r55899 3565 3565 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3566 3566 VBOX_CHECK_ADDR(SrcGCPhys); 3567 PGMPhysRead(cpu_single_env->pVM, SrcGCPhys, pvDst, cb );3567 PGMPhysRead(cpu_single_env->pVM, SrcGCPhys, pvDst, cb, PGMACCESSORIGIN_REM); 3568 3568 #ifdef VBOX_DEBUG_PHYS 3569 3569 LogRel(("read(%d): %08x\n", cb, (uint32_t)SrcGCPhys)); … … 3583 3583 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3584 3584 VBOX_CHECK_ADDR(SrcGCPhys); 3585 val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys );3585 val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3586 3586 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3587 3587 #ifdef VBOX_DEBUG_PHYS … … 3602 3602 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3603 3603 VBOX_CHECK_ADDR(SrcGCPhys); 3604 val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys );3604 val = PGMR3PhysReadU8(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3605 3605 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3606 3606 #ifdef VBOX_DEBUG_PHYS … … 3621 3621 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3622 3622 VBOX_CHECK_ADDR(SrcGCPhys); 3623 val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys );3623 val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3624 3624 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3625 3625 #ifdef VBOX_DEBUG_PHYS … … 3640 3640 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3641 3641 VBOX_CHECK_ADDR(SrcGCPhys); 3642 val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys );3642 val = PGMR3PhysReadU16(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3643 3643 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3644 3644 #ifdef VBOX_DEBUG_PHYS … … 3659 3659 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3660 3660 VBOX_CHECK_ADDR(SrcGCPhys); 3661 val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys );3661 val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3662 3662 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3663 3663 #ifdef VBOX_DEBUG_PHYS … … 3678 3678 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3679 3679 VBOX_CHECK_ADDR(SrcGCPhys); 3680 val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys );3680 val = PGMR3PhysReadU32(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3681 3681 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3682 3682 #ifdef VBOX_DEBUG_PHYS … … 3697 3697 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3698 3698 VBOX_CHECK_ADDR(SrcGCPhys); 3699 val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys );3699 val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3700 3700 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3701 3701 #ifdef VBOX_DEBUG_PHYS … … 3716 3716 STAM_PROFILE_ADV_START(&gStatMemRead, a); 3717 3717 VBOX_CHECK_ADDR(SrcGCPhys); 3718 val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys );3718 val = PGMR3PhysReadU64(cpu_single_env->pVM, SrcGCPhys, PGMACCESSORIGIN_REM); 3719 3719 STAM_PROFILE_ADV_STOP(&gStatMemRead, a); 3720 3720 #ifdef VBOX_DEBUG_PHYS … … 3736 3736 STAM_PROFILE_ADV_START(&gStatMemWrite, a); 3737 3737 VBOX_CHECK_ADDR(DstGCPhys); 3738 PGMPhysWrite(cpu_single_env->pVM, DstGCPhys, pvSrc, cb );3738 PGMPhysWrite(cpu_single_env->pVM, DstGCPhys, pvSrc, cb, PGMACCESSORIGIN_REM); 3739 3739 STAM_PROFILE_ADV_STOP(&gStatMemWrite, a); 3740 3740 #ifdef VBOX_DEBUG_PHYS … … 3754 3754 STAM_PROFILE_ADV_START(&gStatMemWrite, a); 3755 3755 VBOX_CHECK_ADDR(DstGCPhys); 3756 PGMR3PhysWriteU8(cpu_single_env->pVM, DstGCPhys, val );3756 PGMR3PhysWriteU8(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM); 3757 3757 STAM_PROFILE_ADV_STOP(&gStatMemWrite, a); 3758 3758 #ifdef VBOX_DEBUG_PHYS … … 3772 3772 STAM_PROFILE_ADV_START(&gStatMemWrite, a); 3773 3773 VBOX_CHECK_ADDR(DstGCPhys); 3774 PGMR3PhysWriteU16(cpu_single_env->pVM, DstGCPhys, val );3774 PGMR3PhysWriteU16(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM); 3775 3775 STAM_PROFILE_ADV_STOP(&gStatMemWrite, a); 3776 3776 #ifdef VBOX_DEBUG_PHYS … … 3790 3790 STAM_PROFILE_ADV_START(&gStatMemWrite, a); 3791 3791 VBOX_CHECK_ADDR(DstGCPhys); 3792 PGMR3PhysWriteU32(cpu_single_env->pVM, DstGCPhys, val );3792 PGMR3PhysWriteU32(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM); 3793 3793 STAM_PROFILE_ADV_STOP(&gStatMemWrite, a); 3794 3794 #ifdef VBOX_DEBUG_PHYS … … 3808 3808 STAM_PROFILE_ADV_START(&gStatMemWrite, a); 3809 3809 VBOX_CHECK_ADDR(DstGCPhys); 3810 PGMR3PhysWriteU64(cpu_single_env->pVM, DstGCPhys, val );3810 PGMR3PhysWriteU64(cpu_single_env->pVM, DstGCPhys, val, PGMACCESSORIGIN_REM); 3811 3811 STAM_PROFILE_ADV_STOP(&gStatMemWrite, a); 3812 3812 #ifdef VBOX_DEBUG_PHYS … … 3891 3891 uint8_t u8; 3892 3892 Log2(("remR3HandlerReadU8: GCPhys=%RGp\n", (RTGCPHYS)GCPhys)); 3893 PGMPhysRead((PVM)pvVM, GCPhys, &u8, sizeof(u8) );3893 PGMPhysRead((PVM)pvVM, GCPhys, &u8, sizeof(u8), PGMACCESSORIGIN_REM); 3894 3894 return u8; 3895 3895 } … … 3899 3899 uint16_t u16; 3900 3900 Log2(("remR3HandlerReadU16: GCPhys=%RGp\n", (RTGCPHYS)GCPhys)); 3901 PGMPhysRead((PVM)pvVM, GCPhys, &u16, sizeof(u16) );3901 PGMPhysRead((PVM)pvVM, GCPhys, &u16, sizeof(u16), PGMACCESSORIGIN_REM); 3902 3902 return u16; 3903 3903 } … … 3907 3907 uint32_t u32; 3908 3908 Log2(("remR3HandlerReadU32: GCPhys=%RGp\n", (RTGCPHYS)GCPhys)); 3909 PGMPhysRead((PVM)pvVM, GCPhys, &u32, sizeof(u32) );3909 PGMPhysRead((PVM)pvVM, GCPhys, &u32, sizeof(u32), PGMACCESSORIGIN_REM); 3910 3910 return u32; 3911 3911 } … … 3914 3914 { 3915 3915 Log2(("remR3HandlerWriteU8: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3916 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint8_t) );3916 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint8_t), PGMACCESSORIGIN_REM); 3917 3917 } 3918 3918 … … 3920 3920 { 3921 3921 Log2(("remR3HandlerWriteU16: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3922 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint16_t) );3922 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint16_t), PGMACCESSORIGIN_REM); 3923 3923 } 3924 3924 … … 3926 3926 { 3927 3927 Log2(("remR3HandlerWriteU32: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3928 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint32_t) );3928 PGMPhysWrite((PVM)pvVM, GCPhys, &u32, sizeof(uint32_t), PGMACCESSORIGIN_REM); 3929 3929 } 3930 3930
Note:
See TracChangeset
for help on using the changeset viewer.