- Timestamp:
- Jul 3, 2009 2:50:36 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r21196 r21209 351 351 EM_REG_COUNTER_USED(&pStats->StatIn, "/EM/CPU%d/R3/PrivInst/In", "Number of in instructions."); 352 352 EM_REG_COUNTER_USED(&pStats->StatOut, "/EM/CPU%d/R3/PrivInst/Out", "Number of out instructions."); 353 EM_REG_COUNTER_USED(&pStats->StatIoRestarted, "/EM/CPU%d/R3/PrivInst/IoRestarted", "Number of restarted i/o instructions."); 353 354 EM_REG_COUNTER_USED(&pStats->StatHlt, "/EM/CPU%d/R3/PrivInst/Hlt", "Number of hlt instructions not handled in GC because of PATM."); 354 355 EM_REG_COUNTER_USED(&pStats->StatInvlpg, "/EM/CPU%d/R3/PrivInst/Invlpg", "Number of invlpg instructions."); -
trunk/src/VBox/VMM/EMHwaccm.cpp
r21208 r21209 300 300 STAM_PROFILE_START(&pVCpu->em.s.StatIOEmu, a); 301 301 302 /* Try to restart the io instruction that was refused in ring-0. */ 303 rc = HWACCMR3RestartPendingIOInstr(pVM, pVCpu); 304 if (rc == VINF_SUCCESS) 305 { 306 STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoRestarted); 307 STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a); 308 return rc; /* rip already updated. */ 309 } 310 302 311 /** @todo probably we should fall back to the recompiler; otherwise we'll go back and forth between HC & GC 303 312 * as io instructions tend to come in packages of more than one -
trunk/src/VBox/VMM/EMInternal.h
r21196 r21209 249 249 STAMCOUNTER StatSti; 250 250 STAMCOUNTER StatIn; 251 STAMCOUNTER StatIoRestarted; 251 252 STAMCOUNTER StatOut; 252 253 STAMCOUNTER StatInvlpg; -
trunk/src/VBox/VMM/HWACCM.cpp
r21125 r21209 1635 1635 } 1636 1636 1637 /** 1638 * Restart an I/O instruction that was refused in ring-0 1639 * 1640 * @returns VBox status code 1641 * @param pVM The VM to operate on. 1642 * @param pVM The VM to operate on. 1643 */ 1644 VMMR3DECL(int) HWACCMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu) 1645 { 1646 return VERR_NOT_FOUND; 1647 } 1637 1648 1638 1649 /** -
trunk/src/VBox/VMM/HWACCMInternal.h
r21208 r21209 599 599 HWACCMPENDINGIO enmType; 600 600 uint32_t uPadding; 601 RTGCPTR GCPtrRip; 602 RTGCPTR GCPtrRipNext; 601 603 union 602 604 { 603 605 struct 604 606 { 605 RTGCPTR rip;606 607 unsigned uPort; 607 608 unsigned uAndVal; … … 610 611 struct 611 612 { 612 RTGCPTR rip;613 613 unsigned uPort; 614 614 unsigned uValue; 615 615 unsigned cbSize; 616 616 } Write; 617 uint64_t aRaw[ 4];617 uint64_t aRaw[2]; 618 618 } Port; 619 619 } PendingIO; -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r21208 r21209 1224 1224 * 1225 1225 * @param pVCpu The VMCPU to operate on. 1226 * @param GCPtrRIP Address of IO instruction 1226 * @param GCPtrRip Address of IO instruction 1227 * @param GCPtrRipNext Address of the next instruction 1227 1228 * @param uPort Port address 1228 1229 * @param uAndVal And mask for saving the result in eax 1229 1230 * @param cbSize Read size 1230 1231 */ 1231 VMMR0DECL(void) HWACCMR0SavePendingIOPortRead(PVMCPU pVCpu, RTGCPTR GCPtrRIP, unsigned uPort, unsigned uAndVal, unsigned cbSize) 1232 { 1233 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_PORT_READ; 1234 pVCpu->hwaccm.s.PendingIO.Port.Read.rip = GCPtrRIP; 1232 VMMR0DECL(void) HWACCMR0SavePendingIOPortRead(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uAndVal, unsigned cbSize) 1233 { 1234 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_PORT_READ; 1235 pVCpu->hwaccm.s.PendingIO.GCPtrRip = GCPtrRip; 1236 pVCpu->hwaccm.s.PendingIO.GCPtrRipNext = GCPtrRipNext; 1235 1237 pVCpu->hwaccm.s.PendingIO.Port.Read.uPort = uPort; 1236 1238 pVCpu->hwaccm.s.PendingIO.Port.Read.uAndVal = uAndVal; … … 1248 1250 * @param cbSize Read size 1249 1251 */ 1250 VMMR0DECL(void) HWACCMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRIP, unsigned uPort, unsigned uValue, unsigned cbSize) 1251 { 1252 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_PORT_WRITE; 1253 pVCpu->hwaccm.s.PendingIO.Port.Write.rip = GCPtrRIP; 1252 VMMR0DECL(void) HWACCMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uValue, unsigned cbSize) 1253 { 1254 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_PORT_WRITE; 1255 pVCpu->hwaccm.s.PendingIO.GCPtrRip = GCPtrRip; 1256 pVCpu->hwaccm.s.PendingIO.GCPtrRipNext = GCPtrRipNext; 1254 1257 pVCpu->hwaccm.s.PendingIO.Port.Write.uPort = uPort; 1255 1258 pVCpu->hwaccm.s.PendingIO.Port.Write.uValue = uValue; -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r21208 r21209 2109 2109 rc = IOMIOPortWrite(pVM, IoExitInfo.n.u16Port, pCtx->eax & uAndVal, uIOSize); 2110 2110 if (rc == VINF_IOM_HC_IOPORT_WRITE) 2111 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, IoExitInfo.n.u16Port, pCtx->eax & uAndVal, uIOSize);2111 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, pVMCB->ctrl.u64ExitInfo2, IoExitInfo.n.u16Port, pCtx->eax & uAndVal, uIOSize); 2112 2112 } 2113 2113 else … … 2125 2125 else 2126 2126 if (rc == VINF_IOM_HC_IOPORT_READ) 2127 HWACCMR0SavePendingIOPortRead(pVCpu, pCtx->rip, IoExitInfo.n.u16Port, uAndVal, uIOSize);2127 HWACCMR0SavePendingIOPortRead(pVCpu, pCtx->rip, pVMCB->ctrl.u64ExitInfo2, IoExitInfo.n.u16Port, uAndVal, uIOSize); 2128 2128 } 2129 2129 } -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r21208 r21209 3392 3392 rc = IOMIOPortWrite(pVM, uPort, pCtx->eax & uAndVal, cbSize); 3393 3393 if (rc == VINF_IOM_HC_IOPORT_WRITE) 3394 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, uPort, pCtx->eax & uAndVal, cbSize);3394 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, pCtx->rip + cbInstr, uPort, pCtx->eax & uAndVal, cbSize); 3395 3395 } 3396 3396 else … … 3407 3407 else 3408 3408 if (rc == VINF_IOM_HC_IOPORT_READ) 3409 HWACCMR0SavePendingIOPortRead(pVCpu, pCtx->rip, uPort, uAndVal, cbSize);3409 HWACCMR0SavePendingIOPortRead(pVCpu, pCtx->rip, pCtx->rip + cbInstr, uPort, uAndVal, cbSize); 3410 3410 } 3411 3411 }
Note:
See TracChangeset
for help on using the changeset viewer.