- Timestamp:
- Jul 3, 2009 3:07:16 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EMHwaccm.cpp
r21209 r21210 301 301 302 302 /* Try to restart the io instruction that was refused in ring-0. */ 303 rc = HWACCMR3RestartPendingIOInstr(pVM, pVCpu );303 rc = HWACCMR3RestartPendingIOInstr(pVM, pVCpu, pCtx); 304 304 if (rc == VINF_SUCCESS) 305 305 { -
trunk/src/VBox/VMM/HWACCM.cpp
r21209 r21210 1640 1640 * @returns VBox status code 1641 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; 1642 * @param pVCpu The VMCPU to operate on. 1643 * @param pCtx VCPU register context 1644 */ 1645 VMMR3DECL(int) HWACCMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx) 1646 { 1647 HWACCMPENDINGIO enmType = pVCpu->hwaccm.s.PendingIO.enmType; 1648 int rc; 1649 1650 return VERR_NOT_FOUND; 1651 1652 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_INVALID; 1653 1654 if ( pVCpu->hwaccm.s.PendingIO.GCPtrRip != pCtx->rip 1655 || pVCpu->hwaccm.s.PendingIO.enmType == HWACCMPENDINGIO_INVALID) 1656 return VERR_NOT_FOUND; 1657 1658 switch (enmType) 1659 { 1660 case HWACCMPENDINGIO_PORT_READ: 1661 { 1662 uint32_t uAndVal = pVCpu->hwaccm.s.PendingIO.s.Port.uAndVal; 1663 uint32_t u32Val = 0; 1664 1665 rc = IOMIOPortRead(pVM, pVCpu->hwaccm.s.PendingIO.s.Port.uPort, 1666 &u32Val, 1667 pVCpu->hwaccm.s.PendingIO.s.Port.cbSize); 1668 if (IOM_SUCCESS(rc)) 1669 { 1670 /* Write back to the EAX register. */ 1671 pCtx->eax = (pCtx->eax & ~uAndVal) | (u32Val & uAndVal); 1672 pCtx->rip = pVCpu->hwaccm.s.PendingIO.GCPtrRipNext; 1673 } 1674 break; 1675 } 1676 1677 case HWACCMPENDINGIO_PORT_WRITE: 1678 rc = IOMIOPortWrite(pVM, pVCpu->hwaccm.s.PendingIO.s.Port.uPort, 1679 pCtx->eax & pVCpu->hwaccm.s.PendingIO.s.Port.uAndVal, 1680 pVCpu->hwaccm.s.PendingIO.s.Port.cbSize); 1681 if (IOM_SUCCESS(rc)) 1682 pCtx->rip = pVCpu->hwaccm.s.PendingIO.GCPtrRipNext; 1683 break; 1684 1685 default: 1686 AssertFailed(); 1687 return VERR_INTERNAL_ERROR; 1688 } 1689 1690 return rc; 1647 1691 } 1648 1692 -
trunk/src/VBox/VMM/HWACCMInternal.h
r21209 r21210 608 608 unsigned uAndVal; 609 609 unsigned cbSize; 610 } Read; 611 struct 612 { 613 unsigned uPort; 614 unsigned uValue; 615 unsigned cbSize; 616 } Write; 610 } Port; 617 611 uint64_t aRaw[2]; 618 } Port;612 } s; 619 613 } PendingIO; 620 614 -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r21209 r21210 1232 1232 VMMR0DECL(void) HWACCMR0SavePendingIOPortRead(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uAndVal, unsigned cbSize) 1233 1233 { 1234 pVCpu->hwaccm.s.PendingIO.enmType 1235 pVCpu->hwaccm.s.PendingIO.GCPtrRip 1236 pVCpu->hwaccm.s.PendingIO.GCPtrRipNext 1237 pVCpu->hwaccm.s.PendingIO. Port.Read.uPort = uPort;1238 pVCpu->hwaccm.s.PendingIO. Port.Read.uAndVal = uAndVal;1239 pVCpu->hwaccm.s.PendingIO. Port.Read.cbSize = cbSize;1234 pVCpu->hwaccm.s.PendingIO.enmType = HWACCMPENDINGIO_PORT_READ; 1235 pVCpu->hwaccm.s.PendingIO.GCPtrRip = GCPtrRip; 1236 pVCpu->hwaccm.s.PendingIO.GCPtrRipNext = GCPtrRipNext; 1237 pVCpu->hwaccm.s.PendingIO.s.Port.uPort = uPort; 1238 pVCpu->hwaccm.s.PendingIO.s.Port.uAndVal = uAndVal; 1239 pVCpu->hwaccm.s.PendingIO.s.Port.cbSize = cbSize; 1240 1240 return; 1241 1241 } … … 1247 1247 * @param GCPtrRIP Address of IO instruction 1248 1248 * @param uPort Port address 1249 * @param u Value Value to write1249 * @param uAndVal And mask for fetching the result from eax 1250 1250 * @param cbSize Read size 1251 1251 */ 1252 VMMR0DECL(void) HWACCMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned u Value, unsigned cbSize)1253 { 1254 pVCpu->hwaccm.s.PendingIO.enmType 1255 pVCpu->hwaccm.s.PendingIO.GCPtrRip 1256 pVCpu->hwaccm.s.PendingIO.GCPtrRipNext 1257 pVCpu->hwaccm.s.PendingIO. Port.Write.uPort = uPort;1258 pVCpu->hwaccm.s.PendingIO. Port.Write.uValue = uValue;1259 pVCpu->hwaccm.s.PendingIO. Port.Write.cbSize = cbSize;1252 VMMR0DECL(void) HWACCMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uAndVal, 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; 1257 pVCpu->hwaccm.s.PendingIO.s.Port.uPort = uPort; 1258 pVCpu->hwaccm.s.PendingIO.s.Port.uAndVal = uAndVal; 1259 pVCpu->hwaccm.s.PendingIO.s.Port.cbSize = cbSize; 1260 1260 return; 1261 1261 } -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r21209 r21210 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, pVMCB->ctrl.u64ExitInfo2, IoExitInfo.n.u16Port, pCtx->eax &uAndVal, uIOSize);2111 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, pVMCB->ctrl.u64ExitInfo2, IoExitInfo.n.u16Port, uAndVal, uIOSize); 2112 2112 } 2113 2113 else -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r21209 r21210 3392 3392 rc = IOMIOPortWrite(pVM, uPort, pCtx->eax & uAndVal, cbSize); 3393 3393 if (rc == VINF_IOM_HC_IOPORT_WRITE) 3394 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, pCtx->rip + cbInstr, uPort, pCtx->eax &uAndVal, cbSize);3394 HWACCMR0SavePendingIOPortWrite(pVCpu, pCtx->rip, pCtx->rip + cbInstr, uPort, uAndVal, cbSize); 3395 3395 } 3396 3396 else
Note:
See TracChangeset
for help on using the changeset viewer.